Redirection from http to https

How to Redirect from http to https URL.
If the ssl is installed on the server and you want to all the request redirected to https then you need to add the folloing code in .htaccess file.
============================
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
============================
or
============================
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.domain.com [L,R]
============================
done

Leave a Comment