http重定向到https,除非有一页

时间:2016-06-16 07:52:08

标签: .htaccess https

我在.htaccess文件中有这个,将所有HTTP重定向到HTTPS:

RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.sientemarruecos.viajes/$1 [R=301,L]

但是现在,由于电子商务通知,一页:http ://www.sientemarruecos.viajes/?wc-api=WC_redsys主页)

必须 NOT 重定向。谁能告诉我怎么做?非常感谢。

1 个答案:

答案 0 :(得分:1)

尝试:

RewriteEngine on
RewriteBase /
#skip all rewriteRules bellow if the request is for "/?wc-api=WC_redsys"
RewriteCond %{THE_REQUEST} /\?wc-api=WC_redsys\sHTTP [NC]
RewriteRule ^ - [L]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.sientemarruecos.viajes/$1 [R=301,L]