Auto redirect to HTTPS

Using the following code in your .htaccess file automatically redirects visitors to the HTTPS version of your site:

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

If you have an existing .htaccess file on public_html folder:

  • Do not duplicate RewriteEngine On.
  • Make sure the lines beginning RewriteCond and RewriteRule immediately follow the already-existing RewriteEngine On.
  • 21 Users Found This Useful
Was this answer helpful?

Related Articles

Procedure to upload files via Filezilla

Download FTP client software like Filezilla. Install it. FILEZILLA Click on File >> Site...

Procedure to upload files via Cute FTP

Click on File >> New >> FTP SiteUnder General TabLabel - Provide the site name Host...

How to configure Outlook Express ?

You will be able configure outlook express. The following steps will guide through to configure...

Optimizing Scripts

Optimising your server side scripts such as ASP and PHP is very important for better utilisation...

How to create an email account ?

Your website's hosting control panel user name and password. procedure  1. Login to the Cpanel....