hmm... FilesMatch - why does one regex work and not another?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

hmm... FilesMatch - why does one regex work and not another?

Post by Luke »

I've got a directory that looks like this: /mm5/

within this directory, I've got the following .htaccess file:

Code: Select all

deny from all

<FilesMatch "^(merchant\.mvc|admin\.mvc|index\.htm|index\.html|graphics\/.*)$">

 allow from all

</FilesMatch>
which does not match if you put in a url like /mm5/graphics/en-US/admin/extra.gif, but if I change my rule to...

Code: Select all

deny from all

<FilesMatch "^(merchant\.mvc|admin\.mvc|index\.htm|index\.html|graphics\/)$">

 allow from all

</FilesMatch>
It miraculously works. Any insight?

EDIT: just to make things that much more annoying and difficult, if I now change from using the IP address to using the domain name, it miraculously doesn't work again. Unless I just allow from all... then it works fine. I hate configuration. :evil:
Post Reply