*Some* Images serving from IP address instead of domain (elementor site)

[ad_1]

I'm having a real tough time solving this one.

My two latest websites are experiencing issues where some of the images get served from the ip address instead of the domains.

Sure, just use better search and replace and update all instances of the ip address in the database to the domain. That solves it for a day or two, and then it goes back to serving from the ip address again.

This is the same host (amazon lightsail bitnami) that I've used for piles of sites in the past without ever having this issue come up.

One thing is that when I am logged in, it always serves from the domain, I have to be in incognito to get this actually happening…

I've tried reuploading the images in question, with shorter filenames, but nothing seems to work here.

If I goto elementor->tools and regenerate files and css that also seems to fix it up…

I'm not sure what keeps breaking this though and reverting everything back to the ip address – ANY ideas are greatly appreciated.

This previous post sounds exactly like what I'm dealing with but there isn't a real solution posted.

https://www.reddit.com/r/Wordpress/comments/moj5l5/images_not_loading_img_src_tag_pointing_to_ip/

[ad_2]
1 Comment
  1. See if this helps – in wp-config.php, change:

    `define(‘WP_SITEURL’, ‘https://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);`
    `define(‘WP_HOME’, ‘https://’ . $_SERVER[‘HTTP_HOST’] . ‘/’);`

    to your site domain, eg:

    `define(‘WP_SITEURL’, ‘https://example.com/’);`
    `define(‘WP_HOME’, ‘`[`https://example.com/`](https://example.com/)`’);`

    Then re-run BSR using: //[the IP address]/ > [//example.com/](//example.com/) (select all tables, untick Dry Run). Also rebuild the Elementor cache.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer