How do I force HTTPS for my website so it uses my SSL certificate Print

  • https, ssl, secure
  • 1

If you have purchased an SSL certificate and you want to start using it you will need to configure your domain name to use HTTPS (secure) rather than HTTP (non secure). Most websites built with a CMS will allow this to be configured or enable this by default but for other types of website you may need to force HTTPS . To do this you may need to create a HTACCESS file and upload this to your web root folder.

Open notepad or your preferred text editor and in a new screen copy and paste the following code.

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

Remember to change yourdomain.com to the domain name of your website.

Save this to your local disk as htaccess.txt and upload this file to the web root of your website using your preferred  FTP client or via your hosting panel > file upload.

Rename this file to .htaccess and make sure it has permissions set to 644

If you already have a .htaccess file you can copy and paste the code and append it to the top of this file and save it .


Was this answer helpful?

« Back