How can I redirect http to https?

Create an .htaccess file with the following contents and upload it to your public_html directory.

   RewriteEngine On
   RewriteCond %{SERVER_PORT} !443
   RewriteRule (.*) https://www.yourdomain.com/ [R]

another method:

   RewriteEngine On
   RewriteCond %{HTTPS} !=on
   RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
   Header always set Content-Security-Policy "upgrade-insecure-requests;"

  • 499 Users Found This Useful

Was this answer helpful?

Related Articles

htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

To solve “.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable” follow...

How do I submit my site to search engines?

Submit your website to popular search engines to increase your webite's exposure and visitor...

Heartbleed Vulnerablity, Risk and Fix

The Heartbleed bug (http://en.wikipedia.org/wiki/Heartbleed_bug) is a serious vulnerability which...

Whitelisting Our Support System Email Address

Whitelist Instructions Because we use often use html emails with http addresses in them, our...

SSL - Creating a CSR in Windows 2003

Creating the CSR IIS Windows 2003 or 2000 Server: From Administrative Tools, run the Internet...