Omzy Posted July 2, 2010 Share Posted July 2, 2010 I currently use the following rule to rewrite .php to .htm RewriteRule ^(.*)\.htm$ $1.php I now want to change this so that it rewrites .php to .html, but also add another rule to redirect any existing .htm urls to .html (must be a search engine friendly/301 redirect). Quote Link to comment https://forums.phpfreaks.com/topic/206546-rewrite-rule-to-convert-from-htm-to-html/ Share on other sites More sharing options...
premiso Posted July 6, 2010 Share Posted July 6, 2010 RewriteRule ^(.*)\.html$ $1.php [L] RewriteRule ^(.*)\.htm$ $1.html [R=301,L] But why not just rewrite .htm and .html to php permanently? Quote Link to comment https://forums.phpfreaks.com/topic/206546-rewrite-rule-to-convert-from-htm-to-html/#findComment-1081649 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.