Copied to clipboard

Flag this post as spam?

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


  • Tom Bruce 122 posts 506 karma points
    Nov 15, 2017 @ 12:30
    Tom Bruce
    0

    Urlrewriting for Admin page

    Hi folks, I’m trying to add urlrewriting, but receiving an error message within the web config file

    The following fields attribute is not declared

    virtualUrl rewriteUrlParameter destinationUrl destinationUrl ignoreCase

     <rule name="adminrewrite" virtualUrl="^~/secret/" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/umbraco/umbraco.aspx" ignoreCase="true" />
    
  • David Peck 687 posts 1863 karma points c-trib
    Nov 15, 2017 @ 13:24
    David Peck
    1

    Are you using the Url Rewrite Module? I suggest that you do. Then you can edit this through IIS. I think you might be trying to add the old url rewrite config that was removed in recent versions of Umbraco.

  • Tom Bruce 122 posts 506 karma points
    Nov 15, 2017 @ 13:36
    Tom Bruce
    0

    Yes I'm using URL Rewrite 2.0

    I'm not sure how to write a rule that will prevent access to

    http://localhost:56973/umbraco

    But allow access to

    http://localhost:56973/secretpage which will be the admin page

  • David Peck 687 posts 1863 karma points c-trib
    Nov 15, 2017 @ 13:53
    David Peck
    100

    Something like this:

     <system.webServer>
        <rewrite>
           <rules>
              <rule name="NoUmbraco" stopProcessing="true">
                <match url="^umbraco" />
                <conditions>
                   <add input="{REQUEST_URI}" pattern="^/umbraco/api/" negate="true" />
                   <add input="{REQUEST_URI}" pattern="^/umbraco/surface/" negate="true" />
                   <!--Local machine-->
                   <add input="{REMOTE_ADDR}" pattern="^127\.0\.0\.1$" negate="true" />
               </conditions>
                <action type="AbortRequest" />
              </rule>
           </rules>
        </rewrite>
     </system.webServer>
    
  • Tom Bruce 122 posts 506 karma points
    Nov 15, 2017 @ 14:15
    Tom Bruce
    0

    Big thanks, I will try your code

Please Sign in or register to post replies

Write your reply to:

Draft