How to redirect website HTTP to HTTPS using .htaccess

0

- Advertisement -

Note: Backup your website in case of something wrong.

Login into your cPanel
Use the file manager in cPanel to edit .htaccess file.
Now to put this code in the .htaccess file

You can also redirect your website on the basis of port number

Change yourwebsite.com with your website domain. This code will redirect all requests received from port 80 to HTTPS.
If you are not able to find .htaccess in your hosting then click on the Show hidden file.

- Advertisement -

Leave A Reply

Your email address will not be published.