I have some simple redirects in my htaccess file. However, the domain is going to change…I was hoping I could write something that gets the domain name?
Someone suggested:
http://%{HTTP_HOST}/
but this doesn’t work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you want to keep the old domain and redirect all the requests to the new one, may this instruction be helpful:
Put the code above in a
.htaccessfile at the root ofold-domain.But if you are NOT worried about the old url addresses or search engines crawled your old pages, you won’t need to do that, just move all your data (including
.htaccessfile) to your new domain