After seeing "How to install an HTTPS Connection (SSL) certificate for a hosted website on an NGINX server without cPanel or VestaCP"In the article by here, let's see now what we need to do to make the website or blog valid HTTPS.
For a WordPress website or blog at the bottom, it is not enough to install the SSL certificate as it appears in the "address bar". Even if the SSL certificate has been installed correctly and is valid, you may have noticed that when you access an HTPPS page, the "barcode" does not appear in the address bar, sign that the page is safe.
If your blog or website does not appear to have a secure connection (Connection is Not Secure) even if I installed the SSL certificate correctly, means that the page has remained "http" local links. These may be direct links to media files (pictures, videos, songs) or to structural elements (java, CSS).
We take the example iHowTo.Tips, which although it has one SSL certificate installed correctly and valid, we have a page where Firefox warns us that we do not have a secure connection.
We also say they are part of the page, such as images, which are not secure. This means that somewhere in the content of the article or the sidebar elements, we had an image file whose source link starts with "http" instead of "https".
To change the source of an image from "http" to "https" it would be simple to edit that article. If we talk about a website with hundreds or thousands of articles, the thing is changing. Editing each article in part would be an operation that would take a very long time. The easiest way for WordPress users is to change their local links database. Passing links from "http" to "https" can be done through a simple SQL command executed from phpMyAdmin or from the command line SQL via Terminal.
How to change the links from "HTTP" to "HTTPS" for a WordPress blog or website via SQL
If still mentioned above iHowTo.Tips, let's take it as an example and further on. Let's say we have to replace that blog, all the links of the "http://ihowto.tips"In"https://ihowto.tips". These links can be sources of images (src) and other links to internal pages.
Before you get started, we recommend
1. Born we authenticate to the database of the blog through phpMyAdmin. User and password we find them in the file wp-config.php from the domain root.
2. We make Click the database name on the leftThen click on SQL in the top horizontal menu.
3. We execute in SQL the command line:
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http: //ihowto.tips','https: //ihowto.tips');
Replace your web address and domain name and keep in mind if you use www or not. If you use the "www" prefix, you must add it.
4. Click "Go" to execute the command line.
The command line shown above will only change the URLs in the "wp_posts" table, the "post_content" column. You can change this SQL command line to replace the URL in all database tables.
Careful! There are WordPress themes (WP Themes) that once changed the domain URL will reset their custom settings. Look for a back up to these.