1

I've just changed my local development environment from using .local domains to .localhost (no more DNS trouble on MacOS, yay!).
So I set Crafts siteUrl to .localhost, and while Craft serves pages that link correctly, my images still point to the old URLs. How's that and what to do now?

Images are mostly served like this:

<picture class="site-logo">
  <source
    srcset="{{ branding.logo.first().url('small') }}"
    media="(min-width: 100px)"
  >
  <img src="{{ branding.logo.first().url('large') }}" alt="{{ siteName }}">
</picture>
1

Good lord, this is embarrassing. For some reason I had a static URL in the asset source configuration.

EDIT: To provide at least a little value to others finding this: If you configure your asset sources, make sure the not use full URLs in the URL field.
So, instead of https://example.com/images/ use /images.

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.