1

My site is working if i type it as domain.com. But If I type it as www.domain.com I get an error 404 page.

The domain is registered with Google Apps for Business and the hosting is done with another company. I have some A records that are pointing the site to this server. However, as it appears the A records are only working halfway.

What do I have to do to make it working for both http:// and http://www ?

  • The answer you pointed to does not address the problem cited above, nor does it address all of the issues that could answer the problem. In fact, it is very misleading and not an appropriate answer at all. It addresses .htaccess where the issue lies within the DNS entries and/or web server configuration. In fact, this is not a problem that .htaccess can solve. – closetnoc May 26 '14 at 17:23
  • Reopening since the linked duplicate question doesn't discuss the DNS-side. – dan May 26 '14 at 20:54
2

Normally you would have an A record for the domain name example.com and a CNAME for www pointing to example.com or an A record for www with the same IP address as example.com.

As well, your website has to be set up for this. For example, in the Apache site configuration file often found in /etc/apache2/sites-available/ or /etc/local/apache2/sites-available/, you would need some thing like:

ServerName example.com
ServerAlias www.example.com

If you have another web server, you will need to research this second part for specific configuration details.

  • or an A record for www with the same IP address as example.com. this part solved it :) Thank you very much! – Forza May 26 '14 at 16:27
  • Anytime! That is usually the problem. – closetnoc May 26 '14 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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