【发布时间】:2014-09-02 12:33:53
【问题描述】:
我正在尝试将我的所有网站流量从任何 url 重定向到 https://,使用 .htaccess 文件保护 ssl。这必须匹配当前域和重定向,包括任何子 url。
我的代码:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_HOST} ^shop.test.com$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我遇到的问题是所有流量都被发送到 index.php
shop.test.com/testurl
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect