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

Possible Duplicate:
Domain without the 'www.' gives me the Apache 'It works!' page

Hey, I've seen this quesiton asked the opposite way, but I'm having the problem stated above. My website: works like that, but as soon as you add "www" it doesn't work. I'm hosting it with Network Solutions. Is there a way to fix this?

EDIT: It appears that I have done the obvious things correctly based on Farseeker's comments.

"Can you update your question with the part of your apache configuration with your host is set up?" Not sure what you're asking for here... How would I go about finding this?

Thanks for your help. I also tried this:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^getfitcore4\.com$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

But that didn't work either. Even if there's a solution that's just a quick fix, such as a re-write, that's fine for now. I really need to get this working, though.

Guess who feels like an idiot? ME! All I had to do was set up a www. sub-domain (like some of you said) and it fixed it! Yay! Thanks!

share|improve this question

migrated from Jan 5 '10 at 1:52

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Mark Henderson Sep 9 '11 at 5:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You need to add an A record in your DNS setup. This belongs on serverfault – OMG Ponies Jan 5 '10 at 1:49
up vote 5 down vote accepted

Make sure you have:

  1. A CNAME record in your DNS settings so that (CNAME) points to (A).

  2. A web server set up to handle requests at, not just

share|improve this answer
Can you elaborate on your second point? I understand the first step, but am a bit confused about what specifically you mean by the second. – Sampson Jun 4 '10 at 17:46

His DNS is fine. His virtual server configuration is broken. Configure your web server to respect as an alternate domain, or to send HTTP redirects to send people to the www-less version.

share|improve this answer

You need to setup a record so that the www subdomain points to your IP address with an A record, I believe. Correct me if I'm wrong.

If you have access to modify Vhosts, configure them something like so:

<VirtualHost *:80>
RedirectMatch permanent ^/(.*)$1

<VirtualHost *:80>
DocumentRoot /var/www/html/site
share|improve this answer
An nslookup confirms the WWW setup has already been done – Mark Henderson Jan 5 '10 at 1:57

Did you set up the proper DNS settings, since www is essentially a subdomain.

share|improve this answer
Yes, he did. An nslookup confirms this. – Mark Henderson Jan 5 '10 at 1:57

Another way to do it without relying on DNS is described here:

Since you tagged this "apache", I think this will work for you. It's also a good way to learn about url-rewriting.

share|improve this answer
I need to do the opposite of that. – iMaster Jan 5 '10 at 2:28

According to NSLookup, your DNS is configured correctly, which is great.

Seeing as your question is tagged "Apache", I'm going to assume that this is your web server of choice, thus the problem will be in the bindings of your Apache site.

Can you update your question with the part of your apache configuration with your host is set up?

share|improve this answer

I had this problem too, and found my solution here.

Basically, after an upgrade, Apache put a symlink in /etc/apache2/sites-available. Deleting everything between and including <VirtualHost *:80> and <VirtualHost> got everything working for me again.

share|improve this answer

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