1

I don't know a whole lot about .htaccess rules so forgive and help me ask the correct question.

Currently I have a .htaccess rule like:

RewriteRule ^surveys/(\S+)/directory/(\d+)/(\d+)/entry/(\d+)/?$ directories/index.cfm?sFuseAction=XXX.YYYY.ZZZZ&nDirectoryID=$2&nEntryID=$4&nCategoryID=$3&sDirectory=$1 [NC,L]

which I want to do a 301 redirect to:

RewriteRule ^(\S+)/directory/(\d+)/(\d+)/entry/(\d+)/?$     directories/index.cfm?sFuseAction=XXX.YYYY.ZZZZ&nDirectoryID=$2&nEntryID=$4&nCategoryID=$3&sDirectory=$1 [NC,L]

I'm unsure of the correct syntax to go about making these redirect correctly.

1

If you want to do a 301 redirect you will have to use the full URI path including the FQDN and protocol. Like so:

RewriteRule ^(\S+)/directory/(\d+)/(\d+)/entry/(\d+)/?$     http://www.example.com/directories/index.cfm?sFuseAction=XXX.YYYY.ZZZZ&nDirectoryID=$2&nEntryID=$4&nCategoryID=$3&sDirectory=$1 [NC,L]
  • I notice you don't include anything to indicate this is a 301, i've seen other examples of using [R=301,NC,L] at the end... is there a reason for this? – Jarede May 23 '13 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.