Scripts and functions that I have written or found useful

mod rewrite change php to htm

August 18th, 2007 Posted in PHP, mod_rewrite

Options +Indexes
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.htm$ $1.php [L]

If you change your pages from htm (or html) to php and want to maintain links particularly from Google then you can place the code above in your .htaccess file in the root folder of your website. This allows you to type http://yourdomain/mypage.htm instead of http://yourdomain/mypage.php which is better for SEO and means that any old links to your .htm page will still work

Post a Comment