Forum Moderators: phranque
I would like to know if anybody thinks this will work.
Create a rewrite rule to prevent people from getting to the file. Then create a rewrite condition so that they can only get to the file when they go through one page that requires a login.
So the htaccess looks like this
RewriteCond %{HTTP_REFERER}!^http://domain.com/file_man/functions/downloader.php [NC]
RewriteRule ^files/([^/]+)/([^\.]+).([^/]+)$ /file_man/functions/downloader.php?user=$1&file=$2&type=$3 [NC,L]
and the downloader.php would contain a link to the file.
any thoughs?
~D
You can have the script require the login.
You can have the script set a cookie that is required to access the content files.
You can actually do this in many ways, those are just two.
Jim
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /file_man/functions/downloader\.php
RewriteRule ^file_man/functions/downloader\.php$ - [F]
You could extend this concept to the downloadable content files as well, but if your download script is doing file reads to serve the download content, then you can deny HTTP access to the entire download content directory; Since the script will be using local file system reads and not HTTP to get and send the content, no HTTP access need be allowed at all.
Jim