Suggestion to improve security
-
First I want to say thank you for creating this awesome plugin. I’ve tried many similar download plugins, but this is the best.
For some personal reasons, I want to prevent users to access the direct download URL (perhaps visitors that come from bookmark). So users must visit the download page to click the download button.
For example:
My download page is: example.com/download-game/
That page contains information about the game and the download button. The downloadable file is password protected. If someone clicks the button, he will be redirected to (for example): example.com/?ddownload=12. The link can be bookmarked and share to someone else along with the password.After some researches, I found this .htaccess code can be used for preventing direct access to the download URL:
RewriteEngine On RewriteCond %{HTTP_REFERER} !example\.com [NC] RewriteCond %{QUERY_STRING} (ddownload=\d+) [NC] RewriteRule ^(.*)$ /$1? [R=301,L]
It maybe not the best solution, but so far it works. Perhaps this .htaccess trick can be added as a feature to improve the security.
- The topic ‘Suggestion to improve security’ is closed to new replies.