Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have http://www.example.com/article

Due to rampant content development by authors in my site, http://example.com/article has also been widely indexed by Google.

Now, both are there roughly in equal numbers in Google search result.

So, the total page rank for the corresponding keywords is shared between the two URLs.

I want only http://www.example.com/article to be indexed and have all the page rank value that it deserves.

Will doing a 301 redirect from http://example.com/article to http://www.example.com/article achieve it? If not, what else should I do?

share|improve this question
up vote 1 down vote accepted

What you want to do is a 301 redirect from example.com/anypage to www.example.com/anypage. Basically you just want to add the www, not take the user to the home page just because they forgot the www. That's really bad usability.

Fortunately this is easy to do if you use Apache. This little snippet in the conf file for the site or a .htaccess will do the trick:

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

This will make sure that PageRank and each page's ranking (two different things) are maximized and focused on the page with the www. The page without the www will eventually fall out of Google's index.

share|improve this answer
+1 your solution is more elegant as it doesn't have a hard coded domain name. I was expecting one in the syntax. Great! – user5413 May 16 '11 at 14:20

Your Answer


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