Mob: +91 706-199-9900 | +91 995-370-9380

If we install SSL Certificate for our website, then we need to move from http to https. This is done by .htaccess file and there is a simple code which is used.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$$1 [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$$1 [L,R=301] 

The only real difference here is that first we redirect from non-WWW to WWW then we check for HTTPS and redirect it.


Leave a Reply

Your email address will not be published. Required fields are marked *