Chat with us, powered by LiveChat How to enable HTTPS for your website - LCN.com

How to enable HTTPS for your website

This guide will explain how to enable HTTPS on your website. For customers using LCN web hosting.

Please note: these instructions don’t apply to websites running WordPress or other content management systems – A guide for WordPress can be found here.

Let’s get started…

Enabling HTTPS using .htaccess

You can configure your site to use HTTPS by using a .htaccess file – for further information on .htaccess files see our guide here.

Enabling HTTPS for all pages within your site

    1. Create a file using a text editor such as Notepad.
    2. Save the file as: .htaccess (without any additional file extensions).
    3. Enter the following lines of text within the file:

    4. RewriteCond %{HTTPS} !on
      RewriteCond %{REQUEST_URI} !.well-known/acme-challenge
      RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    5. Save the file and upload it to the web folder of your site.

    Please note: Instructions on uploading the file to your website can be found here.

    Enabling HTTPS for a specific folder within your site

    1. Create a file using a text editor such as Notepad.
    2. Save the file as: .htaccess (without any additional file extensions).
    3. Enter the following lines of text within the file, changing the URL within the ‘RewriteRule’ line to set your domain and folder name:

    4. RewriteEngine On
      RewriteCond %{SERVER_PORT} 80
      RewriteCond %{REQUEST_URI} folder
      RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]

    5. Save the file and upload it to the specified folder you would like to be secured.

    That’s it! You’ve enabled HTTPS on your website.

  • Was this article helpful?

    Check out some of our related guides

    Need a hand? Search over a hundred step-by-step support guides