Redirecting WordPress index.php to root

If you check the Page Rank of http://bloke.org against http://bloke.org/index.php, which are both, to a human, obviously the same page you’ll see two different results. My domain carries a PR3 whilst the latter carries a PR0.

We know they are both the same, but do the crawlers? No, they don’t.

Without rambling about Google Page Rank and other such randomly generated statistics, your site or blog may be displaying what the search engine crawlers think is duplicate content.

Luckily, there is a clever fix. Modify the following code and drop it in your .htaccess file for no-duplicate-content-for-the-crawlers-niceness.
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://bloke.org/ [R=301,L]
Simple as simple gets.

Author: Kieran Barnes

Kieran is a PHP developer with 15 years commercial experience. Specialist in WordPress, CakePHP, CubeCart and all things PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *