I have reached here for searching How To Redirect Http to Https forcefully for SSL Certificates. In 2021 SSL certification is provided by almost all hosting providers but we may face some errors during our blogging journey. So We need to know How to Redirect Htttp to Https editing .htaccess file in Our Cpanel provide by the Hosting Company.
Step by Step Process to Forcing HTTP to HTTPS
For Processing forward you must have Cpanel access without it we cannot move ahead.
1. Login To Your Cpanel.
2. Go to File Manager.
3. Go to Public_html.
Step 4: As Shown in the above image click on Setting Icon.
5. Select Show Hiden File.
6. Click On Save.
7. Now You Will Find .htaccess File in Public_html Folder.
8. Right-Click .htaccess file and Edit.
9. Copy the below code and paste it into the .htaccess File.
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
10. Now Save Changes.
Now Refresh Your Site. You Will See Lock Sign. As Below:
Before SSL Certificate
No SSL Certificate found before editing the .htaccess file.
After SSL Certificate
Conclusion:
If you have any queries related to how to redirect HTTP to HTTPS for SSL certificate forcefully editing .htaccess file then you can comment below. I hope I help you to get your problem solution.