how to redirect http to https

Home » how to redirect http to https

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
how to redirect http to https

If you have SSL certificate on your website. Then you can automatically redirect your visitor’s HTTP to HTTPS for a secure connection. In HTTPS ‘S’ shows that your communication is secure. But how to redirect HTTP to HTTPS?

Blue And White Modern Creative Digital Marketing Outdoor Banner

For example:

In this link‘s’ shows that Arzhost website is secure.

There is nothing to do from your side. you enforce the site to use secure URL.

how to redirect http to https

For main domain enforce the SSL:

  1. Login to cPanel
  2. In domain side click on domains

domain section

  1. After click on domains page is open and you can see that there is an option you can enable or disable HTTPS redirect. you should leave to enable it. If there is no option to on it. Then SSL is not installed in your domain. Make sure that SSL is install or not if not installed then installed it.

enable https

If this section is on then your site is using HTTPS.

  1. Enforce the SSL for addon name.
  2. Linux using .htaccess files for redirection. you will need to create .htaccess file in your control panel file manager.
  3. In cpanel click on file manager.

on file manager

  1. In file manager section click on setting.

click on setting

  1. Ensure that show hidden file is check and save.

check box hidden files

  1. Click on public_html

click on public_html

  1. In public_html click on .htaccess

If you have .htaccess file good. If you have not then click on file and name the file .htaccess and create it.

create htaccess file

  • Select the file .htaccess and click edit

edit htaccess file

  • If you created .htaccess file, use this code for setup the URL redirect HTTPS version for your website.


<ifmudule mod_rewrite.c>

Rewriteengine on

Rewritebase /

Rewriterule  ^index\.php$  – [ L ]

Rewritecond  %{REQUEST_FILENAME}  ! – f

Rewritecond  %{REQUEST_FILENAME}  ! –  d

Rewriterule      .   /index.php   [ L ]


  • If .htaccess file is already exit then don’t make duplicate rewritrengine on.
  • Ensure that lines start with rewriteenginecond and rewiteRule
  1. Save changes and close it. That’s all.


Share on facebook
Share on twitter
Share on pinterest
Share on linkedin
On Key

Related Posts