Leech Prevention
Unfortunately, there are server admins that will attempt to have their players leech maps from other admin web hosts. To prevent leechers, add the following to your .htaccess file, replacing the IP address in the first line with your game server IP:
SetEnvIfNoCase Referer ^hl2://127\.0\.0\.1 allow_download Order Deny,Allow Allow from env=allow_download Deny from all
Another way, again using the .htaccess file & the mod_rewrite module with Apache (again, replacing the ip address with that of your game server):
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^hl2://0.0.0.0:
RewriteCond %{HTTP_USER_AGENT} !^Half-Life\ 2$
RewriteRule ^(.*)$ $1 [F]
If you want the 2nd example to allow from multiple game servers, change:
!^hl2://0.0.0.0:
to:
!^hl2://(0.0.0.0|1.1.1.1|2.2.2.2):
That only access from Source based game servers that have the ip addresses of those listed above. All examples use the Apache web server, IIS requires a 3rd party program, and other web servers may take a different approach - please consult the documentation of your web server regarding referrers. --Banana 07:50, 31 July 2009 (UTC)

