Htaccess File


# © 2012 Korx Limited

# Set _allow_cookies automatically if outside the EU
<IfModule mod_geoip.c>

# Allow cookies if preference cookie is set
SetEnvIf Cookie "^.*_allow_cookies=1.*$" _allow_cookies

# Disallow cookies if DNT header sent
SetEnvIf DNT "1" !_allow_cookies

# Add a cookie in the request if we're allowing cookies and it's not there already
SetEnvIf Cookie "^.+$" _has_cookies
RequestHeader set Cookie "" env=!_has_cookies
RequestHeader edit Cookie "^(.*?)(;s*|)_allow_cookies=1(.*)$" "$1$3" env=_allow_cookies
RequestHeader edit Cookie "^(.*)$" "$1; _allow_cookies=1" env=_allow_cookies
SetEnv !_has_cookies

# Remove all cookies if we don't allow them, except for the preference cookie
Header edit Set-Cookie "^((?!_allow_cookies).)*$" "$2" env=!_allow_cookies
Exit mobile version