Copied to clipboard

Flag this post as spam?

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

  • Kazeko 1 post 71 karma points
    Sep 11, 2017 @ 15:27

    Media Item from single Top Level Domain on Umbraco multisite

    I have Umbraco 7 running a multi language site which looks like this:


    • NL
    • DE
    • EN
    • FR

    All language nodes have a Top Level Domain attributed to them. So the NL one can be accessed from, DE is etc... Media files are on an azure blob storage and are shared by all language nodes.

    This is all working well, but then I run into trouble with duplicate media items.

    My client wants all media served up from a single TLD for SEO purposes, but I can't get Umbraco to do that.

    The media paths in Umbraco are relative though, so media-item-1 is accessible from as well as

    How can I get media-item-1 to only be accessible through the .nl TLD?

    Any help would be greatly appriciated, I've been banging my head against this for a week now :-(

  • Chriztian Steinmeier 2705 posts 8115 karma points MVP 3x admin c-trib
    Sep 11, 2017 @ 21:20
    Chriztian Steinmeier

    Hi Kazeko,

    How about adding a rewrite for all media that forces the .nl TLD?

    E.g., something like this:

    <rule name="Rewrite for media" stopProcessing="true">
        <match url="^/media/(.*)$" />
            <add input="{HTTP_HOST}" pattern="\.nl$" negate="true" />
        <action type="Rewrite" url="{R:1}" redirectType="Permanent" />

    (Start with Found instead of Permanent for easier testing - when you're sure it works, change it back...)

    Hope that helps,


  • Chriztian Steinmeier 2705 posts 8115 karma points MVP 3x admin c-trib
    Sep 11, 2017 @ 21:27
    Chriztian Steinmeier

    Another option would be to always add the hostname when rendering media items, so instead of something like this:

    <img src="@Model.Content.PageImage" />

    You'd prepend the hostname:

    <img src="" />

    - might actually be the easiest solution :)


Please Sign in or register to post replies

Write your reply to: