Copied to clipboard

Flag this post as spam?

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


  • Mac McDell 73 posts 148 karma points
    Jun 24, 2016 @ 16:57
    Mac McDell
    0

    Rewrite /Umbraco admin path MVC/Angular

    I need to change the admin panel url from www.site.com/umbraco/ to www.site.com/mysecretpath/

    tried the following:

     <add key="umbracoReservedPaths" value="~/umbraco,~/mysecretpath,~/install/" />
     <add key="umbracoPath" value="~/umbraco" />
    

    UrlRewriting.config

    <add  name="adminrewrite"
             virtualUrl="^/mysecretpath"
                rewriteUrlParameter="ExcludeFromClientQueryString"
             destinationUrl="/umbraco"
             ignoreCase="true" />
    

    This works except that www.site.com/umbraco still works. Tried adding a rule below but that ended up blocking the admin panel....

     <add stopProcessing="true" name="adminrewrite"
             virtualUrl="^/mysecretpath"
                rewriteUrlParameter="ExcludeFromClientQueryString"
             destinationUrl="/umbraco"
             ignoreCase="true" />
    
        <add name="blockUmbraco"
          virtualUrl="^/umbraco"
            redirect="Application" 
                rewriteUrlParameter="ExcludeFromClientQueryString"
             destinationUrl="/"
             ignoreCase="true" />
    

    Any advice on resolving this? The related forum posts are all mostly pre angular. Note: I don't think we want to change our Umbraco folder as we are using Umbraco as a service and they maintain our updates. I also can't lock down via IP as we have people accessing from dynamic addresses.

    Mac

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jun 24, 2016 @ 18:24
    Dennis Aaen
    0

    Hi Mac

    Using a rewrite rule is the base way, based on this http://tcmorris.net/blog/custom-domain-for-umbraco article this rule should work,

    <rewrite>
            <rules>
                <!-- Restrict access to Umbraco -->
                <rule name="Restrict access" stopProcessing="true">
                    <match url="umbraco(?!/Surface/)(?!/Api/)(?!/api/)(?!/webservices/)" />
                    <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
                        <add input="{HTTP_HOST}" pattern="(([^.]+)\.)?admin.example\.com" negate="true" />
                    </conditions>
                    <action type="Redirect" url="/not-found/" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    

    Hope this helps,

    /Dennis

  • Mac McDell 73 posts 148 karma points
    Jun 24, 2016 @ 19:40
    Mac McDell
    0

    This looks like you are using IIS UrlRewriter and not the UrlRewriting.config file. I will give this a shot. Thanks for the link Dennis.

    Hi. This would work for domain lockdown if you were limiting traffic to the admin.example.com website but I was actually asking about rewriting traffic to a custom value. This doesn't really solve my problem as I don't want to limit via IP or manage user access that way.

    I got this far with it but couldn't resolve the users error that pop on the tasks for displaying the tree. It was close.

    <rule name="Restrict access" stopProcessing="true">
        <match url="65467846843/(.*)?" />
        <conditions logicalGrouping="MatchAny" trackAllCaptures="false">
          <add input="{UNENCODED_URL}" pattern="65467846843(.*)" />
        </conditions>
        <action type="Rewrite" url="/umbraco{C:1}" appendQueryString="true" />
      </rule>
    

    I see that we can lock out accounts after a certain number of access attempts and that should suffice for now. Thanks for the suggestion regardless. We might go to it at some point.

Please Sign in or register to post replies

Write your reply to:

Draft