Reputation: 14139
I'm not sure if I should be asking this on serverfault, but here goes. I'm moving my website to another domain, and I want people going to the old one to be redirected to the new one, while staying on the same page. Is there any global setting I can modify (like .htaccess
) to make that happen?
To clarify, I want this url:
http://www.olddomain.com/some/random/path.html
to redirect to this one:
http://www.newdomain.com/some/random/path.html
I included the php
tag because I have a feeling that the answer may be in there.
Upvotes: 0
Views: 97
Reputation: 333
.htaccess has nothing do with PHP!
You can put the following rule into your .htaccess, which should solve your problem.
RedirectPermanent / http://www.newdomain.com/
(This triggers an 301 Redirect, but you can also use any other Redirect Command)
Upvotes: 1