Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Blocking all files except certain types

Status
Not open for further replies.

zlayde

IS-IT--Management
Joined
Dec 8, 2005
Messages
1
Location
US
How would I block all files from being served by Apache except those with certain file extensions?

E.g. - allow only .htm, .png, .gif, .jpg, .css, .js

But ban all others?

I think it's done through a regex in the Filesmatch directive - but I have no idea how to do it.
 
Hi

Code:
<Files *>
  Order deny,allow
  Deny from all
</Files>

<FilesMatch \.(htm|png|gif|jpg|css|js)$>
  Order allow,deny
  Allow from all
</FilesMatch>

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top