CDN settings and absolute URLs

Currently configuring a CDN and some of our images are not showing. It looks like any element that has an absolute URL is not being rewritten correctly. Example:

img src=“https://mydomain.com/storage/.../image.jpg

is being rewritten as:

img src=“https://mydomain.comhttps://mycdn.com/storage/…/image.jpg”

I’ve tried playing around with the cdn filter settings, but can’t get it working. Any suggestions?
Litium version: 6.3.7

What is the setting you are using? Easier to be able to reproduce with the same settings.

We fixed this ourselves by changing the way we are writing image urls.
Thanks!

Anything you can share if someone else have the same problem?

Sure!
We have a ProductService that serves information about products, including the image url. Because one of the recipients of the service data is an API, we have to deliver absolute urls. As a result, we were manually injecting the domain name to the urls we were retrieving from the product.
In order to ensure this works with the urls that are returned by the cdn, we no longer do this. To ensure that the system still works if we choose to disable the CDN, we now only prepend the domain name to the image urls if the url returned does not already have a domain name.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.