需要重定向http:// www.old-url.com/any/other/url/segment
到https:/ /www.new-url.com/any/other/url/segment
目前我正在做这样的事情:
RewriteEngine On
RewriteCond %{HTTP_HOST} !http://www.old-url.com/1$ [NC]
RewriteRule ^(.*)$ https://www.new-url.com/$1 [L,R=301]
结果:
http:// www.old-url.com/any/other/url/segment to
https:// www.new-url.com/
由于 -Robbie
答案 0 :(得分:0)
使用以下htaccess规则将http重定向到https:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}