Skip to content

Instantly share code, notes, and snippets.

@darkcolonist
Created May 29, 2020 04:23
Show Gist options
  • Save darkcolonist/480e32ac23112c377ae81f6f06cf0de4 to your computer and use it in GitHub Desktop.
Save darkcolonist/480e32ac23112c377ae81f6f06cf0de4 to your computer and use it in GitHub Desktop.
redirect IP via htaccess if not matching URL and IP pair
# only allow specific IPs to access the page
# if no IP match, display 500.shtml
# put this right after RewriteBase /
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.2
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.3
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
RewriteCond %{REQUEST_URI} ^/test/util/url.*
RewriteRule .* /500.shtml [PT,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment