Apache RewriteCond Help!

Oh, the strange things mod_rewrite does!

Apache RewriteCond Help!

Postby chris.augustine » Thu Aug 28, 2008 6:30 am

I'm trying to make a mod_rewrite condition in Apache so that all .htm and .html files have the rule applied to them. So far I have:

RewriteCond %{REQUEST_URI} (/¦\.htm¦.html¦/[^.]*)$ [NC]

Which simply doesn't work. Can someone please help?
Posts: 1
Joined: Thu Aug 28, 2008 6:29 am

Postby richardk » Fri Aug 29, 2008 7:16 am

Why do you need the condition? You should be able to use the RewriteRule
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^(some|pettern)\.html?$ /do/soemthing [NC,QSA,L]

\.html? matches .html and .htm.
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Return to Idiosyncrasies

Who is online

Users browsing this forum: No registered users and 1 guest