aynber
aynber

Reputation: 23011

Deny folder to all but certain IPs, but allow full access to certain files

I have a folder that I want to restrict access to, except I want several files with the same beginning to be accessible by everyone. I already have the blocking, but I can't seem to get the allow files to work. This is what I have:

order deny,all
deny from all
allow from 127.0.0.1 
#There's several lines of real IPs here
<FilesMatch "^myfiles*\.php$">
  order Allow,Deny
  Allow from all
</FilesMatch>

Is the order wrong, or something else?

Upvotes: 0

Views: 125

Answers (1)

anubhava
anubhava

Reputation: 785128

I believe regex is not correct, try:

<FilesMatch "myfiles.*?\.php$">
   Satisfy any  
   order Allow,Deny
   Allow from all
</FilesMatch>

Upvotes: 1

Related Questions