apache - htaccess - htpasswd: different AuthUserFile depending on subdomain -
it's been couple of days looking @ how manage have different authuserfile paths depending on subdomain.
why have problem: admin access of site protected htaccess - htpasswd. i'm managing repo bitbucket , configuring automatic deployments. because of deployment system, need use same files every site instance: let's have:
local.mysite.com staging.mysite.com www.mysite.com
the problem authuserfile absolute path different each "site", need define based on subdomains.
what attempted do: thinking using if statement that:
<if "host == 'local.mysite.com'"> authuserfile </if>
but i'm running apache 2.2 not available.
i thought using like:
setenvif host ^local\.mysite\.com$ env_local <ifdefine env_local> authtype basic authname "password required" authuserfile /my/local/path/.htpasswd require valid-user </ifdefine>
but apparently, ifdefine cannot read setenvif variables.
and i'm blocked , can't find me on internet. i'd better if didn't have change apache configuration too..
any ideas?
never-mind, seems pretty impossible create script generate .htaccess files automatically on deploy , put .htaccess in .gitignore won't have conflicts when trying pull.
Comments
Post a Comment