How to redirect your website to HTTPS

To redirect your website to HTTPS. Enter the following to your .htaccess file.


RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Save the file, then test via your browser.


How to edit the .htaccess file


  1. Right click on the .htaccess file and click Code Edit from the menu. Alternatively, you can click on the icon for the .htaccess file and then click on the Code Editor icon at the top of the page.

  2. A dialogue box may appear asking you about encoding. Just click Edit to continue. The editor will open in a new window.

  3. Edit the file as needed.

  4. Click Save Changes in the upper right hand corner when done. The changes will be saved.

  5. Test your website to make sure your changes were successfully saved. If not, correct the error or revert back to the previous version until your site works again.

  6. Once complete, you can click Close to close the File Manager window.

  7. Note: Instead of using the cPanel method, many people find changing the .htaccess file via FTP or SSH an easy alternative.
  • 0 Users Found This Useful
Was this answer helpful?