How to force SSL using .htaccess

To force your site to use SSL/https you should create a .htaccess file inside your site's document root folder or If your site is in a sub folder, create a .htaccess file in the corresponding subfolder. You should be able to create or edit your .htaccess file via FTP or using the File Manager available in your hosting control panel.

The .htaccess file should contain the following:

RewriteEngine On 
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$
https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

Using FTP to upload files

Tech Note: While FTP is still a widely used and accepted protocol it is deprecated due to the...

Which verision of PERL is installed on the server?

In order to find out which perl is installed you can run perl -v This is perl 5, version 16,...

What is a domain alias and how do I add or remove a domain alias?

A domain alias is a domain which you own, but which doesn't have it's own website or unique...

How to access a Website before it is made live on the Internet

Question: How do I access a website my new website before making it live on the Internet? We are...