Answer the question
In order to leave comments, you need to log in
How to create a shared folder for all virtual hosts in Apache?
Now everything looks like this:
www{
sites{
styles{ style.css }
site1{ index.php } #В конфиге: DocumentRoot /www/sites/site1
site2{ index.php } #В конфиге: DocumentRoot /www/sites/site2
}
}
Answer the question
In order to leave comments, you need to log in
As an option, assign each site an alias for styles and js
<VirtualHost *:80>
DocumentRoot "/var/www/sites/site1"
ServerName "site1.ru"
Alias /styles /var/www/sites/styles
Alias /js /var/www/sites/js
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/sites/site2"
ServerName "site2.ru"
Alias /styles /var/www/sites/styles
Alias /js /var/www/sites/js
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question