Skip to content

NinzaHost Blog

NinzaHost Blog

  • Home
  • Hosting
  • Contact Us
  1. Home
  2. /Free SSL
  3. /How to redirect HTTP to HTTPS using htaccess?

How to redirect HTTP to HTTPS using htaccess?

Cpanel, Free SSL, Hosting / August 1, 2021 / NinzaHost / 0

Do you want to redirect your website from HTTP to HTTPS? Don’t worry! Today, you will learn how you can easily redirect HTTP to HTTPS using htaccess file.

Are you ready to do it now?

If yes then you just need follow this guide step by step in order to redirect your website from HTTP to HTTPS.

Let’s start.

Steps to redirect HTTP to HTTPS using htaccess file :

Here are the steps you need to follow one by one so that you can also able to redirect HTTP to HTTPS.

STEP 1 – Login To Your cPanel Account

  • Go to NinzaHost.
  • Login your Account.
  • Select your Active Product/Services.
  • Click on “Login to cPanel” under Action Tab.

Login to cPanel

  • Then you will automatically redirected to your cPanel Account.

Or, If you have cPanel login details then you can easily login to your cPanel account by visiting yourdomain.com/cpanel.

STEP 2 – Go To File Manager

  • Search “File Manager” in the search bar.
  • Or, Look at the first one that is it.
  • Click on the File Manager.

Click on File Manager

  • Wait for the next page.
  • Now, Click on “public_html” folder.

Go to public_html

STEP 3 – Edit Your .htaccess File

  • If you don’t find .htaccess files then follow this to unhide it –
    • Go to Settings present at the top right corner.
    • Go to Settings
    • You will get a popup soon.
    • Here, you need to tick “Show Hidden Files (dotfiles)” option.
    • Then, click on the “Save” button.
    • Show hidden files
    • Done! You will able to see .htaccess file.
  • Now, right click on .htaccess file.
  • Then, click on Edit button.

Edit .htaccess file

    • If you get a popup then again click on the “Edit” button.
    • Click on Edit button
    • You will now redirected to a next page.
  • Copy the following code mentioned below :
  • RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
  • Paste the code at the top of .htaccess file.
  • Then, click on “Save Changes” at upper right corner.

Click on Save Changes

  • You will now get a success message at lower right corner like this :

Success

  • Done!
  • Now, you can click on “Close” button at upper right or can simply close the tab.
  • At last, check that the redirection is working fine.
  • All set, you are good to go.

Thanks for reading this article. Hope, your doubt regarding how to redirect HTTP to HTTPS using htaccess file is now completely resolved.

If you still have any doubt then please let us know through the comments.

Post Views: 218

How to redirect HTTP to HTTPS?, redirect http to https, redirect http to https using htaccess

NinzaHost

Affordable Web Hosting Provider

How to find Nameservers of your hosting service? How to change your domain Nameservers in NinzaHost?

Related posts

How to renew your web hosting service?

How to renew your web hosting service?

What is a cPanel? The Ultimate Web Hosting Control Panel

What is a cPanel? The Ultimate Web Hosting Control Panel

How to Change Your cPanel Password from Client Area?

How to Change cPanel Password from Client Area?

How to Reset Your cPanel via Client Area?

How to Reset Your cPanel via Client Area?

How to Login to cPanel from Client Area?

How to Login to cPanel from Client Area?

New Year Sale: Web Hosting at just Rs. 9

New Year Sale: Web Hosting at just Rs. 9

Latest posts

How to Enable ID Protection for Your Domain

How to Enable ID Protection for Your Domain?

How to get your domain Authentication Code from Client Area

How to get your Domain Authentication Code from Client Area?

How to check and reply to your opened tickets

How to Check & Reply To Your Opened Tickets

How to renew your web hosting service?

How to renew your web hosting service?

How to View and Pay Your Invoice from Client Area?

How to Enable Transfer Lock for Your Domain?

How to Enable Transfer Lock for Your Domain?

Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

SEARCH HERE

Recent Posts

  • How to Enable ID Protection for Your Domain?
  • How to get your Domain Authentication Code from Client Area?
  • How to Check & Reply To Your Opened Tickets
  • How to renew your web hosting service?
  • How to View and Pay Your Invoice from Client Area?

Copyright © 2025 NinzaHost

Search