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

Htaccess: Disallowing certain file types to be downloaded

Status
Not open for further replies.

ronnyjljr

IS-IT--Management
Nov 23, 2003
249
US
Hello,

How do you configure an htaccess file to not allow files of a certain extension lets says, .txt, to be downloaded or accessed but still be able to be used by php scripts on the server?

Thanks,
Ron

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Just add ....

Code:
IndexIgnore *.txt
to your .htaccess file.

BTW -there is a forum for Apache topics in here : forum65

Best Regards


Jakob
 
Thanks Jakob,


I also found this which works quite nicely.

Code:
<Files ~ "\.(zip|tar|rar|tgz|tar.gz|mp3|mp4|mid|mpeg|wav|avi|au)$">
Deny from all
</Files>

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top