Last active
August 1, 2017 09:37
-
-
Save benpturner/830600cf8a1ce6778a87d13d9456203f to your computer and use it in GitHub Desktop.
Apache Rewrite Whitelist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# whitelist need to be formatted like so | |
# 104.44.44.44 - | |
# 104.33.33.33 - | |
RewriteMap ips txt:/opt/whitelist.txt | |
RewriteCond ${ips:%%{REMOTE_ADDR}|NOTFOUND} !NOTFOUND | |
RewriteCond %%{HTTP_USER_AGENT} "Mozilla\/5\.0 \(Windows NT 6\.1; WOW64\) AppleWebKit\/537\.36 \(KHTML, like Gecko\)" [NC] | |
RewriteRule ^/news/(.*) https://yourc2server.com/news/$1 [NC,P] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment