.htaccess将url重定向到另一个url(保留url段)
需要重定向.htaccess将url重定向到另一个url(保留url段),.htaccess,url,redirect,.htaccess,Url,Redirect,需要重定向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] 这导致: ht
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使用以下htaccess规则将http重定向到https:
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
来源:这会导致我出现
内部服务器错误