Answer the question
In order to leave comments, you need to log in
How to make autosubdomains in Apache?
I want to set up autosubdomains for my site, but something doesn't work.
There is a directory where all other sites are stored in their respective directories. For example, there is a main directory main and a directory with the site site1 (site.ru/main/site1).
It is necessary that when opening a site at the address: site1.site.ru, that site (site.ru/main/site1) opens.
Specified the following parameters for the domain:
<VirtualHost *:80>
ServerName site.ru
DocumentRoot /var/www/site.ru
</VirtualHost>
<VirtualHost *:80>
ServerName site.ru
ServerAlias *.site.ru
UseCanonicalName Off
VirtualDocumentRoot /var/www/user1/site.ru/main/%-4
</VirtualHost>
Answer the question
In order to leave comments, you need to log in
As far as I can remember does not change
<VirtualHost *:80>
ServerName site.ru
ServerAlias *.site.ru
DocumentRoot /var/www/site.ru
</VirtualHost>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question