Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
已实施 Apache 重写以将 URL 从 http 重定向到 https,这可以正常工作
RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
但是https://hostname转到“itworks!”页面
https://hostname
https://hostname重定向到的语法是什么https://hostname/sub1/sub2
https://hostname/sub1/sub2
谢谢
将其放在您拥有的规则之后
RewriteCond %{HTTPS} on RewriteRule ^$ /sub1/sub2 [L]
如果您希望浏览器地址栏中的实际 URL 更改为/sub1/sub2,则将括号从 更改[L]为[R=301,L]。
/sub1/sub2
[L]
[R=301,L]