Posted by Oscar R
2013-10-30

Thanks a lot Tom! This script has helped me a lot!
I would like to know if is possible to protect other files like PDFs ?? How can I do that ?
Thanks once again.
Posted by Tom
2013-10-30

Hi Oscar,

In web/.htaccess, find this line.
RewriteCond %{REQUEST_URI} /(.*)\.html$
The line redirects any files with the .html extention to _protect_.php, which in turn outputs the content of the file to browser. Theoretically, you can add more lines like that for other file extensions such as .pdf, however, just outputting the file content to browser may not be enough for some types of file. Probably, you will encounter some problems for each new extension you add, and have to modify _protect_.php to solve them.