0

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!

  • It is most likely due to wordpress inserting the whole hard-link including the domain and http(s)://. This is a usual problem for websites that are developed locally including http and only get switched to https when they go live. – marvinpoo Dec 13 '18 at 10:54
0

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.

0

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 .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.