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

I have a VPS and a domain name registered with the provider.

When I enter my site is displayed correctly, but entering does not work. I am able to ping

I added the following line to my apache2 default vhosts file:


But this did not work.

The VPS is a Debian5 OS.

Any ideas? Note: There is no option via a provided control panel to add this, it's a basic package I purchased

I know this post answers it but there are no extra comments and I'd like to know if it's the best way:
way to redirect page to www using virtual host configuration in sites-available for apache2?


share|improve this question
Please post the results of nslookup and nslookup, to verify that they're both pointing to your VPS correctly. – Shane Madden Jun 24 '11 at 0:44
up vote 1 down vote accepted

To get DNS resolution to work, you need to have an A record for '', not just ''. Once that's there, what you've done so far will probably work. This sounds like an DNS issue so far.

share|improve this answer
Yes, I added a new A record for and this worked, Thanks. – Thomas Buckley Jun 25 '11 at 15:14
a cname record will do nicely, it's just subtly different; depends on what you're aiming for – sehe Jun 25 '11 at 20:27

To answer the second part of your question. The answer you link to is indeed a good example of doing the redirect. The first RewriteCond may not be required if you're not using SSL, but it should not do any harm.

share|improve this answer

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.