Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess rewrite from anyfile.html to anyfile.php

Status
Not open for further replies.

Saeed42

ISP
Jul 4, 2001
147
I renamed all the files of my site to *.php so I can add some database functionality and my problem is that all the people that bookmarked specific pages now get error 404, so I was wondering if it's possible to use .htaccess file to forward everyone that tries to access anyfile.htm to anyfile.php as I kept the filenames the same and the only thing that changed is the extension.


Thanks in advance ;D

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Don't be content with being average. Average is as close to the bottom as it is to the top
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
This should work.
Code:
RedirectMatch ^/(.*)\.htm$ /$1.php
//Daniel
 
Thanks mate, it works like a dream
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Don't be content with being average. Average is as close to the bottom as it is to the top
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top