Canonicalization and index.php

If you remember last week I told you I was playing with my .htaccess which resulted in the submit page to be unavailable. The thing I was trying to sort out was the redirection of my index.php page to the root domain of the site.

Lets start from the beginning. It all started when I noticed that if I typed http://www.yoursiteisvalid.com/index.php and http://www.yoursiteisvalid.com I was directed to the same page. Nothing new here, web server are usually configured to direct you index.php or .html or whatever when it is not specified in the url.

But what people don’t always know is those two different urls are seen as two different pages by search engine robots. This is a well known fact by SEO, called canonicalization. The problem for me is that the page with the first address (with index.php at the end) has got a page rank of 3 and the other a page rank of 2…but are the same page…

An other example is the www and non-www url. www is the default sub domain of any top level domain name and it often direct to the root of the site. So again two different url for one page.

The point here is if you have dealt with the non-www don’t forget the index as well. Here the rules commonly setup in the htaccess to prevent those two:

RewriteCond %{HTTP_HOST} ^yoursiteisvalid\.com$ [NC]
RewriteRule ^(.*)$ http://www.yoursiteisvalid.com/$1 [R=301,L]
RewriteRule ^index.php$ http://www.yoursiteisvalid.com/ [R=301,L]

Leave a Reply

Theme Forest ad
Wordpress Themes Collection ad
Woothemes

Poll

How do you start your WordPress plugins development projects?

View Results

Loading ... Loading ...