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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only allow specific files

Status
Not open for further replies.

cricketx

Technical User
Jun 28, 2003
16
0
0
AU
Hi guys,

How would I stop serving files with .pdf or .doc extentions but keep serving .html .jpg files in a directory?

Thus i really want :
<FilesMatch "*"> #find all files
Order Deny,Allow #Deny all files
#Allow html, jpg etc
</FilesMatch>

Any idea on how I can code this? (I have forgotten my regular expressions )




Indesign2
Windows XP (SP1)
Designing Tabloid Newspaper (Any tips welcome)
 
try this in .htaccess

<Files ~ ".*">
Deny from all
</Files>
<Files ~ "\.(htm|html|jpg|jpeg)$">
Allow from all
</Files>


or just
<Files ~ "\.(pdf|doc)">
Deny from all
</Files>
 
Thanks null terminator.
I have worked it out by using a similar approach using the Filesmatch container.

Cheers
 
While this approach is working fine, I am unable to get it to load my default page.

I have to specifically say ../index.html to get a webpage. Also the Indexes have stopped working.

Any ideas as to what is gong wrong?

CHeers

Indesign2
Windows XP (SP1)
Designing Tabloid Newspaper (Any tips welcome)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top