How to redirect /index.php to / using mod_rewrite and .htaccess
Submitted by Ari on Wed, 08/01/2007 - 11:53.
Nice short post today, with one quick SEO tip that can (sometimes) gain you big pagerank quickly.
As previously mentioned, the search engines see http://www.newmediaist.com and http://www.newmediaist.com/index.php as two different pages (although they may lead to the same content). This means that although they are actually the exact same content, from the search engine's perspective both / and /index.php have their own ranking criteria (also known as "link juice" - backlinks, pagerank, etc...)
Now we don't want to split up "link juice" between two pages, so we need to either 301 redirect all requests for /index.php to /, or visa versa. This can be done by a fairly simple addition to the .htaccess file.
#Forward index.php to /
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.newmediaist.com/$1 [R=301,L]
(Reminder: Change www.newmediaist.com to your domain name!)
