Force HTTPS instead of HTTP on a GoDaddy Hosted Domain or Website


Whenever you enter website URL address in the browser like this;

website.com

or

http://www.website.com

It goes to unsecured address i.e.

http://website.com

or

http://www.website.com

Until you enter HTTPS instead of the HTTP, it always goes to the unsecured website address. Here’s how you can force your website to always use HTTPS no matter one types it in a browser or not;

Sign in to your GoDaddy account and click “My Products”.

Under Web Hosting, click “Manage”;

Next, click “cPanel Admin” button to continue;

In the cPanel, under Files, click “File Manager”;

In the File Manager, click “Settings” on top-right hand corner and enable the check box labeled “Shows Hidden Files (dotfiles). Click “save” button when done;

Next, browse to public_html folder and see if .htaccess file already exists. If it does, click the “Edit” button. If it does not, simply click the plus sign “File” option at the top-left hand corner and name the new file as .htaccess;

Next, copy/paste this code in the .htaccess file and click “save” when done;

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

Now, all of your unsecured HTTP website traffic will be forced to visit every link as HTTPS (or a website with secure SSL certificate).

For example, http://example.com will be like https://example.com

Courtesy:

https://www.hostinger.com/tutorials/ssl/forcing-https

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s