Hi,
I’ve setup a new Droplet and pointed my domain to DO Nameservers. The website loads now only without WWW, page not found with WWW. I’ve added a CNAME entry with “www @”, but this redirects WWW website to non WWW website. We need the WWW version as this is how site is indexed in Google search.
How do we make the WWW version load instead or redirecting? What CNAME settings should I add? We are running Apache on Ubuntu, if that helps.
Please point us in right direction to resolve this. Thanks.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
It sounds like your DNS records are correct. Could you provide more information about your site? What webserver are you using? Apache, Nginx? If you could pastebin their configurations, we could probably supply you with a better answer.
Having the same issue and I’m not sure the Apache / NGinx is the issue. Take a look at this tutorial. It sounds like it might be the issue.
I stand corrected. I fixed my problem by going into my <pre> $>cd /etc/nginx/sites-enabled </pre> and then doing a: <pre> $>sudo vi example.com </pre> Then add something like this to the top of the config file. <pre> server { #listen 80 is default server_name www.example.com; return 301 $scheme://example.com$request_uri; }
server { listen 80; server_name example.com; root /home/path/to/example.com/html; … </pre>
I then restarted ngnix and it worked for me.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.