1

So I havent been able to track down a article of how you change the name of my images coming out of my media library. The mynewsite is the site running my node server calling my prod-cd content. Example: https://prod-us.sitecoretree.com/-/media/images/project/common/logos/2019-logo.ashx and I need them to resolve but I want my URL to be https://www.mynewsite.com/-/media/images/project/common/logos/2019-logo.ashx or I guess I could just have it set as /-/media/images/project/common/logos/2019-logo.ashx Almost like a virtual directory type of setup.

2

This would be basically the same as using a CDN. There is a config file for this in App_Config/Include/Examples/CDN.config.example Basically, the settings you are looking for are:

  • Media.AlwaysIncludeServerUrl: Ensures that all media links will always include the full server URL
  • Media.MediaLinkServerUrl: Specifies what the server URL (including the scheme and hostname) should be for all media links

The rest of the settings in CDN.Config.example are probably not necessary for your use case, but may be necessary. They are documented in that config.

Note: Make sure you always use built-in methods for retrieving media URLs, or else you won't be leveraging this functionality, and all bets will be off at that point.

1
  • Yeah I have tried this and its a great option and worked. Was able to change the URL name however the images didnt render because of the proxy I believe. I was trying to see if it would just remove the starting part and just have this -/media/images/project/common/logos/2019-logo.ashx but that didnt work. Only the server url makes it show. – user1566783 May 13 at 3:06

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.