【发布时间】:2013-07-29 10:51:47
【问题描述】:
来自.htaccess 我无法检测到是否https。
我只需要,如果我击中:
- "http://www.example.com" --转到--> "http://www.pure-site.com"
- "https://www.example.com" --转到--> "https://www.secure-site.com"
在我的.htaccess:
RewriteCond %{HTTPS} on
RewriteRule ^(.*)$ https://www.secure-site.com [R=301,L,NS]
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.pure-site.com [R=301,L,NS]
但它可以永远检测不到 RewriteCond %{HTTPS} on。
我在负载平衡的 AWS/EC2 实例上。
【问题讨论】:
-
我认为这不可能。
标签: .htaccess redirect mod-rewrite https amazon-ec2