Report this

What is the reason for this report?

www not working

Posted on January 21, 2019

I’m new to all this so sorry if this is a silly question.

If I visit my site without the www it works fine, but with the www I get an error “server IP address could not be found.”

I followed the tutorials and my file: /etc/nginx/sites-available/animalrescue.co.uk looks like this:

server { listen 80; listen [::]:80;

    root /var/www/animalrescue.co.uk/html;
    index index.html index.htm index.nginx-debian.html;

    server_name animalrescue.co.uk www.animalrescue.co.uk;

    location / {
            try_files $uri $uri/ =404;
    }

}

Am I missing something?

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!

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.

And btw… allow a few minutes for DNS propagation, won’t work immediately.

Yup, I think you’re missing the DNS entry…

Please go back to you Domain Registrar or Domain Management and check if you have a CNAME www (value) that points to animalrescue.co.uk. (don’t miss the . [dot] after uk, that’s important).

Hehe… I see that you have that entry:

;; ANSWER SECTION: www.animalrescue.co.uk. 21599 IN CNAME animalrescue.co.uk.

If the problem still persists please clear your browser cache, it works for me both versions, www and no-www.

PS: Do a redirect from www to non-www or the other way around, stick with just one domain “version” for your website as Google will see this as duplicate content and you won’t get there any time soon.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.