Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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.
share|improve this question
3  
woorank is a useless tool –  John Conde Oct 11 '13 at 0:28
add comment

2 Answers

up vote 3 down vote accepted

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.

share|improve this answer
    
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 ? –  Ahmed Na Oct 11 '13 at 0:42
    
Yep. This is really easy to do. I'll update my answer with the htaccess snippet that should work. –  John Conde Oct 11 '13 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 ? –  Ahmed Na Oct 11 '13 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 Oct 11 '13 at 0:50
    
thank you i will wait –  Ahmed Na Oct 11 '13 at 0:52
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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