Everyday we manage several websites of our customers by our WordPress maintenance service. We have seen a lot several our customers already have SSL certificate in their website. But they have not activated that cause they don’t know how to.
So you are sure that you have SSL installed on your hosting account by default or you have bought new one. Now its time to redirect all your traffic from http:// to https://. So your visitors see secure or lock sign on their browser address bar.
Why do i see Not Secure on browser address bar?
You see on browser address bar Not secure when your site is loading on http:// protocol. Which is simply hyper text transfer protocol. While https:// is hyper transfer protocol secure. So when your site loads on https:// the browser will show lock icon or secure label in browser address bar.
Benefits to load website on https:// or SSL
Biggest benefit is peace of mind for your visitors. That Not secure label on browser address bar do not bring new questions in their mind. So when visitors are on your website they see secure sign which makes them easy and comfortable.
Other than peace of mind the second benefit is Search engines like google also gives some priority to https:// URL’s. Note: this is not necessary but as i said very little.
WordPress Default load to https://
If you have not done this please go to wp-admin >> Settings >> general and change Site URL and Home url with https:// if that’s without s. This will force your WordPress to work only under https:// protocol.
How to redirect HTTP to HTTPS via .htaccess file
In Apache linux you can give specific instructions to your server. So to communicate or instruct server you can write .htaccess file with commands which i will suggest below.
Before going forward you should know how to edit your .htaccess file.
Create .htaccess file if does not exists and upload to main root folder like public_html. If exists edit your .htaccess with cPanel file manager or via FTP.
1. Redirect All Web Traffic
If you have existing code in your .htaccess, add the following code just after closing or any other code exists there before:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
2. Redirect Only a Specific Domain
For redirecting a specific domain to use HTTPS, add the following. You can also skip adding www. if you don’t want to use www.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
3. Redirect Only a Specific Folder
Redirecting to HTTPS in a particular folder, add the following. Make sure that you are keeping the .htaccess also in that folder for which you are writing following .htaccess commands.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]
Note for domain name: Replace “yourdomain” with your actual domain name wherever required.
Note for folder name: In case of the folder, replace /folder with the real folder name.
Note for WordPress Websites: If you are writing in .htaccess commands with www. or without www. make sure you keep URL’s in wp-admin >> Settings >> General Site url and home URL without or with www.
Google Analytics and Search Console Settings
After updating the protocol of your website make sure you update URL in services like Google analytics and Google Search console. Cause google takes http:// and https:// as different websites.
- If you are facing ERR_SSL_PROTOCOL_ERROR
- Looking to move to https:// from http://
- Force HTTP redirects to HTTPS – cPanel
No Success?
Please don’t waste your time around internet. Just contact your web hosting provider. There are some hosting companies which disable the .htaccess commands. That can be the reason your changes are not taking any effect. Web hosting companies also don’t charge for this type of support.