Answer the question
In order to leave comments, you need to log in
How to redirect from HTTP to HTTPS with exceptions in htaccess?
Good day!
There is a code in htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
http://example.com/?wc1c=exchange
http://example.com/wc1c/exchange/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/wc1c/exchange/
RewriteCond %{REQUEST_URI} !^wc1c=exchange
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
Answer the question
In order to leave comments, you need to log in
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{REQUEST_URI} !^/wc1c/exchange/& [NC]
RewriteCond %{QUERY_STRING} !(^|&)wc1c\=exchange($|&)
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}? [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question