Copied to clipboard

Flag this post as spam?

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


  • Ajay Karwal 31 posts 149 karma points
    Feb 01, 2016 @ 11:37
    Ajay Karwal
    0

    Best practice for static files outside of Umbraco

    I'm currently in the processes of giving my portfolio site an update and i'm considering moving it over to Umbraco (currently all static HTML pages)

    I'd like to know what are the best ways to create static content outside of Umbraco. For example.

    I would have Umbraco content along the lines of:

    /about
    /portfolio
    /portfolio/project-name
    /content
    

    etc...

    But I would also need to allow urls such as

    /demo/demo-name
    /project-name
    

    These would be mini sandboxed websites which have their own HTML, CSS and JS and would be in no way connected to the Umbraco CMS. They will be uploaded directly via FTP.

    I know that I can use umbracoReservedUrls and umbracoReservedPaths to allow access to certain paths but I want to avoid having to edit the web.config file every time I need to add a new folder.

    Any suggestions would be great.

  • Lars-Erik Aabech 349 posts 1100 karma points MVP 8x c-trib
    Feb 01, 2016 @ 11:48
    Lars-Erik Aabech
    0

    Put the folders for static content under one top folder you reference in umbracoReservedPaths?

    For instance:

    /pub/demo/demo-name
    /pub/project-name
    

    I like to use the /Content folder since most "newer" ASP.NET stuff seem to favor it. (IE. nuget packages)

    You could however try to mess around with the HTTP handler and HTTP module order under system.webServer in web.config. If you move the static file handler above Umbraco you should be able to prioritize static content above Umbraco logic. Haven't done this myself though, so no guarantee for it to work or not create a mess for Umbraco. :)

    Lars-Erik

  • Ajay Karwal 31 posts 149 karma points
    Feb 01, 2016 @ 11:52
    Ajay Karwal
    0

    I like to use the /Content folder since most "newer" ASP.NET stuff seem to favor it. (IE. nuget packages)

    Could you expand on what you mean by 'favor it' ?

  • Lars-Erik Aabech 349 posts 1100 karma points MVP 8x c-trib
    Feb 01, 2016 @ 11:55
    Lars-Erik Aabech
    0

    If you use nuget to manage your dependencies on jquery, bootstrap etc. all of them put the static content in the /Content root folder.

    I always use nuget, so not sure about other cases.

Please Sign in or register to post replies

Write your reply to:

Draft