Skip to content

Instantly share code, notes, and snippets.

@mitchkramez
Last active December 15, 2015 06:19
Show Gist options
  • Save mitchkramez/afa6f73954c54466730f to your computer and use it in GitHub Desktop.
Save mitchkramez/afa6f73954c54466730f to your computer and use it in GitHub Desktop.
Ignore HTTP Auth for a Specific IP (vhost.conf)
# Put this in the vhost.conf... otherwise remove the directory wrappers when using as an htaccess... but use it in the vhost.conf, not the htaccess.
# Allow traffic from IP without login
SetEnvIf Remote_Addr ^11\.11\.11\.11$ MOVE_ALONG=true
# Allow traffic from any iPhone user agent without login
SetEnvIfNoCase User-Agent iPhone MOVE_ALONG=true
<Directory "/var/www/vhosts/vhost.com/httpdocs">
Satisfy Any
Order deny,allow
Deny from all
Allow from env=MOVE_ALONG
</Directory>
<Directory "/var/www/vhosts/vhost.com/httpsdocs">
Satisfy Any
Order deny,allow
Deny from all
Allow from env=MOVE_ALONG
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment