【发布时间】:2017-07-31 15:15:46
【问题描述】:
我找到了很多示例,但所有示例都是针对特定域的,并且我的服务器有许多主域和子域。
我希望将所有主域重写为 https://www,但子域仅重写为 https://:
main-domain.xxx -> https://www.main-domain.xxx
sub.main-domain.xxx -> https://sub.main-domain.xxx
我现在正在使用这个规则来获取 https://
RewriteCond %{REQUEST_SCHEME} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
【问题讨论】:
标签: .htaccess mod-rewrite subdomain no-www