I've setup a dev site and wish to password safeguard it so only validated site visitors can observe the website. All fine and dandy. I get annoyed, on my small local version, entering my password. So, without altering the htaccess file between my local copy and also the one around the dev site, how do you password safeguard the website but allow myself access without needing to enter my password?
Supposing that you're fine entering the password around the dev site - place the auth directives inside a VirtualHost around the dev site instead of within the .htaccess file - by doing this your auth is processed in a server level as opposed to a directory level.
Also, most contemporary browsers will most likely save your valuable password for you personally :)
As talked about here you could utilize
allow from to permit access from the specific host.
Something similar to this will have the desired effect..
Require valid-user Allow from 127.0.0.1 Satisfy Any
I have determined a awesome method to seperate Linux from Home windows password files (because I develop in home windows after which release to some linux production server).
I simply authored a php script with phpinfo() on our local and push server and located the apache module 'mod_win32' to seperate the pair of them.
<IfModule mod_win32.c> AuthUserFile C:\xampplite\your\windows\path.passwd </IfModule> <IfModule !mod_win32.c> AuthUserFile "/your/linux/path/.passwd" </IfModule> AuthName "Please Login" RewriteEngine On AuthType Basic Require valid-user