How To Redirect From Http To Https – 3 Methods on WordPress Website
Table of Contents
Redirect From Http to Https:
Nowadays security is a major thing in all aspects. Similarly, for the websites, the security is the most necessary thing which protects from suspicious and malware attacks. Studies have shown that up to 45% of the servers are attacked and has no enough secure methods. To prevent these type of activities, SSL certificates are provided for the websites by the web hosting companies to protect the websites from other harmful attacks. Http is a protocol for secure connection which is widely used on the internet. Many of the users who have their own sites are migrating from http to https for security purposes. The biggest concern is how to redirect http to https in a WordPress website successfully, which is being discussed today.
Websites with https perform well than the websites with the http. Because the SSL certificates protect every single information from the stealers and serve as the backbone of the website. Google has suggested that the sites with https will have a good ranking of their pages.
There are three simple ways in which you can redirect from http to https for any WordPress website. They are:
- WordPress Plugin
- .htaccess file
- cPanel Force Redirection
Using WordPress Plugins:
Although WordPress provides high secure methods for the sites, by adding a security plugin to your site will be an added advantage. Really Simple SSL plugin is the plugin which automatically detects your settings and configures your websites to run over https. To use this plugin you must have SSL certificate for your site. To use this plugin, follow these steps to activate the plugin in your site.
STEP 1: Take the backup of your site.
STEP 2: Install the SSL certificate
STEP 3: Download the plugin in WordPress
STEP 4: Go to ‘Plugins’ in the WordPress admin and click ‘Activate’
STEP 5: Log in again your site and the plugin will be activated.
STEP 6: Click on “Go ahead, activate SSL” for Http to Https redirect.
Using .htaccess file:
By using the .htaccess file, you can move the site from http to https in a simple way. It can be implemented by following these steps.
STEP 1: Log in your cPanel account
STEP 2: The .htaccess file must be located inside the site’s document root folder. If the website in present in a sub folder, place the .htaccess file inside the corresponding sub folder.
STEP 3: You can edit the .htaccess file by FTP(Check How to Create FTP Account in cPanel) or file manager in cPanel.
STEP 4: Just insert these three lines of code in the website’s .htaccess file.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
By adding these lines of code, it forces your site to https connection.
Using cPanel Force Redirection:
It is easy to make the change from http to https by following these simple steps
STEP 1: Login your cPanel account
STEP 2: Type ‘Domains’ in the search box. Then, click on Domains.
STEP 3: In the Domains interface in cPanel, there is an option to enable force redirection from the http to https with a toggle switch. Once you toggle on, your site will be turned on for forced http redirection.
Therefore, at first, your site will be seen as Eg: http://abc.com. After you enabled, your site will appear as https://abc.com