Redirect website to https from cpanel or htaccess file or php

If you want to redirect using htaccess, add following lines in the htacess files

We can also redirect  using php code in out header file

To redirect from cPanel,

Log into your websites control panel, then go to “Domains” section. Click on “Redirects” option

– Select type “Permanent (301)” from dropdown menu

– Select domain name which you want to redirect

– And finally enter the url to which you want the above select domain redirect to