A client of ours wants everything from one web site to redirect to the appropriate page on another domain, eg:
www.mydomain.co.uk/hotel.htm
->
www.mydomain.com/hotel.htm
...so I tried using the following in .htaccess and uploaded it to the old domain:
[code:1:25c626a5fb]RewriteEngine on
RewriteBase /
RewriteRule ^/?$ http://www.mydomain.com/ [R]
RewriteRule ^/(.+)$ http://www.mydomain.com/$1 [R,L][/code:1:25c626a5fb]
This works if you go to
www.mydomain.com/ and does the redirect, but going to any page on the site doesn't cause this to redirect and I'm confused. Trouble is it's too early in the morning to be thinking about mod_rewrite so I can't work out why it's not working.
Any ideas?
Btw, I'll put in a 301 redirect also, but wanted to keep the code simple. I've also tested it on Mozilla as IE often doesn't change the address bar when it redirects (took hours of frustration to work that out once).
Trev