Copied to clipboard

Flag this post as spam?

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


  • Chris Norwood 91 posts 493 karma points
    May 10, 2019 @ 10:09
    Chris Norwood
    0

    Standard Redirects for a master server?

    Hi all,

    We have a website hosted on Azure app services, which is using scale-out. The backend is on a separate app service as per the recommendations for flexible load balancing:

    https://our.umbraco.com/documentation/getting-started/setup/server-setup/load-balancing/flexible

    I am trying to implement 302 redirects so that users are redirected if they try to go to e.g:

    www.frontendsite.com/umbraco

    And are forced to the backend server instead for editing. I'm testing in our development environment, and trying to ensure that it doesn't interfere with e.g. surface controllers etc.

    So I was wondering if anybody had a standard redirect to use in the web.config? This is what I have at the moment, which seems to cover most cases, I'm just worried there might be something I've missed (like a package/plugin URL)....

    <!--Redirects to force editing to a single backoffice-->
    <rewrite>
      <rules>
        <rule name="Editing" stopProcessing="true" >
          <match url="(.*)" ignoreCase="true" />
          <conditions>
            <add input="{URL}" pattern="/umbraco(.*)" />
            <add input="{HTTP_HOST}" pattern="editing-site.azurewebsites.net" negate="true" />
            <add input="{URL}" pattern="/umbraco/surface(.*)" negate="true" />
            <add input="{URL}" pattern="/umbraco/rendermvc(.*)" negate="true" />
            <add input="{URL}" pattern="/umbraco/api(.*)" negate="true" />
            <add input="{URL}" pattern="/umbraco/backoffice/api(.*)" negate="true" />
          </conditions>
          <action type="Redirect" url="https://editng-site.azurewebsites.net/Umbraco" redirectType="Found"/>
        </rule>
      </rules>
    </rewrite>
    

    Any help gratefully received, as always! (I've read the MS article on Redirect rules and the "10 useful redirects" article, it just seems like this should be a standard thing as it must be quite common)?

  • Jeavon Leopold 3005 posts 13194 karma points MVP 7x admin c-trib
    May 10, 2019 @ 10:24
    Jeavon Leopold
    100

    Looks good to me!

    You can compare with what I use (for v7):

    <rewrite>
      <rules>
        <!-- Restrict access to Umbraco -->
        <rule name="Restrict access" stopProcessing="true">
          <match url="umbraco$|umbraco/(?!surface\/)(?!api\/)(?!webservices\/)" />
          <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{HTTP_HOST}" pattern="(([^.]+)\.)?MYWEBSITE-UMBRACO\.azurewebsites\.net" negate="true" />
            <add input="{HTTP_HOST}" pattern="(([^.]+)\.)?localhost" negate="true" />
          </conditions>
          <action type="Redirect" url="https://MYWEBSITE-UMBRACO.azurewebsites.net/umbraco/" appendQueryString="false" />
        </rule>
      </rules>
    </rewrite>
    
  • Chris Norwood 91 posts 493 karma points
    May 10, 2019 @ 10:26
    Chris Norwood
    0

    Thanks Jeavon - it turned out (about 2 minutes after I'd posted mine) that I'd broken Forms as it wasn't negating /UmbracoForms/ so I'll give yours a go!

    H5YR!

Please Sign in or register to post replies

Write your reply to:

Draft