brittny85 Posted July 7, 2006 Share Posted July 7, 2006 The more I try to work with this the more I agree with what it says at the beginning of the Apache manual mod_rewrite article about it being voodoo- cool voodoo- but still voodoo. I thought I understood it, but since it isn't working, I must not be as close as I thought. I'm trying to transfer a website from mostly being .htm files to being to all being .php files. After looking at lots of different docs I came up with this for my .htaccess file:[code]LoadModule rewrite_module modules/mod_rewrite.soAddModule mod_rewrite.cOptions +FollowSymLinks RewriteEngine onRewriteRule ^.+(\.htm)$ $.php [R=301,L] [/code]For awhile I somehow had it so that it would redirect all of my .css files to .php (that was fun... not) but it never seems to do the same thing for the only file type that I thought I was specifying- .htm. Any help would be greatly appreciated!Thanks!-Brittny Quote Link to comment https://forums.phpfreaks.com/topic/13977-mod_rewrite-working-with-voodoo/ Share on other sites More sharing options...
number9dream Posted July 23, 2006 Share Posted July 23, 2006 Why don't you just parse the htm files for PHP and leave the URLs as they are?[code]AddHandler application/x-httpd-php htm[/code]You might need to adapt this slightly depending on your server config.Remember that [url=http://www.w3.org/Provider/Style/URI]Cool URIs Don't Change[/url] ;)Or, failing that, something like the below would probably do the trick:[code]RewriteRule (.*).htm$ /$1.php[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13977-mod_rewrite-working-with-voodoo/#findComment-62374 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.