Redirect Blog Posts from HTTP to HTTPS Without the Use of Plugins: A Complete Guide

Redirect Blog Posts from HTTP to HTTPS Without the Use of Plugins: A Complete Guide

In 2017, Google made an update to its Chrome browser. The browser started labeling websites that lacked security as insecure. And the way it checks for security is by looking for the SSL certificate. If a website has a SSL certificate, it will show a “Green” icon in the URL tab.

Keeping this update in mind, many website owners are purchasing a SSL certificate and migrating from HTTP to HTTPS.

A plugin is usually the preferred method for anything in WordPress. But in this article, we explain how you can make the redirects without the use of a plugin.

Step-by-step Process

The process starts with working on some core files on your server. When you purchase a hosting account, you get either an Apache or Nginx web server.

But you don’t have to worry about the exact details. Just follow the steps mentioned below.
  • Log in to your cPanel account
  • Open File Manager under the Files section
  • If you’re managing more than one website, select the website you want to work on
  • From the left-hand side panel, find the “public_html
Code:
server {
listen80;
server_name yoursite.com www.yoursite.com;
return301 https://yoursite.com$request_uri;
}
  • folder and click on it
  • In the main panel, locate the “.htaccess” file. Right-click on it and select Edit to start editing. If you can’t find .htaccess file, then click on “Settings” and check the “Show Hidden Files” box
  • In the new pop-up window, click on “Edit” to confirm
  • In the next tab, you’ll get to see the codes of the .htaccess file. You need to add the following codes:
Code:
<IfModule mod_rewrite.c>
RewriteEngineOn
RewriteCond%{HTTPS}off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
  • You to include the codes within #Start WordPress and #End WordPress
  • Save the changes and exit.
If you’re using NGINX server, you have to add the following files in the configuration file:

Now check the blogs post to see if they’re redirecting from HTTP to HTTPS. If so, then you’ve made the changes successfully without the use of any plugin.
Author
kumkumsharma
Views
2,114
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top