All my pages are indexed with https: URL in Google because in the past my my secure base URL and unsecure base URL both were https://www.example.com
Now my secure base URL is https://www.example.com
an unsecure base URL is http://www.example.com
Such that checkout and customer pages open with https://www.example.com
and all other pages open with http://www.example.com
Issue:
As my all page are indexed as https in Google, I want to redirect https non checkout and non customer URLs to http
I tried with this .htaccess
code, without success:
RewriteEngine on
# From https to http
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} ^/
#RewriteCond %{REQUEST_URI} !^/customer/account/
#RewriteCond %{REQUEST_URI} !^/checkout/multishipping/login/
#RewriteCond %{REQUEST_URI} !^/wishlist/
#RewriteCond %{REQUEST_URI} !^/index.php/admin/dashboard/index/key/
#RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
# From http to https
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/checkout/cart/ [OR]
RewriteCond %{REQUEST_URI} ^/customer/account/ [OR]
RewriteCond %{REQUEST_URI} ^/checkout/multishipping/login/ [OR]
RewriteCond %{REQUEST_URI} ^/wishlist/ [OR]
RewriteCond %{REQUEST_URI} ^/index.php/admin/dashboard/index/key/
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]
Best Answer
This code solved this problem