【发布时间】:2016-09-29 15:02:27
【问题描述】:
我有底部代码,我想始终使用 https 而不是 www,问题是当 URL 为 http://example.com 时未重定向到 https://example.com
有什么想法吗?非常感谢
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
【问题讨论】:
标签: .htaccess mod-rewrite https url-redirection