我正在尝试将所有流量重定向到 HTTP,除非它是我们的结帐过程,在这种情况下,我正在尝试将其重定向到 HTTPS。
我有一个 Rackspace Cloud Sites 设置,但是下面的设置似乎不起作用。下面有什么我做错了吗?
谢谢!
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php
RewriteEngine On
RewriteBase /
#redirect to www
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#redirect all https traffic to http, unless it is pointed at checkout
RewriteCond %{HTTP:X-Forwarded-SSL} on
RewriteCond %{REQUEST_URI} !^/checkout/?.*$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#redirect all http traffic to https, if it is pointed at /checkout
RewriteCond %{HTTP:X-Forwarded-SSL} off
RewriteCond %{REQUEST_URI} ^/checkout/?.*$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]