0

I have activated SSL certification on my new Wordpress website. But it is not showing that green lock in the browser. I installed Really Simple SSL plugin, but still nothing changed. I also tried to manually put this code inside the .htaccess file in the root:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.url.com/$1 [R,L]

but even this didn't change anything. I still see "mix content warning" and the green lock is still not being showed. I want to manually change all the addresses but I don't know which files exactly should i work on? for example, where can i find my website's images to change their addresses from http to https? all the needed files, not only images.

I will appreciate if you share your experience with me to finally show that green lock for my website.

I activated my SSL two days ago, btw.

mrtnmgs
  • 1,402
  • 14
  • 26
Joseph
  • 1
  • 3
  • Hi Joseph, If you want to change the url of your site, then you can change the url in **admin** section (Dashboard) Under General settings.. – Yogesh Garg Aug 25 '18 at 04:29
  • If you are using static url for CSS, JS or images then you need to change the url manually in code to remove the "mix content warning". – Yogesh Garg Aug 25 '18 at 04:30
  • 1. Clear cache 2. Take a look at this: https://stackoverflow.com/questions/4398951/force-ssl-https-using-htaccess-and-mod-rewrite – Mario Mlinaric Aug 25 '18 at 12:42

1 Answers1

0

* Back up your database and files before doing any of this! *

You need to check 3 places and change the values if necessary:

  1. Your site URL in WordPress settings
    You can update this value under Settings > General in WordPress admin (yoursite.com/wp-admin/options-general.php)
    This corresponds to 2 entries in the database. If you are familiar with the command-line, you can change them using wp-cli:
    wp option update siteurl https://yoursite.com wp option update home https://yoursite.com

This is the value WorPress uses to create your site's links (to a page, a post, an image etc.). But there might also be hard-coded http links in your database or in your theme, so:

  1. Links in the WordPress database
    The easiest way is to export your database, find and replace the links and re-import it. There are also plugins that can do this for you, but if again, wp-cli makes this super easy:
    wp db export mydb.sql
    Open the file with your favorite editor, search for all occurrences of http and replace with https where appropriate.
    wp db import mydb.sql

  2. Hardcoded links in your WordPress theme
    I use ack-grep for things like that. The following command searches for all occurrences of a pattern in the current directory, recursively (= it also searches in subdirectories):
    ack -l "http:"
    Then open each file with a text editor and change http links with https ones.

mrtnmgs
  • 1,402
  • 14
  • 26