How to create an exception in htaccess for locking folders

Asked

Viewed 307 times

0

I have a folder that contains some Pdfs and would like to block the folder access by the url (eg www.site.com/pdf) so I got the following command deny from all but when I call PDF inside an iframe the server says I don’t have permission. I would like to know if there is an exception to this lock or another command that blocks access through the URL. Thanks in advance.

2 answers

0

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

order deny, allow
deny from all
allow from 127.0.0.1 # IP DO SERVIDOR

0

inside the archive .htaccess you may 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.