简体   繁体   中英

Change HTTPS to HTTP for three pages on our site

I am looking to exclude 3 pages from my https. So to force them to use http:// instead of my rule to set to https:// - I've tried many ways but believe my https rule is overriding them. If anyone can help me write an exclusion for those pages within my rules? Is this even possible?

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^([^\.]+)\.example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

Try using this -

RewriteEngine On

RewriteCond %{HTTPS} on
RewriteCond %{THE_REQUEST} /(page1|page2|page3) [NC]
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=302]

Not sure which all three pages you want to exclude from https hence have used page1,page2 and page3 for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM