Reputation: 510
I want all HTTPS to be rewritten to HTTP except one page. The problem is, there are pages containing a query string and other pages containing a page path. Only one page containing a certain querystring should NOT be rewritten. I can't get it together:
Should be rewritten:
https://domain.tld/index.php?id=1
https://domain.tld/index.php?id=2
[...and so on...]
https://domain.tld/path/page1.html
https://domain.tld/path/page2.html
[...and so on...]
Should NOT be rewritten:
https://domain.tld/index.php?id=999
Upvotes: 1
Views: 294
Reputation: 785256
You can use this rule to redirect all but one mentioned URI to https
:
RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} !\s/+index\.php\?id=999[&\s] [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [R=302,NE,L]
Upvotes: 2