Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Martin Rud 261 posts 1022 karma points c-trib
    Aug 14, 2022 @ 15:44
    Martin Rud
    0

    How to make Umbraco render absolute urls to media?

    Hi,

    I am using Umbraco as a headless CMS and therefore need image src“s, links to files and so on to be absolute. How do I turn that on?

    Have tried to set it to "Absolute" in appSettings,json with both:

    Umbraco.UmbracoCmsCoreModelsPublishedContentUrlMode
    

    and

    Umbraco.CMS.UmbracoCmsCoreModelsPublishedContentUrlMode
    
  • Marc Goodson 2157 posts 14435 karma points MVP 10x c-trib
    Aug 15, 2022 @ 07:32
    Marc Goodson
    100

    Hi Martin

    I think it's a setting inside Umbraco - CMS - WebRouting - UrlProviderMode

    https://our.umbraco.com/documentation/Reference/Configuration/WebRoutingSettings/

    By default it's set to 'Auto'

    https://github.com/umbraco/Umbraco-CMS/blob/e626fca2432582f052cb13654eedd9e60ef8723f/src/Umbraco.Core/Models/PublishedContent/UrlMode.cs

    So if you configure this to be Absolute, by default... in your appSettings.json file

    "Umbraco": {
      "CMS": {
        "WebRouting": {
          "UrlProviderMode": "Absolute"
        }
      }
    }
    

    I think that's what you need!

    regards Marc

  • Martin Rud 261 posts 1022 karma points c-trib
    Aug 15, 2022 @ 10:23
    Martin Rud
    0

    Thanks - that works! :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies