【发布时间】:2017-11-05 14:14:49
【问题描述】:
我找不到适合我的解决方案。
这里是我的设置:
# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
# Redirect http to https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
每个部分都很好,但不能一起使用。 https 重定向的部分总是重定向到https://domain.tld,所以没有www,它被忽略了。 有人知道解决方案吗?
提前致谢。
【问题讨论】:
标签: http web https url-redirection no-www