.htpasswd - .htaccess: Different AuthUserFile paths for different hosts -
.htpasswd - .htaccess: Different AuthUserFile paths for different hosts -
i developing application has run both locally on remote server. 1 directory protected using htpasswd
file. how have define path htpasswd
file in htaccess
file:
authuserfile ../app/some-folder/.htpasswd
unfortunately app
folder required on server, don't have locally. instead, path has this:
authuserfile /volumes/some/very/long/path/some-folder/.htpasswd
is possible en if/else statement switch authuserfile path according current host (edit: or improve yet, don't require authentication locally)? or there workaround create file work on both local , remote host?
never mind, figured out. set in .htaccess
:
authname "protected" authtype basic authuserfile path/to/.htpasswd require valid-user order deny,allow deny allow 127.0.0.1 satisfy
this allows connections made local ip go through without entering password. not perfect, works in situation.
.htaccess .htpasswd
Comments
Post a Comment