1
我无法找到适用于我的工作解决方案。Apache:将所有请求重定向到https://www.domain.tld
这里我设置:
# 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,它被忽略。 有人知道解决方案吗?
在此先感谢。
谢谢,但它也不起作用 – satriani
“不工作”无法解释......什么是行为? –
''http://domain.tld https://domain.tld和https://www.domain.tld重定向到http:// www。/'' ''http://www.domain。 tld - > 404 Page Not Found'' – satriani