To secure your website from http to https protocol, you need ssl certificate for your domain name. There are two ways to get ssl certificate.
- Use free ssl certificate provided by “Let’s encrypt”. Bigrock hosting automatically configures these certificates for your website and auto renews them using autoSSL facility.
- Buy ssl certificate from paid providers like Comodo SSL.
After installing SSL certificate on your website, you need to make changes to your wordpress blog to make SSL work without any problems.
Editing of WP-Config File
Add following line in wp-config.php file in root of wordpress installation.
1 |
define(‘FORCE_SSL_ADMIN’, true); |
Copy paste this line before following line in wp-config.php:
1 |
/* That’s all, stop editing! Happy blogging. */ |
Change WordPress and Site URL
Go to dashboard and change wordpress URL and site URL in Settings –> General page.
Changing all URLs inside wordpress database
Next you need to change all URL’s pointing to http version of your website to https. Best way to do this is using Velvet Blues wordpress plugin. Take backup of your website before using this plugin. Be very carefull while entering old and new urls. You need to go to Tools->Update URLs in wordpress dashboard.
Updating .htaccess file in website root
Next you need to redirect all http://www.yourdomain.com to https://www.yourdomain.com using an instruction in .htaccess file of your website. You can edit this file by downloading this file using ftp program like filezilla and editing it and uploading it back to site root.
1 2 3 4 5 |
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </IfModule> |