Hi,
I want set up the following structure: staging.mydomain.com/client/projectname production.mydomain.com/client/projectname
For new projects i create the following folders in my /home/-folder:
"clientname"-folder"projectname"-folder
staging-folder
production-folder
My apache conf file looks like below right now.
It is working fine with clientA for "production" and "staging", but of course clientB wont work since those vhosts will be ignored.
So, how can I use that so it works with my structure: staging.mydomain.com/clientA/projectA points to /clientA/projectA/staging, and staging.mydomain.com/clientB/projectA points to /clientB/projectA/staging and so on....?
Code:
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/mysite
</VirtualHost>
<VirtualHost *:80>
ServerName production.mydomain.com
ServerAlias production.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientA/projectA/production
Alias /clientA/projectA /home/clientA/projectA/production
</VirtualHost>
<VirtualHost *:80>
ServerName staging.mydomain.com
ServerAlias staging.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientA/projectA/staging
Alias /clientA/projectA /home/clientA/projectA/staging
</VirtualHost>
<VirtualHost *:80>
ServerName production.mydomain.com
ServerAlias production.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientB/projectA/production
Alias /clientB/projectA /home/clientB/projectA/production
</VirtualHost>
<VirtualHost *:80>
ServerName staging.mydomain.com
ServerAlias staging.mydomain.com
DirectoryIndex index.html index.php
DocumentRoot /home/clientB/projectA/staging
Alias /clientB/projectA /home/clientB/projectA/staging
</VirtualHost>