如何在apache(CentOS8)上為https子網域制定重新導向重寫規則?

如何在apache(CentOS8)上為https子網域制定重新導向重寫規則?

例如,我有自己的網域。

https://example.com

下面是我的 apache 虛擬主機,附有 301 重定向重寫規則。

<VirtualHost *:80> 
 ServerName example.com 
 DocumentRoot /var/www/html/example/public 
 <Directory /var/www/html/example> 
   AllowOverride All 
 </Directory> 
RewriteEngine On 
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [R=301,L] 
</VirtualHost>

我只能訪問,https://example.com但不能訪問https://subdomain.example.com。 “不安全”警報。對此的任何建議或指導將不勝感激,謝謝。

相關內容