Forum Moderators: phranque

Message Too Old, No Replies

index.php redirect - .htaccess

         

MWpro

6:12 pm on Feb 3, 2008 (gmt 0)

10+ Year Member



Before I uploaded my forum, I put up a "Coming Soon" page named index.html so that google could start to find my site and index it.

When I installed my forum, I deleted the index.html page. The main page is now index.php.

However, google still has the old index.html page indexed, and is indexing the index.php page as a separate page. This is affecting my ranking because google is not indexing the main page of my new site.

Is this the solution below?


DirectoryIndex index.php

RewriteEngine on
RewriteCond %{THE_REQUEST} ^.*\/index\.html
RewriteRule ^(.*)index\.html$ http://www.example.com/$1 [R=301,L]

RewriteEngine On
rewritecond %{http_host} ^example.com
rewriteRule ^(.*) http://www.example.com/$1 [R=301,L]

jdMorgan

9:40 pm on Feb 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You don't need two RewriteEngine on directives -- one at the top will do.

Also, the second rule is not part of the solution to the problem as-stated, but would be recommended to avoid problems caused by duplicating content across both www- and non-www doamins.

Jim