How to redirect site to HTTPS via .htaccess file

In order for the site to automatically redirect all web traffic to the https protocol (even if it comes from http), you need to set a simple rule in the .htaccess file. Here's how. 

Step 1: Open cPanel
Step 2: Find the File Manager application
Step 3: Go to the site folder. If it has only one site, then it is the /public_html folder, but if you have multiple sites, look for exactly which folder is used by the site you want to automatically redirect to https. 
Step 4: Create a new .htaccess file or if it already exists then just add these lines to the .htaccess file:

# https
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R =301]




Save this file, and clear the cache of your browser. 

Your site will then redirect automatically to https.
  • .htaccess
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How many domains can I register?

There are no limits. You can register as much domains as you want. 

How to change hosts file?

If you want to look at your site with our server, and your domain is inactive or directed to...

Is additional documentation required when registering a domain?

To register any domain name, no additional documentation is required. Depending on whether the...

Can you preregister a domain before I pay?

No, domains cannot be preregistered - domains can only be registered. We register a domain for...

How can I point my domain to AdriaHost?

To point your domain to AdriaHost, you will need to change your domain nameservers. You can...