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 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) 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
Archived
This topic is now archived and is closed to further replies.