
我有一個在 http 和 https 上運行的網站,http apache conf 檔案設定如下,以便(據我所知)所有請求都重定向到該網站的 https 版本的根目錄。
我想讓子域測試成為一個例外,以便不安全http://test.example.comurl 的處理方式不同並託管一些頁面。有沒有辦法在主 http conf 檔案中定義異常?
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName www.example.com
ServerAlias example.com
ServerAlias example.co.uk
Redirect permanent / https://www.example.com/
</VirtualHost>
我嘗試為我的測試子網域創建一個新的 conf 文件,但一旦將其添加到 apache live 配置中,它似乎就會被忽略。
UseCanonicalName On
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName test.example.com
DocumentRoot /var/www/test.example
ErrorLog /var/www/test.example/error.log
CustomLog /var/www/test.example/access.log combined
</VirtualHost>