Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- .htaccess - htm / html question
April 1, 2006, 9:49 pm
rate this thread
Checking my error logs, today, I find that some people are occasionally
requesting pages with an .htm extension rather than .html
Not sure why this is - all my pages have always ended in .html.
Anyway, is there something I can put in my .htaccess file to direct requests
for .htm pages to the correct .html file.
I know I can use a redirect for each individual page (such as:
RedirectPermanent /somepage.htm http://www.example.com/somepage.html )
but I was hoping for something simpler, so I don't have to list every page
Re: .htaccess - htm / html question
I think RewriteCond and RewriteRule will do what you want but offhand I
can't say exactly what to put in .htaccess as I haven't done it.
Here is an example from one of my directories :
# If no filename, use index.htm
# If file missing, redirect (permanent) to Exetel
RewriteRule ^$ index.htm [L]
RewriteCond % !-f
RewriteRule ^(.*)$ http://home.exetel.com.au/phelum /$1 [R=301,L]
I referred to the documentation at httpd.apache.org. Hopefully there
will be an example there for what you want.
- » How can I get font-size to remain constant in Firefox?
- — Previous thread in » HTML Markup Language