Hotlinking/Remote linking protection path

Hidayet Dogan <[email protected]> Mon, 26 Mar 2007 17:38:55 +0300 (EEST)
Newsgroups gmane.network.mathopd
Message-ID <[email protected]>
Hello,

First of all, thanks to Michiel for making great software and keep 
up the good work :) Well, I'm using Mathopd since about 2 months and I'm 
very happy with it except bandwidth eaters. I've checked mailing-list 
archive and googled but couldn't find ready-made solution or patch to 
prevent hotlinking/remote linking. So, I've written small patch checking 
referer information for requests. You can find path file and example 
configuration file at http://www.hido.net/projects/mathopd I've added two 
new configuration directives. These are:

EmptyReferer
Type: flag
Argument: on/off
Default: on (allow empty referers)
Returns: 403 Forbidden
Example: EmptyReferer off (disallow empty referers)

Allow (on) or disallow (off) empty referers.

RefererMatch
Type: list
Argument: blank space seperated domain/host/ip list.
Default: empty
Returns: 403 Forbidden
Example: RefererMatch { domain.com static.domain.com 127.0.0.1 }

Server checks request referer header. If none of them matches, it returns 
403 Forbidden message.

Let me know if you find any errors or ideas, thoughts ;)

Thanks again,

Hidayet Dogan