Return to Snippet

Revision: 24194
at February 23, 2010 04:29 by abbey


Updated Code
# These pages are public
<FilesMatch "^(robots\.txt|errorpage\.php)$">
order allow,deny
allow from all
</FilesMatch>

# The rest of the site is private
AuthUserFile /path/to/your/.htpasswd
AuthType Basic
AuthName "Login Required"
Require valid-user
Order allow,deny
Satisfy any

Revision: 24193
at February 23, 2010 04:27 by abbey


Updated Code
# Public pages
<FilesMatch "^(robots\.txt|errorpage\.php)$">
order allow,deny
allow from all
</FilesMatch>

# Private 
AuthUserFile /path/to/your/.htpasswd
AuthType Basic
AuthName "Login Required"
Require valid-user
Order allow,deny
Satisfy any

Revision: 24192
at February 23, 2010 04:25 by abbey


Initial Code
# Public pages
<FilesMatch "^(robots\.txt|errorpage\.php)$">
order allow,deny
allow from all
</FilesMatch>

# Private 
AuthUserFile /path/your/.htpasswd
AuthType Basic
AuthName "Login Required"
Require valid-user
Order allow,deny
Satisfy any

Initial URL
http://www.webmasterworld.com/apache/4051548.htm

Initial Description
Before taking a site "live", I password protect it except the robots.txt for search engines and custom Error pages. You can adapt this to your own use and add other pages in the FilesMatch directive.

Initial Title
.htaccess: Password protect your entire site except certain pages

Initial Tags
regex, htaccess

Initial Language
Apache