Virtual host / domain only works without www. prefix

Would like to know where i’m making a mistake with the 2 sites i have that i can only access like : instead of

I have 3 domains / virtual hosts setup and 1 of them is working perfectly. However the 2 other are setup identical but have this problem.

I did also sudo service apache2 reload to take the new settings but nothing has happened.

Thank you very much for your help.


@nepsilon Did you add prefix “www” in your domain while adding it here: Like if you add your domain as:, you won’t be able to access it with www. Add both with and without www prefix to access your website in both conditions. I hope this helps.

I have added cname but however on 1 of the sites i am experiencing this :

Site down or blocked is down or blocked.

Check your internet connection and retry Retry Access

Any hints ? Thank you.

The other site is resolved and works perfectly, thank you very much for your effort.

I am getting

This webpage is not available ERR_NAME_NOT_RESOLVED

I do have control and they are setup exactly as the previous one that actually works.

Do you get the error message - Server not found? If yes, it means your DNS isn’t configured correctly. Do you have control of your DNS records? You should create a CNAME record for “www” that points to Or you can create an A record for “www” that resolves to the same ip address as

com.conf file looks like this

ServerAdmin ServerName ServerAlias DocumentRoot /var/www/

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Based on the error message you’re receiving (NAME_NOT_RESOLVED), there is an issue with DNS records for this domain that is preventing it from resolving outside of the ‘www’ subdomain. To correct this, you will need to update the DNS records for this domain to ensure that the root domain resolves to the same IP address as the ‘www’ subdomain (with an A record of its own), or else that it contains a CNAME record pointing to the ‘www’ subdomain, which will result in it resolving to the same IP address as the subdomain by default.

Hope this helps!

DigitalOcean Support

This comment has been deleted