apache - different htpasswd files per domain -


i've 2 domains e.g. foo.com , bar.com share same document root. sites protected .htaccess file

authuserfile ../.htpasswd authname "no access" authtype basic <limit post put>     require valid-user </limit> 

how can set authuserfile depending on host?

pseudocode:

if (host == foo.com) {     authuserfile ../.htpasswd_foo } else {     authuserfile ../.htpasswd_bar } authname "no access" authtype basic <limit post put>     require valid-user </limit> 

if not possible there other ways different logins 2 domains?

try setting this:

#site1.com setenvifnocase host site1\.com pass_1 authtype basic authname "site1.com login required" authuserfile "/home/userdir/.htpasswds/site1.pwd" require valid-user order allow,deny allow deny env=pass_1 satisfy  #site2.com setenvifnocase host site2\.com pass_2 authtype basic authname "site2.com login required" authuserfile "/home/user_dir/.htpasswds/site2.pwd" require valid-user order allow,deny allow deny env=pass_2 satisfy 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -