Activate an SSL
Posted 04th октомври, 2018
Having an SSL certificate installed on a website is very important for a variety of reasons, from security to SEO. For a better internet, we should all be encouraging the use of SSL on all websites.
More about SSLs in general elsewhere in the knowledge base.
To enable SSL on your Wordpress site:
- Log into your wp-admin panel
- Navigate to Settings >> General
- Update your Wordpress Address and Site Address by replacing http with https.
- Log into your file system on your hosting account. Using your favorite text editor open the .htaccess file and add the following redirection:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This redirect users to your https:// website.
To force HTTPS login on the admin area:
If you wish to force the HTTPS protocol on log in , you can add the following line to your wp-config.php file after your SSL has been installed:
define('FORCE_SSL_ADMIN', true);
Mixed content errors
After installing your SSL certificate your browser could show a "mixed content" warning for every element of your site that still loads over HTTP.
To fix the issue you could follow these steps:
Ensure your database is backed up.
Use a text editor (such as sublime or notepad++) and replace all occurrences for http://yoursite/ to https://yoursite/ in a second copy of your database, for better results you could use a search and replace script instead.
Replace your current database , by dropping all tables of it from phpMyAdmin and uploading your modified version from Import>>Choose File>> Go