Rafael Iglesias
Rafael Iglesias

Reputation: 21

http redirects to https unless one page

I have this in my .htaccess file, to redirect all HTTP to HTTPS:

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

But now, due to e-commerce notifications, one page: http ://www.sientemarruecos.viajes/?wc-api=WC_redsys (NOT the home page)

Must NOT be redirectered. Could anyone tell me how to do it? Thanks a lot in advance.

Upvotes: 1

Views: 40

Answers (1)

Amit Verma
Amit Verma

Reputation: 41219

Try :

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]

Upvotes: 1

Related Questions