
Originally Posted by
Naild
I've had problems with someone hotlinking to my external files in the past, and thereby exausting my download limit.
Probably the best solution to this is to exclude clients that send a Referer (sic) HTTP header that doesn't point to your site. This won't stop users that have configured their client not to send such a header (rare) or users that know how to use tools where the Referer header can be faked (rare), but it will stop the vast majority of users.
With an Apache server, and others that support its directives (Zeus, for example), you can use SetEnvIf and the Deny directives to prohibit access:
Code:
<Directory /path/to/files>
SetEnvIf Referer www\.example\.com internal_referrer
SetEnvIf Referer ^$ internal_referrer
<Files *.exe>
Deny from all
Allow from env=internal_referrer
</Files>
</Directory>
I want to offer a few downloads (.exe files) on my web site, but don't want the link path to be viewable to anyone. Does anyone know where I can find such a script?
That simply isn't possible. Anyone that's going to be hotlinking your content should be smart enough to realise that they can, if really necessary, just read your markup to find the URL.
You can't hide anything on the Web.
Mike
Bookmarks