Enable PDF download from URL using htpasswd (APACHE and WP)

26 views Asked by At

I have a website with an UPLOAD folder full of PDF files.

Directory list is disabled but Im not able to enable password to download file

Assuming that the directory abs path is /home/user/server/wp-content/ninja-upload/11/

Ive created in that path 2 files

.htpasswd

admin:qwe3f43?r4

.htaccess

Order Allow,Deny
Allow from all
<Files ~ "\.(pdf)$">
Deny from all
AuthName "Admins Only"
AuthUserFile /home/user/server/wp-content/ninja-upload/11/.htpasswd
AuthType basic
Require valid-user
</Files>

Didnt works. Ive made a lot of try but any success: when i use direct link

http://website/wp-content/ninja-upload/11/a.pdf

I can read it without asking any pass

EDIT: i'm using siteground as hosting. Is it possible that siteground use diferent tool? because has a protection directory tool (but i need to use htaccess because i need to populate dinamically the htpasswd file each user registration on WP)

0

There are 0 answers