Copied to clipboard

Flag this post as spam?

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


  • David Peck 690 posts 1896 karma points c-trib
    Feb 23, 2017 @ 15:09
    David Peck
    0

    Removing /Umbraco from routes

    Hi all,

    I'm aware of a way to enter link description herecreate custom routes in Umbraco such that a url like: /umbraco/surface/MyCustom[Controller]/My[Action] Could also be available via /some-random-path/MyCustom[Controller]/My[Action]

    However if I then do: @Url.Action("MyCustom", "My") I could end up with either of the URLs above spat out

    What I'd like to do is prevent surface and api controllers ever having Umbraco in their URL because I don't want to leak the information to a hacker that I'm using Umbraco. Additionally I want to put an IP restriction on the umbraco path without worrying about blocking API and Surface requests.

    SurfaceControllers (and I suspect API Controllers) get routes added to the RouteTable automatically, but I suppose I could go through and manually replace all of these. It's a bit of a pain though. Is there no setting that controls the path used by these routes?

    Cheers!

  • David Peck 690 posts 1896 karma points c-trib
    Feb 23, 2017 @ 15:22
    David Peck
    100

    Probably answering my own question here, but perhaps someone has a workaround, it looks like this is not possible without manually going through and replacing the routes. https://github.com/umbraco/Umbraco-CMS/blob/5397f2c53acbdeb0805e1fe39fda938f571d295a/src/Umbraco.Web/WebBootManager.cs (line 356)

    Looks like /umbraco/surface is hardcoded, or at least you could change the word umbraco using the umbracoPath appsetting but that doesn't help my IP blocking situation.

  • Jay Criscione 16 posts 105 karma points
    Feb 23, 2017 @ 17:18
    Jay Criscione
    0

    I have added HttpHandlers in the web.config to alter the location that custom Umbraco controllers are accessible.

  • 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