Skip to content

Instantly share code, notes, and snippets.

@justinkelly
Created January 5, 2012 12:19
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save justinkelly/1565033 to your computer and use it in GitHub Desktop.
Save justinkelly/1565033 to your computer and use it in GitHub Desktop.
Exclude file/directories/urls from Apache .htaccess password protected site
AuthType Basic
AuthName "Auth Required"
AuthUserFile /path/to/.htpasswd
Require valid-user
# allow public access to the following resources
SetEnvIf Request_URI "(path/to/directory/)$" allow
SetEnvIf Request_URI "(path/to/file\.phpt)$" allow
SetEnvIf Request_URI "(util)$" allow
Order allow,deny
Allow from env=allow
# allow open access to entire site for select ips and sites
Allow from 777.777.77.7
Allow from 888.888.88.8
Satisfy any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment