There are no objective reasons to not use an encrypted Internet connection whenever it is possible. In general, the benefits of HTTPS can be summarized as follows:
HTTPS protects the integrity of your website. HTTPS protects the privacy and security of your users. HTTPS is the future of the web.
In this article we'll show you how to enable your WordPress site to use HTTPS.
For our example we installed SSL certificate using Let's Encrypt service as a part of cPanel.
Note: The process of generating these certificates creates the .well-known/acme-challenge/ folder in the site root folder. It is safe to remove the folder if you want, however when the certificate is renewed every 90 days the folder will be re-created.
Yet after activating the service status to Operational our test site continued to work in HTTP.
First step after installing and activating SSL certificate for your domain is to login administration, click on Settings > General and change the protocol in both URL containing fields from http to https as it is shown on the screenshot:
Save the Changes.
Next step is to open
wp-config.php file and add this line of code:
just above the commented line: That's all, stop editing! Happy blogging.
Save the file, refresh the browser – your connection with WordPress administration is now encrypted as well as the login URL.
Note: Different browsers design this information in different ways. This screenshot is taken on Mozilla Firefox.
Click on Settings > Permalinks to ensure all URLs are using https protocol:
But ... if you click on your visit site link, the home page is still not encrypted and the green padlock is missing.
You can look for many 'smart' ways to force HTTPS on the front end – some offers additional code in
wp-config.php, others –
.htaccess hacks, the plugin lovers as always have a plugin to offer...
Do not waste your time.
Open phpMyAdmin and export SQL database archive.
Replace the http URL with https URL, save the file, delete MySQL tables and import the edited SQL archive.
Warning: Replace the full URL and not http only because you are going to end up with several httpss results that will trigger an error.
If you have need help on performing the above Find/Replace operation please read our article How to Backup MySQL Database using phpMyAdmin
If your hosting plan contains SSH:
# mysqldump -u db_username -p db_name > backup.sql Enter password: # sed -i 's/https:\/\/hostpulse.tld/http:\/\/hostpulse.tld/g' backup.sql # mysql -u db_username -p db_name < backup.sql Enter password: #
Refresh the home page – congratulations, you've got HTTPS!
Click on menu links, pages, posts, titles, images, comments, archives, search results – HTTPS should work flawlessly.
#wordpress #https #ssl