Media Library when using dedicated administration domain

2025/02/27 11:58 AM

We have a client website that was using domain.co.uk as the web channel URL, and domain.co.uk/admin for the admin URL.

We are now changing this to follow best practises by using a dedicated sub-domain, which would now be admin.domain.co.uk/admin.

The admin site is working fine, pages in the content tree load fine, etc. However, there are issues with images in the Media Library on the admin site. The image preview and URLs are being generated using the new sub-domain, which breaks them as they're not available through it.

E.g. https://admin.domain.co.uk/getmedia/83b7c56c-f783-4e37-b895-aec4faaab0fe/book-grey.jpg

Is there a recommended approach to fixing this? Am I missing a setting to control this, or do we need to add a redirect/rewrite for forwarding requests to the channel URL?

Answers

2025/02/27 9:49 PM
Answer

I think a short term workaround would be to use a rewrite from the admin path to the presentation web channel path.

Then later migrate the media library to the Content Hub folder - as this work perfectly with the admin on the sub-domain.

2025/03/05 5:38 PM

Yes, this is a limitation of media libraries. When embedding an asset content item (or links to one) into rich text fields, the value stored will look like this. Notice the relative path and /admin/api prefix.

/admin/api/getContentAsset/<content item GUID>/<asset field GUID>/my-image.png?language=en-US

However, the rendered URL will look like this, where the domain will change based on the channel it's rendered in.

https://your-domain.com/getContentAsset/<content item GUID>/<asset field GUID>/my-image.png?language=en-US

Another reason to use content item assets instead of the media library 🙂.

To answer this question, you have to login first.