Forum Moderators: phranque
I've moved a site from one location to another, and am using modRewrite to direct requests to the old address to the new one as follows:
RewriteEngine On
RewriteRule ^(.+) http://new.example.net/bounce/$1 [R,L]
When I visit the old site http://old.example.org/bounce/ things work fine.
If I visit it without the trailing slash (http://old.example.org/bounce), it tries to redirect to http://new.example.net/bounce//var/www/old/bounce - which doesn't exist.
Would anyone be able to suggest how I could correct this?
Many thanks.
[edited by: tedster at 1:09 am (utc) on June 28, 2005]
[edit reason] use example.net [/edit]
Welcome to WebmasterWorld!
The indications are that the second server is misconfigured, but the following might help:
RewriteEngine On
RewriteRule ^(.*)/?$ http://new.example.net/bounce/$1 [R=301,L]
Jim
Many thanks for the suggestion, but I'm afraid changing to your suggestion does exactly the same.
[old.example.net...]
redirects just fine to
[new.domain.com...]
[old.example.net...]
redirects just fine to
[new.domain.com...]
but
[old.example.net...]
redirects to
[new.domain.com...]
/var/www/rtcw/bounce is the location of the html files on old.example.net.
I guess it must be something to do with the redirect rather than the new server - the new server doesn't play any part in that redirect.
Thanks,
Chris.
If that is the case, then how does the old server 'know' about the file structure on the new server? -- That is, where did it get the information to know that your files are located in the var/www/rtcw/bounce path and redirect to them there?
You may have two redirects happening, one after the other. The first from the old server to the new, and the second to the messed-up local URL-path.
I suspect a configuration problem on the new server. Check the definition of document_root and also check the canonical name defined for the server. I recommend running with UseCanonicalName off as well.
You can use the server headers checker [webmasterworld.com] to "track" the redirects and see if there are multiple redirects happening.
Jim
The path is coming from the old server, as I mentioned above: /var/www/rtcw/bounce is the location of the html files on old.example.net.
The new server path is nothing like that shown, which is why I suspect it's coming from the old server as part of the redirect if it's not terminated with a '/'.