Automatically Redirecting Visitors to HTTPS Print

  • 1

If you have a secure certificate (SSL) on your website, you can automatically redirect visitors to the secured (HTTPS) version of your website to make sure your communications are encrypted.

How you do that depends on what type of hosting account you have 

Linux 

You'll need to either create or modify your hosting account's .htaccess file. If you need to create one, you can use your control panel's file manager (more info).

Add the following code to the .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} !=443
RewriteCond %{HTTP_HOST} ^(www\.)?your domain name\.com$ [NC]
RewriteRule ^$ https://www.your domain name.com/%{REQUEST_URI} [R,L]

Where your domain name is your website's domain name. You will need to replace .com with your domain name's TLD.

 

Was this answer helpful?

« Back