Web Hosting Talk







View Full Version : bandwidth protection script?


exploiter
09-16-2002, 11:19 AM
not sure if this is posted in the right forum, if it isn't, I apologize :(

A while back, I had a friend who ran a big command and conquer fansite.. being the big site he was, people linked directly to his files and "stole" his bandwidth, until he moved servers which had some kinda server side bandwidth protection script which didn't allow anyone to directly link to his files..

not sure what it was called.

anyone know of anything like this?

thanks,

SPaReK
09-16-2002, 04:40 PM
You can do this if your server supports mod_rewrite (assuming its an Apache server). I'm not sure exactly how this works, but there are plenty of websites out there that tell you how. One way to this if you do not have mod_rewrite is to use the following in your .htaccess file:

SetEnvIfNoCase Referer "domain.com" local_ref=1
<FilesMatch ".(gif|jpg)">
Order Allow,Deny
Allow from env=local_ref
</FilesMatch>

You can change the file types to whatever would be desired. I have had great luck with this script, on our servers that do not have mod_rewrite.

davidb
09-16-2002, 04:54 PM
First find out if mod rewrite is installed as said before(this can be done if its your server by httpd -l or just ask the host)

second search for hotlinking on this forum, pretty simple to implement and works wonders.

exploiter
09-16-2002, 05:49 PM
thanks alot guys
it is an apache server, and will try it soon :)

x222943
09-16-2002, 06:09 PM
any way you could point that to another file?