I want to dinamically access to directories in /opt/www/work/n where n
is the subdomain I will ask for in my address bar:
http://project1.work/ → /opt/www/work/project1/
I managed to make it work with with the following rewrite directives in
my vhost file:
RewriteCond %{HTTP_HOST} ^([^.]+)\.work$
RewriteRule ^/(.*)$ /opt/www/work/%1/$1 [L]
All worked nicely until I tried to host there a project in which I used
an htaccess file to redirect everything to a single file.
the rule of this file is:
RewriteRule ^ main.php [L]
It works well when not hosted in my “dinamic” vhost.
Any help to fix this issue will be appreciated.