Skip to content

Instantly share code, notes, and snippets.

@tevashov
Created June 3, 2015 13:45
Show Gist options
  • Select an option

  • Save tevashov/b989c6931ea9b76c481e to your computer and use it in GitHub Desktop.

Select an option

Save tevashov/b989c6931ea9b76c481e to your computer and use it in GitHub Desktop.
Host-sensitive access restrictions
# ----------------------------------------------------------------------
# :: Host-sensitive access
# http://tomschlick.com/2009/11/08/conditional-htpasswd-multi-environments/
# ----------------------------------------------------------------------
# : LIVE host, ALLOW access [ EDIT HERE ]
SetEnvIf HOST "^www.inbio-ventures.com" live_url
# : LOCAL host, ALLOW access
SetEnvIf HOST ".local$" local_url
# : DEVELOPMENT version, DENY access
SetEnvIf HOST ".dev.teff.pro$" testing_url
Order Deny,Allow
# : Specify path to .htpasswd on development server
AuthUserFile /home/user87641092323/etc/34292594.passwd
AuthName "Development area"
AuthType Basic
AuthGroupFile /
Require valid-user
#: Allow valid-user for LOCAL & LIVE only
Deny from all
Allow from env=local_url
Allow from env=live_url
Satisfy any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment