Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Redirection from http to https using htaccess  (Read 1904 times)

0 Members and 1 Guest are viewing this topic.

jominj

  • Guest
Redirection from http to https using htaccess
« on: January 08, 2014, 10:11:37 pm »
If SSL Is Installed on the server and we can redirect all the request to https. One method to do Is configure the .htaccess file. We can achieve this by adding following code to the .htaccess file
===================
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

===================
 Or we can use the code as follow
===================
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.domain.com [L,R]

====================

That's it now all the request coming to the domain will be redirected to the https.