我们需要在apache中编写两个重写规则。
Add new Apache rule http://*.test.com -> https://*.test.com
Add new Apache rule http://*.test.com/home/ -> https://*.test.com/home/
我怎样才能实现它。
答案 0 :(得分:0)
RewriteEngine on
RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} test.com
RewriteRule ^(.*) https://%{HTTP_HOST}$1
这应该适用于http:// .test.com / 。 您必须将其放入虚拟主机配置或.htaccess文件中。