I’m trying to create a mod_rewrite rule that will drop any .htm that gets appended to a url that gets put in. For example, if someone types in example.com/faculty/jim.htm, I want drupal to ignore the .htm and just go to the page example.com/faculty/jim. Any mod_rewrite experts out there that can lend a hand? Is there something I can alter with the default drupal rewrite code in .htaccess:
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Thanks in advance.
Not tested, but putting
before the standard drupal rewrite rules should do it.
If you want this to trigger only for non existing files, you could add the same conditions as with the main Drupal rewrite rule:
These conditions check if the REQUEST_FILENAME is an existing file or directory.