Redirect HTTP to HTTPS Using .htaccess

Editing .htaccess in cPanel ( File Manager )

Note : Backup .htaccess file befor Edit

  1. Login to cPanel
  2. Go to File Manager
  3. Select Setting > Enable Check “Show Hidden Files (dotfiles)
  4. Now select the domain name you want to access
  5. look for the .htaccess file
  6. Edit the file
  7. Add Code
  8. Save Changes when done
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]