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;"

  • 503 Users Found This Useful

Was this answer helpful?

Related Articles

osCommerce password reset

How to reset your osCommerce admin login... You can reset your osCommerce administrative login...

When I upload an htaccess file it disappears

On unix/linux systems, files that start with a . are considered hidden so many ftp programs do...

html or htm parsed as shtml not working

To parse .html or .htm files as .shtml add the following to your .htaccess file in the...

My pages are updating/refreshing slowly

Refresh is immediate on the server. When a file is updated and uploaded it is there. If you are...

Why is the server load status red?

The server load status will be red if the server is under a little more stress than usual. This...