I have a static (html) site that I have just converted over to be dynamic (php). I have mod_rewrites on every page so in the eyes of the search engines all my pages are still the same. However, what do I do about my index file? If I have a mod_rewrite that says when looking for index.html go get index.php. But with www.mysite.com the page that is indexed by the search engines will be INDEX.PHP right (on my server .php is used before index.html if both present). Since Google has my site indexed under index.html will this not cause duplicate content problems when Google now visits and pulls up INDEX.PHP as my home page? Thanks so much.
I did the same thing at one point in time, it seems the search engines will always prefer the .html page but its a moot point when it comes to the main page because it will only be listed as the primary domain anyway.
To be more clear where it might matter would be if the previous page was indexed as: index.php?act=forum Then via submit of sitemap the search engine finds the mod rewrite version of the page as: forum.html Both will be in the index for a short period of time until google figures out it is actually the same page. Then it will prefer the forum.html and drop the index.php?act=forum At least thats the way it happened when I redesigned my site.
Do something like Options +Indexes Options +FollowSymlinks RewriteEngine on XBitHack Full RewriteBase / RewriteRule ^index\.php$ http://www.domain.com/index.html [R=301,L] Code (markup): then it'll be forced to only get the new URL.
Nintendo, This is what I currently have: RewriteRule ^index\.html$ index.php [L] Code (markup): Does this work?
Ok I get that point. But with that line you gave me,r edirecting .php > .htm is causing a loop when used with RewriteRule ^index\.html$ index.php [L]. So how can I get the SE's to come looking for the old index.html and read index.php without indexing it though? Thanks.
It looks like the only thing you can do it have both links work, and link to the new fake URL, and can't do both (301 and rewrite)! RewriteRule ^index\.html$ index.php [L]