WordPress And Canonical Index.php Fix
How surprised was I to see a newer blog of mine has two identical pages indexed in google:
newblog.com
and
newblog.com/index.php
I have no idea how goog scooped up the index.php since I have nothing pointing to it, but there it was. Up all night, couldn’t find a fix that worked in .htaccess (bork bork bork), but did find a plugin to fix the prob: Permalink Redirect WordPress Plugin
A WordPress plugin that replies a 301 permanent redirect, if requested URI is different from entry’s (or archive’s) permalink. It is used to ensure that there is only one URL associated with each blog entry.
You still need to fix the www and non-www in .htaccess, but this takes care of the /index.php prob. It simply redirects the index page to the root.
Plugin is a simple upload and activate in admin area and all is well
.
To see if you need the plugin, check your domain.com vs. domain.com/index.php. If index.php sticks–you’ll want that fixed to prevent potential duplicate content issues.
G’nite.
Caleb Duke:
December 4th, 2006 at 5:14 am
You could just add this to your robots.txt file
User-agent: *
Disallow: /index.php
Terry:
December 11th, 2006 at 7:35 am
Caleb I don’t think I’d do that, the index.php is the home page for the domain. Wouldn’t it be dangerous to block robots from spidering it?
Teli Adlam:
December 16th, 2006 at 10:51 pm
Terry,
I believe you’re right. If you block Goog and the other robots from spidering the index.php file, it could lead to your entire site not being indexed because *all* posts are run through the index file.
That’s just a theory though…haven’t tested it (and don’t plan to).
~ Teli