Copied to clipboard

Flag this post as spam?

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


  • Jonas Eriksson 930 posts 1825 karma points
    Sep 10, 2012 @ 13:09
    Jonas Eriksson
    0

    Exposing api's, but only for 1 of the domains

    Hi

    I have a Umbraco installation hosting several domains www.aaa.com, www.bbb.com, www.ccc.com. And I like to have the aaa-site serv some data on a /api - path. Easy to do by reserving the path with umbracoReservedPaths.

    But, I like it to be hidden from the other sites. So if a user goes to www.bbb.com/api he/she should se an ordinary umbraco site page. And since umbracoReservedPaths is global I cannot see how I could use that one.

    Any ideas how to accomplish this? 

    Regards

    Jonas

  • Jonas Eriksson 930 posts 1825 karma points
    Sep 10, 2012 @ 13:31
    Jonas Eriksson
    0

    My solution - if I cannot find anything better - will probably be exposing /api/ and check the requested domain in my api, and only serve the resources for www.aaa.com , the others will get 404's

  • David Verberckmoes 46 posts 77 karma points
    Sep 10, 2012 @ 13:45
    David Verberckmoes
    0

    Hi Jonas,

    you can use UrlRewriting for the other domains (the bbb and ccc) and serve them a "page not found"

    Rgds,

    David

  • Jonas Eriksson 930 posts 1825 karma points
    Sep 10, 2012 @ 15:48
    Jonas Eriksson
    0

    Thanks David, UrlRewriter it is. I re-read the docs and experimented some, it's great to have in the tool belt, for all kinds of special routing needs in Umbraco. I'll get back here or perhaps in a blog post to write about my experiences with it.

  • 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