ServerAlias doesn't seem to work for www

5 posts / 0 new
Last post
#1 Thu, 04/12/2012 - 13:44
matley

ServerAlias doesn't seem to work for www

I've set up all the basics of my server (installed a basic Wordpress to test connection to database), but the only problem which still needs fixing is that websites won't load in the browser if I include "www." in the address bar.

My first thought is checking ServerAlias under the Apache directives for this virtual server. Things seem to be set correctly (I've replaced my actual domain name with "mydomain"):

SuexecUserGroup "#1003" "#1003" ServerName mydomain.com ServerAlias www.mydomain.com DocumentRoot /home/mydomain/public_html

Thu, 04/12/2012 - 14:06
andreychek

Howdy,

What error do you get when browsing to a domain with 'www' in it's name?

-Eric

Thu, 04/12/2012 - 14:10
matley

In Chrome I get: Oops! Google Chrome could not find www.mydomain.com

I can't even ping the domain when I include the www too: ping: unknown host www.mydomain.com

Thu, 04/12/2012 - 15:08
andreychek

Howdy,

It sounds like there isn't a DNS entry for the 'www' version of your site.

Where is your DNS being hosted for that domain?

What you'd need to do is log into your DNS provider, and make sure there's a DNS record for 'www.domain.com'.

-Eric

Thu, 04/12/2012 - 16:20
matley

Spot on. I only had an "@" A record for my domain. I needed to add an "www" A record too.

Thank you.

Topic locked