Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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]
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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