Hello, this is Rob coven. Here, I'm going to show you how to get the green padlock in Chrome or other web browsers. Once you have an SSL certificate for your website to make sure that you have the SSL certificate, you can go to this site, www dot SSL shopper.com and put your website address in there and check the SSL. And here you'll see all those green checkmarks. And that means that my site has indeed got an SSL certificate installed there but the job isn't over. We don't have the green padlock on the site on the Chrome browser.
When this is the case go to this site. Why no padlock comm enter in the site domain name, and they'll give you all sorts of reasons why the site doesn't have the padlock. But before we look into that, we can just put a line of code in the h a t access Make sure the site resolves to HTTPS. So we'll go into file manager for the sites and then look for a file that's called public HTML or it might be called HTTP Doc's. And what you're looking for are files such as these the familiar WordPress files, the WP hyphen, folders, three of them admin content and includes as well as the WP hyphen PHP files, but we're looking for the.ht access. There it is.
If you can't see it, then go to settings and see if show hidden files dot files is checked. Because I'm talking about viewing your files in File Manager on cPanel. You may be using another method to view your files but it'll all be the same sort of thing. So we're gonna click on ht access and editors. And then you need to Google SSL HTTPS redirects course you have a WordPress plugin that does this, I'm going to try and do it by hand, have a look at this article by in motion hosting quite ironic that they actually don't have the padlock on their site, I'm sure that's a temporary thing that they'll fix very soon. So you want to copy these lines.
If you can't find them, I'll put them in the description of this video, it'll sell you here that you need to put this at the top of the ht access. And also, of course, you change the example.com to your actual domain name. So let's do that. So we're in the ht access editing mode. Now, the window we just opened and we're going to paste those lines in. And I'm going to get rid of the www and the domain name and type in the domain name of this sites.
Check up spell check Write and save changes. Now that unfortunately is not going to give us the green padlock new. And if we test this URL again, unfortunately, it doesn't make any difference either. But you still need to do that you still need to put those lines in the ht access. Another thing you can do is make sure there are no instances where you've referred to your website in the WordPress posts and pages as HTTP and not HTTPS. And the way you can do that is to find and replace the HTTP to HTTPS in the whole website, and how do you do that?
Well, there are a number of ways a lot of people are recommending a plugin better search and replace is one that's recommended. However, I've always had problems with plugins doing search and replaces On my SQL databases, I find them very buggy. And therefore I prefer to do this on the database. And this is a little bit scary, but here we are in cPanel. And regardless of whether you have cPanel or not, you will have PHP myadmin. And because this is scary, we're going to go export, go and export the database.
So if we make a horrendous mistake, we can rectify it by backing up to this database that we're now downloading. And once that's downloaded, we want to go to the WP posts table in the database, and then we're going to go to SQL and run a command. And I found this command by just googling Find and Replace in WordPress on my SQL database. I found this article how to find replace text with one click in your WordPress database at WP beginner calm and First they recommend plugins but then if you scroll down, they'll show you how to do this Find and Replace in the WP posts table in your database. So we'll go to that. And we want to find the text, HTTP and the name of the sites and replace it with the same address with the s in it.
Okay, so we'll click go, and it says 338 rows affected. So if you find that you've clicked around, and not all of the pages are resolving to the HTTPS, and you're not getting the green padlock on some of them. Then you can try that Find and Replace throughout the whole of your WordPress pages and posts. Now what we do have here is a nasty Red Cross Mark, showing us where there are insecure URLs. There's one here, which is a link to an image. And it hasn't resolved to the HTTP s link there.
And I know that the reason for that is it's because it's in a text widget. So I can edit that in WordPress. These two, they tell us where they find it, they find it in the themes style folder, so we can edit that stuff folder as well. So we just want to edit these three, and then hopefully we'll get that green padlock. So let's give that a go. Okay, so I'm in the backend of the site.
And we're going to go appearance widgets, because that's where there is a line that is not HTTP s, send the primary sidebar, and it's in that text widgets. And there we are. There's a link there which is HTTP need to change that to HTTPS, and another one there to the actual image. This is the one that's mentioned in the why no padlock site. And then we can save that text widgets. So if we go back to this site test URL again, we'll hopefully only have two problems instead of three.
There we go. Only two of them. So the other one is in the themes folder. So we can see it's in WP content themes. gt, and it's the style dot CSS. So we go to the File Manager, and go WP content, themes.
Gt. And there's the style. We'll open that in the code editor. And there it is, and we know it's for the fonts, the Google fonts. So we'll search for the word finance and there it is. The offending article.
It's interesting. That I entered these lines not very long ago, only a couple of years ago. And I would have got that URL from Google and Google in search of these funds on a secure server at that time. And here we are a few years later, and Google is now insisting that everyone else do what they didn't do recently. So that's a little bit ironic, as well. But anyway, we'll save those changes.
We'll go back to the why no padlock site and test URL again. And well look at those four green checkmarks. Now let's go back to the site's Bingo. There we are your nice green padlock. Any page, just since that green padlock there, everyone is going to have to do this at some stage, make sure that they get that green padlock. My name is Rob Cohen.
I'll see you in the next video.