Force HTTP to HTTPS
Force HTTP to HTTP
Date posted : 06/02/2019
In this post we will explain redirect the url from http to https.
Before you follow this steps, you need ssl certificate for your domain.
Step 1: Create or update the .httacess file with following code
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example1\.com [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
After you have added the code to your .htaccess file you should Save the changes. Then, clear your browser’s cache and re-check the connectivity to your site via HTTP. If everything was added correctly, the browser will redirect you to the HTTPS version automatically.
Thanks for using pheonix solutions.
You find this tutorial helpful? Share with your friends to keep it alive.