.htaccess for file extensions?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Is there a way to configure .htaccess so that requests for files ending in
.htm are redirected to the same file name but with an extension of .html?

Requests for .htm pages are showing up in my error logs. The page name is
right but the extension should be .html. I don't know where these are coming
from, I'd rather that folks were directed to the correct page, rather than
the 404 page.

If it's possible I'd surely be grateful for the solution!


Re: .htaccess for file extensions?

draphael wrote:
Quoted text here. Click to load it

Use mod_rewrite or the simpler mod_alias.

I have very little experience with either, but I guess this
should work:
RedirectMatch permanent ^(.*)\.htm$ $1.html

Re: .htaccess for file extensions?

Quoted text here. Click to load it

worked like a charm! thanks so much!


Site Timeline