No Index https, redirect https to http

RewriteEngine on

RewriteCond %{HTTPS} ^on$
RewriteCond %{REQUEST_URI} ^/robots.txt$
RewriteRule ^(.*)$ /robots-ssl.txt [L]

#this page has to be on https
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} ^/ssl.php$ [NC]
RewriteRule ^(.*)$ https://mydomain.com/$1 [L,R=301]

#all other pages have to be on http
RewriteCond %{SERVER_PORT} ^443$ [OR]
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/ssl.php$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [L,R=301]

0 Comments

You must be logged in to post a comment.