0

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: http://getfitcore4.com 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 ^(.*)$ http://getfitcore4.com/$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!

1
  • You need to add an A record in your DNS setup. This belongs on serverfault
    – OMG Ponies
    Jan 5, 2010 at 1:49

7 Answers 7

5

Make sure you have:

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

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

1
  • 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, 2010 at 17:46
4

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

2

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>
ServerName sitename.com
RedirectMatch permanent ^/(.*) http://www.sitename.com/$1
</VirtualHost>

<VirtualHost *:80>
ServerName www.sitename.com
DocumentRoot /var/www/html/site
</VirtualHost>
1
  • An nslookup confirms the WWW setup has already been done Jan 5, 2010 at 1:57
0

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

1
  • Yes, he did. An nslookup confirms this. Jan 5, 2010 at 1:57
0

Another way to do it without relying on DNS is described here: http://www.thesitewizard.com/apache/redirect-domain-www-subdomain.shtml

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

1
  • I need to do the opposite of that.
    – iMaster
    Jan 5, 2010 at 2:28
0

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?

0

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.

Not the answer you're looking for? Browse other questions tagged .