How do I redirect my website pages to HTTPS?

Updated by Josselyn Rodriguez

Redirecting website to HTTPS for cPanel/Linux:

You can force all the pages on your website to use HTTPS instead of HTTP. To do this you will need to modify your .htaccess file. Using the Code Editor in the File Manager, add these lines to the beginning of the .htaccess file:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

If you already have an existing .htaccess file

  • Do you not duplicate "RewriteEngine On"
  • Make sure the lines beginning 'Rewrite Cond' and 'Rewrite Rule' immediately follow the already-existing 'Rewrite Engine On'.

Substitute example.com with your domain name.
Please note than an HTTPS connection requires an SSL Certificate.

Redirecting website to HTTPS Plesk/Windows:

Plesk uses your web.config file to redirect your website to HTTPS. Using the following code below will allow you to do this:

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

Substitute example.com with your domain name.
Please note than an HTTPS connection requires an SSL Certificate.

Having trouble? Contact us and our team will be happy to help.


How did we do?