Schlo_50 Posted July 16, 2008 Share Posted July 16, 2008 Hi there, (Im not sure if this is the correct place for this so please remove if not) I have a website made mainly from php and css files. Also, stored on the server are .DAT and .txt files that store small amounts of information. I need to block people from typing in the url path to these .txt and .DAT files and downloading them. I've searched the forum and found out this can be done with .htaccess. I have tried using this but it's not working..I can still type the url and download the files. Could someone look at my .htaccess please? <FilesMatch "(.*)\.(DAT|txt)$"> Order Allow,Deny Deny from all </FilesMatch> Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/115011-preventing-people-from-downloading-files/ Share on other sites More sharing options...
MadTechie Posted July 16, 2008 Share Posted July 16, 2008 why not just store them outside the html_public folder.. scripts can still access them and you could use the force download script to download them.. (and add some extra security to them if needed) Quote Link to comment https://forums.phpfreaks.com/topic/115011-preventing-people-from-downloading-files/#findComment-591499 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.