Domain without the www?

February 21, 2017 1.4k views
DigitalOcean Ubuntu 16.04

I can not access my domain without the www, how to solve it?

4 Answers

It could also be a DNS issue. Could you post what the zone file for as I suspect the problem might have to do with A records. Thanks.

Hey there. This depends on how your website is configured. Are you using an CMS (Content Managment System)? And do you use Apache or Nginx as a web server?

If you are using Apache you can re-write www to non-www inside the .htaccess file in your web root (/var/www/html by default). I do this for my website as seen here on GitHub

I wish there was a write up on this, but the best way I can describe this is to set up the DNS twice. That is, you log into your DO account, then go to networking. Create a DNS entry for and another one for That is, the second entry doesn’t have a www.

Technically the www is a subdomain of So if your works, just create another DNS without the www.

Thanks to all for the tips, I managed, configuring the www as a subdomain worked, thank you again.

Have another answer? Share your knowledge.