我正在嘗試在我的 CentOS 伺服器中建立一個子網域,但它正在重定向到主域名
這是我的虛擬主機
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain.co.uk
ServerAlias domain.co.uk
DocumentRoot /var/www/html/domain.co.uk/
ErrorLog /var/www/html/domain.co.uk/error.log
CustomLog /var/www/html/domain.co.uk/requests.log combined
<Directory "/var/www/html/domain.co.uk/">
Options FollowSymLinks
AllowOverride All
Options -Indexes
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.co.uk [OR]
RewriteCond %{SERVER_NAME} =www.domain.co.uk
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:80>
ServerName www.staging.domain.co.uk
ServerAlias staging.domain.co.uk
DocumentRoot /var/www/html/staging.domain.co.uk/
ErrorLog /var/www/html/staging.domain.co.uk/error.log
CustomLog /var/www/html/staging.domain.co.uk/requests.log combined
<Directory "/var/www/html/staging.domain.co.uk/">
Options FollowSymLinks
AllowOverride All
Options -Indexes
</Directory>
#RewriteEngine on
#RewriteCond %{SERVER_NAME} =staging.domain.co.uk [OR]
#RewriteCond %{SERVER_NAME} =staging.domain.co.uk
#RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
有什麼建議如何解決這個問題嗎?