Comments on .htaccess Based Authentication On Subdirectories
.htaccess Based Authentication On Subdirectories .htaccess is used to provide facility of changing configuration per directory basis, this file can contain one or more directives that are going to be forced on the directory that contains the.htaccess file. In this howto, I will take a dummy scenario of two parallel level subdirectories and will implement password authentication on both of them. This means only those users can access these directories that have the correct username and password.
5 Comment(s)
Comments
Nice easy to understand article! I just wanted to add a really useful snippet of code that I use all the time when developing sites.
The following code uses your htaccess authentication but incorporates the "Satisfy Any" and "Allow" directives to allow google, CSS and XHTML validation via w3.org, and the web developers IP to access the site without being prompted for a password. Everyone else is prompted for a password.
# Allow google and developers IP access without pw
AuthName "Authorized Users Only."
AuthType Basic
AuthUserFile /etc/httpd/conf/.htpasswd
require user testusr
Order deny,allow
Deny from all
Allow from 24.205.23.222
Allow from w3.org
Allow from htmlhelp.com
Allow from googlebot.com
Allow from google.com
Allow from google-analytics.com
Satisfy Any
Thanks! Yust what I'm looking for :-)
Perfect! thanks vm
thank you
hey its nice tutorial regarding .htaccess :)