Copied to clipboard

Flag this post as spam?

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


  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 09, 2016 @ 02:58
    Nguyen Dung Tri
    0

    How to get url of back-end and front-end from Umbraco Site?

    Hello,

    Is there a way to get back-end and front-end url of Umbraco Site? Example:

    I have an Umbraco back-end url:

    http://localhost:62195/umbraco/
    

    I have an Umbraco front-end url:

       http://localhost:62195/
    

    So how can I use C# or javascript to get the default url of Back-end and Front-end of Umbraco Site when it run on other host like:

    http://newdomain.com, http://newhost.com
    
  • Kasem Vaewsugnoen 3 posts 73 karma points
    Aug 09, 2016 @ 03:36
    Kasem Vaewsugnoen
    0

    Just put /umbraco in your domain for backend eg. http://newdomain/umbraco

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Aug 09, 2016 @ 09:53
    Sebastiaan Janssen
    101

    You mean something like this?

    var url = document.location.href;
    var arr = url.split("/");
    var newUrl = arr[0] + "//" + arr[2] + "/umbraco/";
    alert(newUrl);
    

    Test it at: https://jsfiddle.net/ywg93aor/

    It takes the address in the browser, removes everything after the third / (because: http:// already has 2 times a / in it) and adds /umbraco/ at the end.

  • 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