Computer Love > Resources

How To Force HTTP to HTTPS

(1/7) > >>

Skhilled:
First, you must have a SSL certificate installed! I highly suggest Let's Encrypt...it's free!!! If your hosting does not already have it installed ask them to install it.

https://letsencrypt.org/

Even if you have a SSL installed, you and your visitors can still view the HTTP part of your site. To prevent this you can create a .htaccess file and put it in your root directory where your domain resides. You should add the following code to it:


--- Code: ---RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
--- End code ---

If you already have a .htaccess file you'll want to add ONLY the 2nd and 3rd lines directly after the first instance of:


--- Code: ---RewriteEngine On
--- End code ---

This will force all pages of your site to use HTTPS instead of HTTP.  O0

Ken.:
How do we determine if our host has the SSL certificate is installed?

Skhilled:
Look in cPanel. It should be somewhere near the SSL icon.

Ken.:

--- Quote from: Skhilled on May 06, 2017, 07:16:42 AM ---Look in cPanel. It should be somewhere near the SSL icon.

--- End quote ---

Got it. ;D

Ken.:
Getting ready to add the code to my .htaccess file now.

Navigation

[0] Message Index

[#] Next page

Go to full version