我正在使用 apache 2.2,尝试从一个 url 子域重写到另一个域,它在 http vhost 上运行正常,但在 https 上根本不起作用
/etc/apache2/domain1.conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName *.domain1.com
DocumentRoot /var/www/domain1
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.
RewriteRule (.*) https://sub.domain2 [R=301,L]
..........
......
</VirtualHost>
<VirtualHost xx.xx.xx.xx:443>
ServerAdmin webmaster@localhost
ServerName *.domain1.com
DocumentRoot /var/www/domain1
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^sub\.
RewriteRule (.*) https://sub.domain2 [R=301,L]
.......
</VirtualHost>
请问有什么帮助吗?