Redirect HTTP to HTTPS

  •   22/01/2021 15:18
  •  

Once you have installed a valid SSL certificate on your website, you'll most likely want to ensure that any visitors are accessing your site securely. By default, a visitor can choose whether they load the site insecurely via http:// or securely via https://, but with a quick tweak you can force all ofyour visitors onto https:// by default.

Wordpress, Joomla, Drupal etc.

If you are using Wordpress or another Content Management System (CMS) such as Drupal or Joomla, then there may be a plugin which can handle this for you.

Remember to make sure that you update any settings for your web site's URL to have https:// at the beginning as this is often used by the CMS when building links or creating redirects.
In Wordpress you can accomplish this by going to Settings->General Settings and making sure that "WordPress Address (URL)" as well as "Site Address (URL)" both start with https://. This needs to be done after your SSL certificate has been installed but before configuring any redirects so as not to break your access to the Wordpress admin dashboard.
Plesk control panel setting

For our standard web hosting, Windows web hosting and ULTRA hosting customers, you can enable redirection to HTTPS quickly and easily within the Plesk control panel; just click on the Hosting Settings icon on the Websites & Domains tab and then tick the "Permanent SEO-safe 301 redirect from HTTP to HTTPS" checkbox.

Linux (cPanel)

For our Linux powered cPanel hosting, you need to create a file called .htaccess in the public_html folder of your website. If you already have one just edit it and add the following code:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This also works for any unmanaged servers using the Apache or LiteSpeed web server without a control panel.

Windows

If you have an unmanaged Microsoft Windows server, then you need to create a file called web.config in the httpdocs folder of your website, if there already is such a file then you'll need to edit it and add the following code:
<configuration>
<system.webServer>
<rewrite>
    <rules>
    <rule name="HTTPS 301" 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>

  Print


Comments


  Add Comment

Confirm Submission

Please enter the text from the image in the box provided, this helps us to prevent spam.