All Collections
Technical Questions
Images not loading on your website
Images not loading on your website

After migrating your site or changing the Box's domain, images or other resources may not load properly.

Torben Simon Meier avatar
Written by Torben Simon Meier
Updated over a week ago

When media and resources do not load properly after a migration or after your Box has gone live, it's often because they're being loaded via the wrong URL.

This error can occur, for example, if you use absolute instead of relative links:

  • Absolute links: Absolute links always point to exactly one domain and one of its subdirectories. For example, to https://raidboxes.io/blog.

  • Relative links: These always refer to only one subdirectory, e.g. /blog, regardless of which domain this directory is located on. If the domain of a page changes, the relative link can be loaded without any issues. Absolute links, on the other hand, can lead to problems.

To understand the problem properly, you have to analyze your page with the browser console.

  • Open the page with the missing resources in a browser, e.g. Chrome.

  • Right click on the page and select the option Inspect.

  • The developer console will open and show you all the failed loading attempts.

  • All errors are clearly displayed in the Console area.

Correct faulty or absolute links

If the absolute or faulty links come from a plugin or your theme, you can either change the faulty links directly in extension code (or have them changed), or you can contact the respective developer of the plugin or theme directly.

If the absolute or broken links come from media files, you can easily change them to relative links by following the three steps below.



Step 1: Install the plugin Better Search Replace

Log in to your WordPress dashboard, open the plugin management, click on Install and search for the plugin Better Search Replace. Install and activate the plugin.

Step 2: Replace absolute links with relative links

Now you can directly replace the absolute or faulty links that cause loading problems. Open the plugin menu under Tools → Better Search Replace. Now you have to execute a separate Search and Replace command for each of the following domain variants:

Replace each of these domain variants with a"/".

If you execute this command for all four variants, all absolute links will be replaced by relative links. Your site will then know exactly where the media are stored and will load them again properly after the site cache has been cleared.

Step 3: Empty the cache

You can empty your cache either directly in the WordPress dashboard or via the Raidboxes dashboard in the Box overview of your site.

If the resources load correctly again after clearing the cache, remember to uninstall the plugin.

Did this answer your question?