Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

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

0 votes
added Jul 18, 2017 in Domain & hosting by birdygeek Sergeant (2,060 points)

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. 


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.