apache, block file hotlinking

apache, block file hotlinking

am 01.06.2007 12:06:45 von Byru

Hi there

I was looking for a apache config solution (htaccess?) which will allow me
to block all file hotlinking attempts not originating from my webserver.

For instance i have a server: http://www.server.com and i host several
exe,rar,zip files on it. Some people link directly t those files what eats
up my bandwidth, and as a result downloaders never visit my website - just
download the files.
Can i block all attempts to download my files from external sources? I want
it to be only possible to download the files from my servers (links from the
websites on http://www.server.com).

Can you please provide me a sample which automatically transfers visitors
who directly enters the following links to the browser/download manager to
the homepage of my domain?

http://www.server.com/files/file1.exe should go to http://www.server.com if
entered directly. In case the link wa clicked on my site the file should be
downloaded normally.
http://www.server.com/files/file2.zip should go to http://www.server.com, so
i can modify it and add more files to the config.

TiA
Byru