I want to limit access to files using PHP open_basedir for multiple domains. Every domain sits in own directory, so I want prevent all domains PHP scripts from interfering with each other. How can I set different open_basedir
path for every domain in single .htaccess
?
If it would be only 1 domain, it could look like this:
# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/example.com/
Every user has FTP
account limited to /hosting/domains/example.com/
.
So, obviously, I can not put .htaccess
into /hosting/domains/example.com/.htaccess
as user would be able to change .htaccess
content. So, there must be single .htaccess
in /hosting/domains/.htaccess
for all domains.
This is how I imagine it, is something like this possible?
# /hosting/domains/.htaccess
php_value open_basedir /hosting/domains/${current_domain}/
I am using: Apache 2.4, PHP 5.5