How to Automatically Redirect HTTP Traffic to HTTPS?

Most people struggle to understand how to automatically redirect http traffic to https, regardless of the tactic they use.

Sound like you? Fret not, this post will help you accomplish that in a much easy way.

Don’t believe me? Here are some of the easy ways that we’ve built to AGM users to redirect http traffic to https:

HTTPS Definition and its Basics

Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP) used for secure communication over a computer network and HTTPS is also encrypted in order to increase the security of data transfer.

For all intents and purposes, HTTPS is HTTP, HTTPS is just the secure version of HTTP.

To get technical on you, the main difference is that it just uses TCP port 443 by default thus making HTTP and HTTPS two separate communications.

Are there any SEO Advantages of Switching to HTTPS?

The benefits are obvious: maximize data security on the web, more secure and more private, increase ROI, improve search engine ranking, encrypt users sensitive information.

Also, Recently Google has officially announced that switching your website traffic from HTTP to HTTPS will give you a minor ranking boost.

So it’s that simple, right? If Google says to do it, then why not we do it.

It is obvious that HTTPS offers more security, so it is definitely the choice to put you in Google’s good graces. There are also some additional SEO benefits for you to consider when opting to do it.

Here’s why you should redirect all your http traffic to https:

  1. It may help improve search engine rankings.
  2. It increases ROI.
  3. It may turn your visitors into potential customers with trust.

No matter what side you are on—being the website user or your own site developer—a good online experience tends to involve a trusted third party and good data encryption.

In order to understand how to achieve this and better understand how you can automatically redirect http traffic to https, it’s important to first learn the basics steps to accomplish this. Below I’ll share an easy guide to help you understand how you can redirect all your http traffic to https.

How to Automatically Redirect all your http traffic to https?

If you have a secure socket layer certificate (SSL) on your website, you can automatically redirect all your HTTP visitors to the secured (HTTPS) version of your site for a secure connection which ensures data sent to and from your website is securely encrypted. AGM Web Hosting uses cPanel and there is a really simple step in cPanel that will help you accomplish this.

How to Automatically Redirect HTTP Traffic to HTTPS

Create/Add or Edit the .htaccess file using AGM cPanel’s File Manager

Now Let’s move ahead and add or edit the .htaccess file using AGM Web Hosting cPanel’s File Manager.

In the cPanel Dashboard, select the File Manager icon, which will be found in the Files section.

  • Firstly Login into cPanel.
  • Then, Click ‘File Manager’ in the ‘Files’ section.

Now, Click the Settings’ button at the top right of the page.

How to Automatically Redirect HTTP Traffic to HTTPS

In the Preferences panel that appears right after clicking the ‘settings’ button, ensure Show Hidden Files (dotfiles) is checked and Hit the Save’ button.

Now, once you navigate on the left bar inside file manager panel, click on the public_html, .htaccess needs to be displayed right there somewhere inside it as shown in the below image.

How to Automatically Redirect HTTP Traffic to HTTPS

Once you select the .htaccess file and highlight it, navigate directly at the top of the page and click on ‘Edit button’. Inside the Edit panel, again click on the Edit’ once again.

The cPanel text editor will now open. Now, kindly insert the below-provided code to automatically redirect any traffic destined for http: to https:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Click Save Changes to complete the redirection to the secure URL.

Congratulations! You now successfully redirect http traffic to https.

You have now forced your site to redirect to its secure URL via a configuration file(.htaccess) and adding some code to it.

If you notice any problems or if you need any help, please open a support ticket logging in your AGM client area. Wondering how to raise a support ticket? Fret not, we have an easy guide for you, click here to learn more details.

Leave a Reply