Forum Moderators: phranque

Message Too Old, No Replies

Redirect from HTML page to new PHP page

replacing website homepage with php version

         

DelliTranswait

2:31 pm on Aug 10, 2006 (gmt 0)

10+ Year Member




I think this is the right place to post this, because I think I need to use the .htaccess file to best accomplish what I want to do.

I recently created a new homepage for my website, using php to automatically put some content from the website's weblog onto the homepage. The new homepage has the filename index.php.

I uploaded it to my website to test it. To my surprise, the server serves up the new index.php file when I go to my site URL without specifying a specific file (i.e., www.mydomain.com/).

The index.php file works fine, but there are a lot of links to the old homepage, index.htm.

What is the best way to redirect from the old homepage (index.php) to the new homepage (index.htm)?

Also, is there a way show the index.php page but with a .htm extension? I think it would be less confusing to my visitors.

Many thanks!

jdMorgan

4:57 pm on Aug 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should never mention "index.php" or "index.html" on your site, or allow other sites to link to it, because it leads to precisely this problem.

Instead, refer and link to "example.com/" only.

For information on how to clean up your incoming links and search engine results (no doubt diluted because of allowing multiple URLs for your home page, see this recent thread [webmasterworld.com].

Jim

[edited by: jdMorgan at 4:58 pm (utc) on Aug. 10, 2006]