Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fcaldarelli/cdbbaf3156ff6b2218b1ebbb955e8890 to your computer and use it in GitHub Desktop.
Save fcaldarelli/cdbbaf3156ff6b2218b1ebbb955e8890 to your computer and use it in GitHub Desktop.
apache2 allow access to password protected folder
<Directory "/path-to-protected">
AuthType Basic
AuthName "auth"
AuthUserFile "/auth-user-file-path"
require valid-user
SetEnvIf Request_URI "path-to-allow" allowed_restricted
Order allow,deny
Allow from 1.2.3.4 # allow from some ips
Allow from env=allowed_restricted # allow from some urls
Satisfy any
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment