Copied to clipboard

Flag this post as spam?

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


  • Jacob Polden 67 posts 177 karma points
    Jul 24, 2014 @ 11:17
    Jacob Polden
    0

    Umbraco site in an IIS application media items need to point to home directory

    My current project is having a bit of an issue when implementing Umbraco inside an application within an IIS site.

    The site is structured as such:

    MyWebsite/ApplicationDirectory/ -- umbraco homepage

    MyWebsite/ApplicationDirectory/about-us -- umbraco content page

    MyWebsite/ApplicationDirectory/shop -- umbraco shop page

    ETC

    However on load of the actual site all my resources and links are broken. For static content like css and js it's really to fix: src="~/style.css" (adding the tilde). However my media items are showing the wrong urls.

    Media URLs are coming as /media/etc, which means there full URL on the page as

    MyWebsite/media/etc

    rather than

    MyWebsite/ApplicationDirectory/media/etc

    What I need is a way for media items to go to the home directory vs the root of the site. What is the best way to achieve this?

  • Jacob Polden 67 posts 177 karma points
    Jul 24, 2014 @ 11:50
    Jacob Polden
    0

    I have found a fix, but it's not very elegant.

    <img src="@[email protected]" alt="@image.Name" />
    

    Is there a more elegant solution?

    EDIT

    This only works on home, d'oh!

Please Sign in or register to post replies

Write your reply to:

Draft