Knowledge Base
MilesWeb / WordPress FAQ

Learn to Redirect HTTP to HTTPS in WordPress with Simple Steps

Approx. read time : 3 min

HTTPS protocol represents secure communication over a computer network which is widely used on the Internet.

There are several WordPress users migrating from HTTP to HTTPS and the reasons are as below:

1. Google announced that HTTPS will be considered as ranking factor in Google search.

2. The new HTTP/2 protocol helps in boosting the performance that needs HTTPS due to browser support. MilesWeb supports HTTP/2 on all servers.

3. HTTPS is considered to be highly secure and your visitor’s data stays completely encrypted.

4. It helps to build trust by enabling the green padlock in the visitor’s web browser address bar.

5. If someone visits a website from HTTPS and is going to an HTTP website, the referral data isn’t saved in Google Analytics. It usually gets combined together with the “direct traffic”. On the other hand if someone goes from an HTTPS website to another HTTPS website, the referral data is saved. So, migrating from HTTP to HTTPS, gives you a more accurate referral data.

Steps to Redirect HTTP to HTTPS in WordPress

You will find few options when choosing to redirect HTTP to HTTPS in WordPress.

If you’re a MilesWeb client, you can either force HTTP to HTTPS via cPanel or by modifying the .htaccess file from file manager.

Redirect HTTP to HTTPS via cPanel

To set redirection for a site without www, please add below code in .htaccess file from cPanel > File Manager > Public_html > Add below code in .htaccess:

To set redirection for a site with www, please add below code in .htaccess file from cPanel > File Manager > Public_html > Add below code in .htaccess:

Redirect HTTP to HTTPS Using .htaccess

Refer this guide for redirecting HTTP to HTTPS using .htaccess.

Redirect HTTP to HTTPS in Nginx

As per the W3Techs, Nginx is the fastest growing web server and holds more than 30%+ market share as of 2017.

Averagely, every minute one of the top 10 million websites starts to use Nginx.

In case your web server is running Nginx, it is possible to easily redirect all of your HTTP traffic to HTTPS. Simply add the following code to your Nginx config file. This method is recommended especially for redirecting WordPress running on Nginx.

Redirect HTTP to HTTPS in Apache

In case your web server is running Apache, redirecting all of your HTTP traffic to HTTPS becomes very easy. For this, add the following code to your .htaccess file. This method is recommended for redirecting WordPress running on Apache.

Redirect HTTP to HTTPS using Really Simple SSL Plugin

You can also redirect from HTTP to HTTPS by using the free WordPress Really Simple SSL plugin.

This method isn’t as a permanent solution as 3rd party plugins can lead to other problems and compatibility issues.

Also, to migrate from HTTP to HTTPS, it is important to update your HTTP URLs in the database, instead of relying on a plugin. But this can be a good temporarily solution.

It has been installed by more than 2 million times and has been given a 4.9 out of 5-star rating. You can download this plugin from the WordPress repository or by searching it within your WordPress dashboard under “Add New” plugins. The plugins does the below things:

  • It redirects all incoming HTTPS requests from HTTP to HTTPS. This is done either with .htaccess, or else with JavaScript.
  • Changes the WordPress site URL and home URL to HTTPS.
  • Fixes your insecure content by replacing all HTTP:// URLs with HTTPS://, except links to other external domains.

All this process is dynamic. Other than the WordPress site URL and home URL, no other database changes are made.

To use this plugin, you need to simply install and click on “Go ahead, activate SSL” and you’re good to go.

That’s all! This ways you can now redirect HTTP to HTTPS in WordPress.

Avatar
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.
Need help? We’re always here for you.