Skip to content

Instantly share code, notes, and snippets.

@timusg
Last active December 17, 2015 17:59
Show Gist options
  • Save timusg/5649659 to your computer and use it in GitHub Desktop.
Save timusg/5649659 to your computer and use it in GitHub Desktop.
apache rewrite for restrict access to few white listed ip address and add extra params in query string
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^100\.212\.123\.XX$
RewriteCond %{REMOTE_ADDR} !^XX\.XX\.XXX\.XX$
RewriteRule ^/foo - [F]
RewriteRule ^/foo http://example.com/foo?bar=qux [P,QSA]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment