Top Menu

What Are HTTP And HTTPS?

HTTP  is the cornerstone web technology that helps to transmit and share information across the WWW.
HTTPS is the second version of HTTP. It will make the Internet a safe haven for day-to-day transactions like eCommerce, Internet banking, instant messaging, video chat, file transfer, cloud storage, etc.

SSL Makes All The Difference

The key point of difference between HTTP and HTTPS is an SSL certificate. An SSL (Secure Sockets Layer) certificate encrypts the data before sending or receiving between a web server and a web browser. The data encryption ensures that no harmful malware, virus or even security threats sneak into the network of the end-user.

The Roadmap For HTTP To HTTPS Conversion

  1. Purchase and Configure SSL certificate
  2. Change website links with HTTPS
  3. Set Up 301 redirects to HTTPS
  4. Test and Deploy

How to redirect HTTP to HTTPS Using .htaccess

Before we move onto redirecting HTTP to HTTPS, here’s how you can edit .htaccess file. If you already know skip to Redirection steps
First Ways to edit a .htaccess file:

  1. Edit the file on your computer and upload it to the server using FTP.
  2. Use “Edit” mode in FTP program that allows you to edit a file remotely.
  3. Use a text editor and SSH to edit the file.
  4. Use the File Manager in cPanel to edit the file.

    Second Way Editing .htaccess in cPanel File Manager

    Note- Backup your website in case something goes wrong.

    1. Login to cPanel
    2. Files > File Manager > Document Root for:
    3. Now select the domain name you want to access
    4. Check “Show Hidden Files (dotfiles)”
    5. Click “Go”
    6. After a new tab or window opens, look for the .htaccess file.
    7. Right-click on the .htaccess file and click on “Code Edit” on the menu.
    8. A dialogue box may pop up asking about encoding. Click “Edit” button to continue.
    9. Edit the file
    10. “Save Changes” when done.
    11. Test your website to make sure it is done correctly. In case, there is an error, restore to the previous version and try again.
    12. Once you are done, click “Close” to close the window.

Redirect All Web Traffic

The paste is given below code in .htaccess, file

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Redirect Only a Specific Domain

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC] RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]

Redirect Only a Specific Folder

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI}
folder RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]

About The Author

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Close