我正在尝试配置我的网站:
我担心的是第一项效果很好,但如果我调用site1.example.com,它仍会显示/ home / default_domain内容,而不是/ home / blogs / site1
以下是配置:
Listen 443 https
<VirtualHost *:443>
ServerName www.example.com
ServerAlias example.com
DocumentRoot /home/default_domain
[SSL configuration]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ https://www.example.com%{REQUEST_URI} [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName blabla.example.com
ServerAlias *.example.com
VirtualDocumentRoot /home/blogs/%1
[SSL configuration]
<Directory /home/blogs/>
Options MultiViews FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>