URL works without "www", but not with it
Solution 1
Make sure you have:
A CNAME record in your DNS settings so that www.getfitcore4.com (CNAME) points to getfitcore4.com (A).
A web server set up to handle requests at www.getfitcore4.com, not just getfitcore4.com.
Solution 2
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.
Solution 3
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>
Related videos on Youtube
iMaster
Updated on September 17, 2022Comments
-
iMaster almost 2 years
Possible Duplicate:
Domain without the 'www.' gives me the Apache 'It works!' pageHey, 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!
-
OMG Ponies over 14 yearsYou need to add an A record in your DNS setup. This belongs on serverfault
-
-
MrGigu over 14 yearsYes, he did. An nslookup confirms this.
-
MrGigu over 14 yearsAn nslookup confirms the WWW setup has already been done
-
iMaster over 14 yearsI need to do the opposite of that.
-
thierry about 14 yearsCan you elaborate on your second point? I understand the first step, but am a bit confused about what specifically you mean by the second.