Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have the following in my .htaccess file-

Redirect 301 / http://www.foo.com/south-carolina-real-estate/ Redirect 301 /related/aiken-sc.htm?tkn=MXNDbGxQjEAKEwj0qrmMz_OYAhUdBGoKHY43MKwYASAFMKCTDDgNUKCTDFDLuosP http://www.foo.com/south-carolina-real-estate/ Redirect 301 /related/aiken-sc.htm http://www.foo.com/south-carolina-real-estate/ Redirect 301 /related/spartanburg.htm?tkn=0bzl_HmfIxIKEwj0qrmMz_OYAhUdBGoKHY43MKwYASADMKCTDDgNUKCTDFDLuosP http://www.foo.com/south-carolina-real-estate/ Redirect 301 /related/spartanburg.htm http://www.foo.com/south-carolina-real-estate/

But when I visit http://www.url.com/related/aiken-sc.htm I get the following URL in the browser-

http://www.foo.com/south-carolina-real-estate/related/aiken-sc.htm

Not sure what the problem is, this works fine on other sites...?

share|improve this question

migrated from stackoverflow.com Nov 19 '09 at 5:08

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

Try using the Web Sniffer to follow what's going on. The Web Sniffer does not follow redirects: it shows you all the HTTP headers as they are sent.

One thing to bear in mind is that redirects should use the HTTP header "Location: ".

share|improve this answer
add comment

Rearrange your redirects to be most specific to least specific; Redirect will match any path element beginning with your match so it never gets past the first redirect directive.

Redirect 301 /some/full/path/file.html http://www.there.com/xx/yy/zz/foo.html
Redirect 301 /some/full/ http://www.there.com/xx/yy/
Redirect 301 / http://www.there.com/xx.html
share|improve this answer
add comment

Your Answer

 
discard

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