Answer the question
In order to leave comments, you need to log in
How to block access to PDF files from the browser?
And so I load everything into a special directory ../public_html/wp-content/uploads/securepdfs
. There, all PDFs are put into folders by year and month of
2018, and there inside, for example, 05, 06, etc.
The folder already has htaccess like this - one craftsman wrote
Options -Indexes
Deny from all
<FilesMatch '\.(jpg|png|gif|mp3|ogg|pdf)$'>
Order Allow,Deny
Allow from all
</FilesMatch>
<?php
// This file is intentionally blank.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question