.htaccess条件重定向https到http

时间:2014-04-01 15:44:44

标签: html .htaccess http https rackspace-cloud

我试图让我的网站所需的所有https路由到http除外/商店

在我的.htaccess中使用以下代码,但它无效:

#redirect all https traffic to http, unless it is pointed at /shop
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/shop/?.*$
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]

托管在rackspace云站点上。

.htaccess中的其他代码

RewriteEngine on
RewriteBase /

# Shop rewrite rule + remove trailing slash
RewriteRule     ^shop\/(.*)/$                   shop/$1             [R=301,L]
RewriteRule     ^shop\/([A-Za-z0-9-/]+)$        shop.php?shop=$1        [NC,L,QSA]

DirectoryIndex index.php index.html index.htm

0 个答案:

没有答案