Page 1 of 1

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

Posted: Mon Jul 09, 2007 1:48 pm
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: