Knowledge Base Article

How to redirect my website to be opened through HTTPS?

In order to redirect your website to be opened through HTTPS, you should add the following rewrite rule in your .htaccess file:

 

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://www.domain.com/%{REQUEST_URI} [R,L]

 

This will redirect your domain to https://www.yourdomain.com. If you wish the redirect to work without www, you should remove it from the rewrite rule:

 

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule .* https://domain.com/%{REQUEST_URI} [R,L]

 



Rating

Please indicate if this article was helpful for you.

rating :  4.7 from 5
views :  1599
votes :  25

Haven't found what you are looking for? Suggest an article HERE.

powered by

Valid XHTML 1.0 Strict Valid CSS!