Forcing www. in the URL helps dig you out of Google’s Supplemental Index

It’s never a good idea to have duplicates of the same page indexed by Google. Why’s that? Because they will be placed into the Supplemental Index.

What does this mean? As described by Wikipedia, “Supplemental Result is a supplementry Google search Index of less important web pages according to the Google’s PageRank”.

One of the easiest ways to ensure that you have as little duplicate pages as possible in Google’s web database is to use the same base host name for your website.

This means that you either have URLs that look like this: http://example.com/ or this: http://www.example.com/ Both URLs would go to the same page, but to a robot, they are different sites entirely and so one would appear as a duplicate of the other.

In order to ensure that you only use one, all you need to do is modify your site’s .htaccess file (this is simply a file named .htaccess that you place in your site’s /public_html/ folder.) I personally prefer forcing www. in the URL rather than removing it because that string is commonly associated with a website, so in my opinion, the URL is more permanently imprinted into the visitor’s mind.

In the .htaccess file, you need to enter the following:

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

See Also

This will force any visits to your site that does not use www. to use it. If someone visits http://example.com/index.php?do=blog , it will redirect to http://www.example.com/index.php?do=blog

And that’s it! It’s also backwards compatible, so any links that point to your site that do not use www. will simply redirect to the www. version of your site’s URL.

Gary King is a professional freelance web developer, primarily using Ruby on Rails and PHP to create cool new websites. When he’s not trying to take over the world one blog at a time, you can find him mulling over his thoughts at King Gary.

Feeling stuck in self-doubt?

Stop trying to fix yourself and start embracing who you are. Join the free 7-day self-discovery challenge and learn how to transform negative emotions into personal growth.

Join Free Now

Picture of Gary King

Gary King

RECENT ARTICLES

TRENDING AROUND THE WEB

If you use these phrases when you talk to people, you have above-average social skills

If you use these phrases when you talk to people, you have above-average social skills

Global English Editing

7 habits of parents who maintain strong and loving relationships with their grown kids

7 habits of parents who maintain strong and loving relationships with their grown kids

Hack Spirit

4 zodiac signs who have an instinctive distrust of authority

4 zodiac signs who have an instinctive distrust of authority

My Inner Creative

If a man truly loves you, he’ll almost always display these 7 subtle behaviors

If a man truly loves you, he’ll almost always display these 7 subtle behaviors

NewsReports

5 zodiac signs who often seem weird to others (but are really not)

5 zodiac signs who often seem weird to others (but are really not)

Parent From Heart

8 habits of people who constantly check their phone instead of focusing on the moment

8 habits of people who constantly check their phone instead of focusing on the moment

Global English Editing