Hi guys.
I hope some one can help me. I have been searching every where but I can't find a simple answer.
I am using the following in my htaccess to redirect login and signup from http to https. I only want THESE TWO pages to redirect to https but the rest of my site needs to redirect to http and NOT https.
RewriteOptions inherit
DirectoryIndex index.php
RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico|sitemap\.xml)$
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteRule ^index.php(.*)$ ht
tp://www.example.com/$1 [r=301,nc]
RewriteEngine On
#
# Externally redirect http requests for confirm and checkout page to https
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^((confirm|checkout)\.php)$ ht
tps://%{HTTP_HOST}/$1 [R=301,L]
#
# Externally redirect https requests for everything except login and signup
# pages and the resources shared between http and https to http
RewriteCond %{SERVER_PORT} =443$
RewriteCond $1 !\.(gif|jpe?g|jpg|png|ico|css|js)$
RewriteCond $1 !^((confirm|checkout)\.php)$
RewriteRule ^(.*)$ ht
tp://%{HTTP_HOST}/$1 [R=301,L]
With this code login and signup redirects from http to https. When I type in ht
tps://www.example.com it doesn't redirect to ht
tps://www.example.com but if I enter ht
tps://example.com it redirects to ht
tp://www.example.com perfectly. My images also doesn't redirect to http.
What am I doing wrong?
[edited by: Ocean10000 at 1:41 pm (utc) on Sep 16, 2015]
[edit reason] broke unintenial links [/edit]