Website can not be accessed without www

New to Linode and Linux. I was able to to build a LAMP server and install wordpress using the great library here. However, my website can not be view at example.com. Instead, I need to type in www.example.com. What is the best way to fix this? I have tried to google this problem but there are so many solutions. I am just looking for the most efficient solution. Thanks a lot for your help!

2 Replies

In the linode DNS manager, make sure that the zone itself is example.com, and you have A records for (blank) and www hostnames pointed at your node's IP.

Then ensure that your webserver's configs are set to serve content for both example.com and www.example.com. In apache, this means you should have a "ServerName www.example.com" and a "ServerAlias example.com" line

Thanks a lot. Exactly what I needed.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct