Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to redirect domain names which already point to the same server?

For example, if my main website is, and I have another domainname as, if I go to, I don't want users to see that domainname, I want them to be redirected to, even though they both are the same website.

I am using RedHat linux and have a LAMP configuration.

share|improve this question
up vote 1 down vote accepted

Sure, you can do it like this:

<VirtualHost *:80>
Redirect permanent /
share|improve this answer
Do I need to restart apache after making this change? – oshirowanen Apr 5 '11 at 9:15
Yes, I had to restart apache, but the script above puts the website into an infinite loop. – oshirowanen Apr 5 '11 at 9:26
What does your access log say is happening? – BillThor Apr 5 '11 at 13:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.