My website is domain.com and it doesn’t load up if I place the www. The address with the www gives a “Cannot find server” page message in Firefox and IE.
In our role as Technical Support Services for web hosting companies, such website related errors are common issues we resolve for the end customers.
Today, we’ll see what causes the issue of www not working for domains in cPanel servers and how we fix such issues.
Causes for cPanel www not working
It is a long-standing practice that domain names are accessed in browsers with the prefix ‘www’, which denotes the World Wide Web.
By default, a site is presumed to load fine when accessed with and without the ‘www’ prefix. But in some cases, this www may not work. Let’s see why.
For a domain to work with www prefix, it should have entry in 2 locations in a cPanel server.
1. DNS record – In the DB record for the domain, there should be a ‘CNAME’ entry corresponding to www.
www IN CNAME domain.com.
This entry is added by default in the DNS record, whenever a domain is created in the WHM. But in certain scenarios, this ‘www’ entry may get deleted or corrupt, causing domain to not work with ‘www’ prefix.
2. Apache configuration file – Another file where the entry for ‘www’ is required, is the web server configuration file usually located at ‘/etc/apache2/conf/httpd.conf’.
The entry for each domain in the config file would be of the format:
The ‘ServerAlias’ entry in the VirtualHost for www prefix instructs the web server to load the same content as the domain name, when accessed with www also.
This entry is also added by default into the Apache configuration file during domain creation. But cPanel provides option to override the entries in the httpd.conf file.
During Apache configuration corruption or custom setting changes made for Apache, the entries in the config file can get messed up and cause www to not work.
In certain scenarios, some other situations have also seen to cause the www not working issue. These include:
Scenarios where the domain uses external DNS or CDN such as Cloudflare, and the DNS settings are not properly configured there.
Cases where there are URL redirects setup, such as in ‘.htaccess’ files, causing www to redirect incorrectly.
Fix for cPanel www not working
When www is not working, the first thing we check is the DNS entry. In the DNS zone, we confirm that the entry for ‘www’ is added correctly.
If the issue is confirmed to be with DNS, we edit the DNS Zone and make sure www is set up as a CNAME on the domain.
This can be done from ‘WHM => DNS Functions => Edit DNS Zone’ option.
Strict caution has to be exercised while editing DNS zones, as even a slight mistake such as a missing ‘.’ can corrupt the DNS entry.
As DNS changes involve propagation delay, it can take time for it to reflect world-wide. We test and confirm the changes locally in the DNS servers and verify they are working fine.
dig +trace www.domain.com @localhost
For websites that are hosted in external DNS servers, the updates have to be done in those servers for the site to work fine.
If the DNS is fine, we check and confirm that the entries in Apache configuration file are listed properly. Any missing entries in the conf files are added.
As cPanel automatically reloads Apache configuration files, the changes to the configuration has to be done via the appropriate WHM interface. Manual edits may get lost in updates.
If the configuration file is corrupt, we rebuild it from scratch. Backups are taken before edits and Apache is restarted after the change. Caution has to be taken to avoid incorrect entries that can stop Apache functioning.
If both DNS and Apache entries are proper, we examine further issues such as URL redirects in index files, .htaccess, or other custom configuration files in the site, and fix them.
Today we saw how our Dedicated Support Engineers resolve cPanel www not working issue in our customers’ servers. In our customers’ servers, we monitor all services 24/7 to ensure that all server-wide issues are resolved in no time.
cPanel www not working – How to fix it instantly! was last modified: November 28th, 2018 by Reeshma Mathews
Read more: bobcares.com