Domain without the www?

Posted February 21, 2017 2.5k views
DigitalOceanUbuntu 16.04

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

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.

Submit an Answer
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.