I'm looking for writing an easy mod_rewrite rule, the following:
something.php ==> somehting (just get rid of the .php) something_else.php ==> something/else (replace _ with /)
So, for instance it might be such as this:
www.mysite.com/something.php (would be rewritten as) www.mysite.com/something www.mysite.com/something_else.php (would be rewritten as) www.mysite.com/something/else
Like me unfamiliar with regular expressions, I figured it might be better to request somebody that can perform this in 5s instead of spend days (days? :P) learning regular expressions and mod_rewrite.
Try these rules inshtaccess file:
Options +FollowSymlinks -MultiViews RewriteEngine on RewriteRule ^([^_]+)_([^_]+)\.php/?$ /$1/$2 [R=301,L] RewriteRule ^([^.]+)\.php/?$ /$1 [R=301,L]
This is going to do exterior redirect, just in case you wouldn't want that then remove
R=301, flag previously mentioned.