Skip to content

Instantly share code, notes, and snippets.

@schulzh
Last active July 14, 2017 08:32
Show Gist options
  • Save schulzh/a81932c2c8d05d738f0c to your computer and use it in GitHub Desktop.
Save schulzh/a81932c2c8d05d738f0c to your computer and use it in GitHub Desktop.
A secure .htaccess file for source servers which accounts for the missing referer field of linux/mac csgo clients
SetEnvIfNoCase User-Agent "^Half-Life 2$" is_hl2
# Workaround for Mac OSX and Linux Clients, see https://github.com/ValveSoftware/csgo-osx-linux/issues/177
SetEnvIf Referer "^$" valid_ref
SetEnvIfNoCase Referer "^hl2:\/\/ip\.of\.first\.server:27015$" valid_ref
SetEnvIfNoCase Referer "^hl2:\/\/ip\.of\.second\.server:27015$" valid_ref
<RequireAll>
Require env is_hl2
Require env valid_ref
</RequireAll>
Options -Indexes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment