I am trying to install yii-advance-app, which in its guide shows two document roots. for example when I am installing the application in web root the folder structure is like below: frontend/web/index.php backend/web/index.php example: 127.0.0.1 yiiadvanced.com 127.0.0.1 admin.yiiadvanced.com We then update the httpd-vhosts.conf to include the front and back ends. DocumentRoot “C:/wamp/www/yii/advanced/frontend/web” ServerName yiiadvanced.com DocumentRoot “C:/wamp/www/yii/advanced/backend/web” ServerName admin.yiiadvanced.com So in my case I want to achieve /var/www/clients/client2/web217/web/advanced/frontend/web to open at http://notes.mywebsolutions.co.in and /var/www/clients/client2/web217/web/advanced/backend/web to open at http://notes.mywebsolutions.co.in/admin As I took a look at vhost file, there are reference for directory /var/www/clients/client2/web217/web at multiple places so How I can add references for both without actually making a mess of it.
A vhost cannot have more than one document root, as far as I know. What You try to achieve is to map two subdomains to different directories. This can be achieved by using vhost subdomains in ISPConfig.
Okay - may be I am trying to achieve something which is not practical. Let me explain. I have uploaded the Yii2 advanced code in my web directory - notes.mywebsolutions.co.in the folder structure is like backend - backend web application. common - files common to all applications. console - console application. environments - environment configs. frontend - frontend web application. so now to access the frontend application I have to type - notes.mywebsolutions.co.in/frontend/web/index.php and to access the backend I have to type notes.mywebsolutions.co.in/backend/web/index.php what I am looking is How can rewrite path or something so for frontend I can access notes.mywebsolutions.co.in/frontend/web/index.php with notes.mywebsolutions.co.in/ (without typing the frontend/web/index.php and similary for backend notes.mywebsolutions.co.in/backend/web/index.php with say notes.mywebsolutions.co.in/admin (and not typing /backend/web/index.php)
The first question is, does the app that you install support this (does it support that you shorten the path and map a different subdomain on a partial URL of the app)? If yes, then you can do it with vhost subdomains in ISPConfig like I mentioned in my first answer.
Thanks Till, I got the solution elsewhere using .htaccess here is what I got. Code: Options +FollowSymlinks RewriteEngine On # deal with admin first RewriteCond %{REQUEST_URI} ^/(admin) RewriteRule ^admin/assets/(.*)$ backend/web/assets/$1 [L] RewriteRule ^admin/css/(.*)$ backend/web/css/$1 [L] RewriteCond %{REQUEST_URI} !^/backend/web/(assets|css)/ RewriteCond %{REQUEST_URI} ^/(admin) RewriteRule ^.*$ backend/web/index.php [L] RewriteCond %{REQUEST_URI} ^/(assets|css) RewriteRule ^assets/(.*)$ frontend/web/assets/$1 [L] RewriteRule ^css/(.*)$ frontend/web/css/$1 [L] RewriteRule ^js/(.*)$ frontend/web/js/$1 [L] RewriteRule ^images/(.*)$ frontend/web/images/$1 [L] RewriteCond %{REQUEST_URI} !^/(frontend|backend)/web/(assets|css)/ RewriteCond %{REQUEST_URI} !index.php RewriteCond %{REQUEST_FILENAME} !-f [OR] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ frontend/web/index.php