Redirect your site to SSL-enabled domain HTTPS with .htaccess

0 votes
added Jul 18, 2017 in Domain & hosting by anonymous
edited Jul 18, 2017 by anonymous

Simply add the following codes anywhere under RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Save and upload it to server.

No cpanel setting required at all. 

Done - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.