When I type in my domain name like without the www
(like http://example.com
), it doesn't work and gives error message. However, when I add the www
to it (like http://www.example.com
), it works.
Isn't it supposed to work both ways (with and without the www
)?
If your CNAME is set up, but your site doesn't load without www, you need to check that your A records are correct and then recreate the SSL certificate. To check if A records are correct: Go to whatsmydns.net.
Generally this occurs when a site is pointing to a service using the "WWW" cname instead of the "@" A Record or IP address. You may want to follow up with your store/site provider to see if they have another way to point your domain name to their service. Hi, My site won't load without entering www.
It's actually not necessary to use WWW in URLs. It exists for just one purpose—to identify the web address. This is not the case with other important URL signifiers, such as a File Transfer Protocol (FTP) server (ftp) or news server (news). As such, WWW may be classified as a subdomain of a larger website.
Without the 'www', you must set your root (non-www) domain DNS A-record to point at your web server's IP address. This can be too rigid if you encounter availability or performance issues; the A-record is fixed and can take a day or two for changes to propagate.
All you need is to add the following code to your root .htaccess
file:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With