Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite.net$
RewriteRule ^(.*)$ http://www.newsite.com/$1 [L,R=301]
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.net [NC]
RewriteRule (.*) http://www.newsite.com/$1 [L,R=301]
Flush your cache completely in Firefox. You should flush your browser cache before testing any change to your server configuration.
If that doesn't help, then start Firefox in Safe Mode from (Windows) Start->All Programs menu. This will start Firefox with all extensions and themes disabled. If this helps, then go through the add-ons one-by-one, disabling them until you find the one that is causing the problem.
And if you still have trouble, look to your hosts file (location varies, but found in C:\Windows\System32\Drivers\etc on XP. It is named just 'hosts' -- no extension at all. Look in there to see if there is an entry for the domain in question, and if so, comment it out or delete it.
Whatever the problem is, it is client-side, and not server-side. Your code has no test in it for HTTP_USER_AGENT, so it does not know or care what browser or robot makes the request.
I escaped the period, made the hostname compare case-insensitive, and removed the end-anchor from your domain name. This last is to avoid failure of the rule if a port number is attached -- which is a valid possibility. An example of a valid request with a port number would be "http://www.oldsite.com:80/" and your rule as originally written would fail to redirect it.
If you insist on end-anchoring your hostname, then an alternative coding might be either:
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.net(:(80¦443))?
RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.net(:[0-9]{1,5})?
Jim
[edited by: jdMorgan at 7:49 pm (utc) on April 10, 2007]