how to redirect http to https

how to redirect http to https

If you have SSL certificate in your website. Then you can automatic redirect your visitors HTTP to HTTPS for a secure connection. In HTTPS ‘S’ shows that your communication is secure. But how to redirect http to https?

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.







Smart Sale

Hurry Up! Offer ends in
days 02 01 02
hrs 01 00 01
mins 55 54 55
secs 25 24 25
Buy Now