2

I have a website and, when testing with a SEO tool called woorank, I have the following result:

Be careful. Your website without www doesn't redirect to www (or the opposite). It is duplicate content!

I have launched the website about 7 days ago, and it hasn't yet been indexed.

p.s:

  1. Google Webmaster Tools shows no errors.
  2. Google Analytics also works without any issues.
1
  • 3
    woorank is a useless tool
    – John Conde
    Commented Oct 11, 2013 at 0:28

2 Answers 2

3

All that error means is that users can pull up your pages both with and without the www. This might mean you have duplicate content issues if you haven't implemented canonical URLs to take care of this for you.

To solve this just set up a 301 redirect either to or from the www and this error will go away.

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.|$) [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

You can also tell Google which is your preferred domain.

4
  • you mean that i need to create a custom 301 redirect page with the redirect url and put it in the root directory ( or make it accessible with .htaccess file ) right ? Commented Oct 11, 2013 at 0:42
  • Yep. This is really easy to do. I'll update my answer with the htaccess snippet that should work.
    – John Conde
    Commented Oct 11, 2013 at 0:43
  • thank you , i will try to see it, also if you know why my website didn't indexed despite i have a sitemap and robots.txt and they are accessible ? Commented Oct 11, 2013 at 0:47
  • One week is not a lot of time to get indexed. Don't panic or do anything rash. Just add the above snippet to your htaccess and tell Google which is your preferred domain and keep promoting your website normally. Getting indexed can take some time and it is normal to experience what you are experiencing.
    – John Conde
    Commented Oct 11, 2013 at 0:50
2

It's saying that if you browse to either of

www.example.com or example.com

you end up seeing the same content, but the URLs in your address bar remain distinct.

What you want, is for one or the other to automatically redirect to the other one. My personal preference is to have non-www redirect to www. It's becoming "fashionable" to drop the www, but Facebook use it, and Google use it, and I figure they probably know the UX implications of it better than I do.

Anyway, to set up the redirect you add this to your Apache configuration, either in httpd.conf or in a .htaccess file.

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.yourdomain.com [NC]
RewriteRule (.*) http://www.yourdomain.com$1 [R=301,L]

Or this to your nginx configuration, probably in the same file as your main server block config:

server {
    listen 80;
    server_name yourdomain.com;
    return 301 http://www.yourdomain.com$request_uri;
}

(or something similar if you want to go the non-www root).

The theory is, that it's bad to have your content available on two different URLs.

1) search engines allegedly prefer unduplicated content

2) consistency is good for your brand and your users

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.