Answer the question
In order to leave comments, you need to log in
Working with subdomains in Apache. How to optimize VirtualHost?
There is a terrible idea to do this:
listing >
site.ru
www/
0/www/
current > 0/
work/
0/www/
1/www/
current > 0/
site.ru > site.ru/www/current/www/
work.site.ru > site.ru/work/current/www/
current.work.site.ru > site.ru/work/current/www/
1.work.site.ru > site.ru/work/1/www/
0.1.work.site.ru > site.ru/work/1/0/
<VirtualHost 1.2.3.4:56 >
ServerName site.ru
ServerAlias www.site.ru
VirtualDocumentRoot /var/www/user/data/www/site.ru/www/current/www/
</VirtualHost>
<VirtualHost 1.2.3.4:56 >
ServerName www.0.www.site.ru
ServerAlias *.*.*.site.ru
VirtualDocumentRoot /var/www/user/data/www/site.ru/%-3/%-4/%-5/
</VirtualHost>
<VirtualHost 1.2.3.4:56 >
ServerName 0.www.site.ru
ServerAlias *.*.site.ru
VirtualDocumentRoot /var/www/user/data/www/site.ru/%-3/%-4/www/
</VirtualHost>
<VirtualHost 1.2.3.4:56 >
ServerName test.site.ru
ServerAlias *.site.ru
VirtualDocumentRoot /var/www/user/data/www/site.ru/%-3/current/www/
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
You can try to look towards ModRewrite. Create one VritualHost:
<VirtualHost 1.2.3.4:56 >
ServerName site.ru
ServerAlias *.site.ru
DocumentRoot /var/www/user/data/www/site.ru/router/
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question