On our XM Cloud site built using Nextjs the URL for media items is structured as follows: https://edge.sitecorecloud.io/prod/media/project/videos/video1 and it currently works correctly. However, my goal is to serve the media assets from the site URL like https://xyz.com/prod/media/project/videos/video1.

I attempted URL rewriting to achieve this, but when I tested the modified URL https://xyz.com/prod/media/project/images/image1 it resulted in a 404 error.

Note: we've managed to accomplish the configuration for images using Next/Image through the following code:

import Image from 'next/image'

Any suggestions on how to approach the media URL configuration to meet my requirement and serve the media assets from the site domain?

  • What values do you have you set for the "Target hostname" and "Hostname" fields in "sitecore/content/<site collection>/<site>/Settings/Site Grouping/<site>"? Nov 28, 2023 at 14:23


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.