I found many questions like this and tried almost all but failed. My most latest code is:
RewriteCond %{HTTPS} !^on$
RewriteCond %{REQUEST_URI} (/page_1|/page_2|/page_3|/page_3)$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
I want to redirect http to https only for those pages (page_1 - page_4)
Initially it seems to be work but once I reached to page_1 with https and click any other (let say page_my_http_1) link which should not be https it also redirect to https for that page (page_my_http_1).
I also tried:
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} (auth|register|secure)
RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !(auth|register|secure)
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]
or is there any way to show custom message to user if SSL certificate is not activated on their browser?
Actually many non-technical user gets shocked when the see default warning message shows by the browser.