delphij's Chaos


05 Apr 2004

Preventing stealing links

Some search engines has grabbed some of my links out (Primarily, MP3). So I put some limits there. This is because I don’t want FreeBSDChina to be a MP3 downloading site - It’s harmful for the server, and we don’t want it.

The code is the following, it’s simple and effective:

SetEnvIfNoCase Referer "^http://(blog|www)\.delphij\.net/" local_ref=1
<FilesMatch "\.(mp3|avi|wmv)">
	Order Allow,Deny
	Allow from env=local_ref

Add it to the Apache configuration and everything goes away.