Multisite has SSL certificate, but media library is still http://

Our multisite WordPress installation has a URL of https://xx.com for the main domain, and - for example, https://yy.xx.com as a subsite. We're using WP's in-built domain mapping feature.

Media library links are still showing up as http://xx though, so any images used on the subdomains are flagged up as insecure. Only one subdomain - our most recent one - has media library links with a structure https://zz.xx.com. It's possible that the SSL certificate was installed after the other subdomains were created, but before ZZ was: I'm not sure.

How can I get WP media library links all showing up as https:// - and preferably with the subdomain in the URLs?

Ideally I'd like to do it without a plugin if possible. Thanks!

Topic subdomains domain-mapping domain media ssl Wordpress

Category Web


You didn't mention if you have an htaccess that is redirecting http links to https. Have you tried this:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Place it before your WP lines in the htaccess file.

Although you can use, as suggested, a search/replace plugin (I like "Better Search and Replace" to go through the entire WP database and search for http://www.example.com and replace it with https://www.example.com .


Replace all links before the installation of the SSL (you can update the links via SQL)

Your wordpress should throw out https:// links now after the installation of the SSL certificate. This problem is due to wordpress decision to insert full links when inserting media through the editor.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.