In the / media / files / directory there is a .htaccess file with the contents:

Order Deny,Allow Deny from all

But for some reason, when I request access to a file at http://site.ru/media/files/FILENAME.zip , it calmly downloads, although there should be a 403 Forbidden error. What's wrong?

  • When I address scripts - .htaccess works. And the files are downloaded, what kind of rubbish? - bars96
  • Do you files can be sent via the php script, and not directly to their directories? - Visman

1 answer 1

 <FilesMatch ~ "\.(zip|pdf|img|png)$"> Order allow,deny Deny from all </FilesMatch> 

You can add more extensions

  • one
    But what's the point, if it does not work without restrictions, then it will start with restrictions? - Visman