How to Redirect HTTP to HTTPS in WordPress Without a Plugin

Photo of author

By Shrey Kajaria


JUST AN ADVERTISEMENT


CONTINUE READING BELOW

If you are looking for how to redirect HTTP to HTTPS, then your search is over, below I have shared the best and the simplest way to do that.

So, Let’s get started.

How to Redirect HTTP to HTTPS in WordPress

Step 1: First, log into your cPanel and go to file manager.

file-manager-cpanel

Step 2: Then click on your domain name folder, and find the .htaccess file.

find-htaccess-file

Step 3: Then right-click on the .htaccess file and click on the edit option, a pop-up will open, and again select the edit option.

edit htaccess file
editing htaccess file

JUST AN ADVERTISEMENT


CONTINUE READING BELOW

Step 4: Now Add the below code, paste it into the .htaccess file, and click the save changes button.

redirect http to https code in htaccess file
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

That’s all now your domain will automatically redirect all HTTP URLs to HTTPS.

So this was a quick guide on how you can redirect your HTTP URLs to HTTPS.