IndianWebPortal.com

Something Different In Linux

Home » How to » Redirection from http to https

Redirection from http to https

Posted by Rishikesh Vispute Categories: How to, htaccess

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


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...