How to create an exception in htaccess for locking folders

0

I have a folder that contains some PDFs and I would like to block access to the folder through the url (ex: www.site.com/pdf) so I got the following command deny from all however when I call PDF inside an iframe the server says I'm not allowed. I wonder if there is an exception to this block or another command blocking access by the URL. Thanks in advance.

    
asked by anonymous 12.08.2017 / 04:02

2 answers

1

You should create a .htaccess file inside the desired folder and add this line:

order deny, allow
deny from all
allow from 127.0.0.1 # IP DO SERVIDOR
    
12.08.2017 / 04:06
0

In the .htaccess file you can have this solution with error page:

ErrorDocument 403 /error403.html #apresenta pagina se não tem permissoes
Order Allow, Deny
Allow from 127.0.0.1 # ip do teu servidor
    
12.08.2017 / 14:17