Skip to content

Instantly share code, notes, and snippets.

@pbull
Created February 11, 2015 13:26
Show Gist options
  • Save pbull/f70db0f8c068f533cfaf to your computer and use it in GitHub Desktop.
Save pbull/f70db0f8c068f533cfaf to your computer and use it in GitHub Desktop.
Restrict access to Acquia non-prod environment by IP.
# Whitelisted IPs (or regex matching IP ranges).
# If the client IP matches any of the whitelisted
# IPs the "allowed-ip" var is set.
#
SetEnvIf AH_Client_IP 12.34.56.78 allowed-ip
SetEnvIf AH_Client_IP 23.45.67.89 allowed-ip
SetEnvIf AH_Client_IP 34.56.78.90 allowed-ip
# This section should be added near the top of the
# <IfModule mod_rewrite.c> block.
#
# Assumes that all environments except prod should
# be access-restricted.
#
RewriteCond %{ENV:allowed-ip} !=1
RewriteCond %{ENV:AH_SITE_ENVIRONMENT} !=prod
RewriteRule ^ - [F]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment