Skip to content

Instantly share code, notes, and snippets.

@jrodriguez-ifuelinteractive
Last active August 29, 2015 14:02
Show Gist options
  • Save jrodriguez-ifuelinteractive/e41543870e9fa38f3e0a to your computer and use it in GitHub Desktop.
Save jrodriguez-ifuelinteractive/e41543870e9fa38f3e0a to your computer and use it in GitHub Desktop.
#Apache >=2.4
<Directory /path/to/webroot>
AllowOverride All
AuthUserFile /etc/apache2/.htpasswd
AuthType Basic
AuthName "Restricted Content"
<Limit GET>
Require valid-user
</Limit>
Require ip xxx.xxx.xxx.xxx
Satisfy any
</Directory>
#----
#Apache < 2.4
<Directory /path/to/webroot>
AllowOverride All
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
<Limit GET>
Require valid-user
</Limit>
Satisfy any
Deny from all
Allow from xxx.xxx.xxx.xxx
</Directory>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment