Skip to content

Instantly share code, notes, and snippets.

@y2kdev
Created September 1, 2010 16:54
Show Gist options
  • Save y2kdev/560994 to your computer and use it in GitHub Desktop.
Save y2kdev/560994 to your computer and use it in GitHub Desktop.
# .htaccess
# To be stored in a web directory in which you wish to password protect from the public.
# This simple script refers to an .htpasswd file that should be stored outside of the public html folder of your domain.
# Be sure to update the path to the AuthUserFile, the root path of your webserver will differ based on your host.
Options +Indexes
AuthUserFile /{YOUR_HOME_DIRECTORY}/{YOUR_PATH}/{YOUR_SECURE_PATH}/.htpasswd
AuthType Basic
AuthName "Login Required:"
Require valid-user
# .htpasswd
# Create a .htpasswd file that stores your user name and password (You can list multiple users, one per line)
# The format is <user>:<password>
# Your password should be encrypted, you can generate an encrypted password with <http://bit.ly/a0wmk>
# The .htpasswd file must be stored in the same place your .htaccess file above references in order for them to work together
admin1:31sEHfiAcXqSM
admin2:70i5kieP.uOrM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment