Saturday, 29 September 2012

Redirection from http to https and viceversa using htaccess file

Redirect from http to https
=========================
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]


Redirect from https to http
======================
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

No comments:

Post a Comment