Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WordPress] Images don't load in my site after activating the SSL certificate #1155

Closed
NassosRossi opened this issue Sep 15, 2023 · 4 comments
Assignees
Labels
solved tech-issues The user has a technical issue about an application triage Triage is needed wordpress

Comments

@NassosRossi
Copy link

Platform

Azure

bndiagnostic ID know more about bndiagnostic ID

7e4dbbb5-31ad-dd5b-974d-e5a9ee403f04

bndiagnostic output

? Connectivity: Found possible issues ✓ Resources: No issues found ✓ Apache: No issues found ✓ Mariadb: No issues found ✓ Wordpress: No issues found ✓ Processes: No issues found ✓ Php: No issues found

bndiagnostic was not useful. Could you please tell us why?

There isn;t any problem with connectivity

Describe your issue as much as you can

After i activated the ssl certificate the images don't load on my site. Instead of using the domain name to load the images it uses the ip address.

I commented out the following lines in wp-config.php

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

and i replace them with:

define('WP_SITEURL', 'https://DOMAIN/');
define('WP_HOME', 'https://DOMAIN/');

where DOMAIN is my domain name but still nothing changed.

@NassosRossi NassosRossi added the tech-issues The user has a technical issue about an application label Sep 15, 2023
@github-actions github-actions bot added the triage Triage is needed label Sep 15, 2023
@jotamartos
Copy link
Collaborator

Hi @NassosRossi,

If you inspect the source code of your website, you can find some http links and that's why images are not shown. We suggest you use this plugin to update those links in the WordPress' database

https://wordpress.org/plugins/better-search-replace/

Or contact the WordPress' support team to get more information about how to update them.

Thanks

@NassosRossi
Copy link
Author

NassosRossi commented Sep 18, 2023

Hi @jotamartos

I checked the assets that don't load and they are https links.
The problem is that it tries to load them as:

https://<ip-adress>/wp-content/uploads/...

Instead of

https://<domain-name>/wp-content/uploads/...

@jotamartos
Copy link
Collaborator

jotamartos commented Sep 19, 2023

In that case, and AFAIK, you can use the same plugin to update the IP-address references in the database to use your domain so the certificate is valid for that asset/image and they are loaded properly.

@NassosRossi
Copy link
Author

Thank you @jotamartos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved tech-issues The user has a technical issue about an application triage Triage is needed wordpress
Projects
None yet
Development

No branches or pull requests

2 participants