Search Our Database
How to Redirect User from HTTP to HTTPS
Introduction
If you have subscribed to an SSL certificate and notice that your website does not show HTTPS when users browse, don’t worry. The HTTPS is active; you just need to redirect HTTP traffic to HTTPS. Follow the steps below to ensure users are securely directed to the SSL version of your website.
Note: Ensure that Apache is configured for HTTPS connections and that the necessary SSL certificates are installed before proceeding.
Steps to Redirect HTTP to HTTPS
- Navigate to the following directory:
public_html/.htaccess - Edit the file and add the following script to enable the redirection from HTTP to HTTPS:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Once these changes are made, users who type “http” will automatically be redirected to the secure HTTPS version of your website.
Article posted on 2020-05-03 by Louis