+91 - 9161069102 support@megaacshost.com

How to force HTTPS in your domain using htaccess ?

How to force HTTPS in your domain using htaccess ?

SSL is important for protecting your website, even if it doesn’t handle private information like personal data, bank details, credit cards. It provide critical security, and data integrity for both your websites and your users’ personal information.

The primary reason why SSL is used is to keep encrypted sensitive information only receiver can understand it like (end-to-end encrypted). This is necessary because the information you send on the Internet is passed many computers to get to the destination server. Any computer in between you and the server can see your personal data and other sensitive information if it is not encrypted with an SSL certificate.

if you want to force all the traffic to use HTTPS insert the following code in the .htaccess file in your website’s root by editing it. >> public_html folder.

If you unsee the .htaccess file in your public_html folder, then select the Settings button and then check the box in front of show hidden files and save it. then you can see the .htaccess

MEGA ACS HOST

Important:- If you have already existing code in your .htaccess, add this above where there are already rules with a similar starting prefix.

MEGA ACS HOST

If you want a specific domain  to be forced to use HTTPS, you can use the below code in the .htaccess file in your website’s root >> public_html folder:

MEGA ACS HOST

If you want to force SSL on any specific folder you can use the below code in the .htaccess file inside that specific folder:

MEGA ACS HOST

Important: Don’t forget to replace the example.com with your real domain.

we hope you’re enjoying this information

Leave a Reply

Your email address will not be published. Required fields are marked *