Copied to clipboard

Flag this post as spam?

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


  • Andy McCall 1 post 71 karma points
    Aug 30, 2016 @ 10:45
    Andy McCall
    0

    Outbound URL Rewrite Rule Causes Admin Site Problems

    Hi All,

    I have an Umbraco site that I also need to revese proxy a WordPress blog in. I am using the following rules using IIS URL Rewrite:

    Inbound Rule:

    <rule name="WordPress Blog Inbound Rule" enabled="true" stopProcessing="true">
            <match url="^blog/(.*)" />
            <action type="Rewrite" url="http://www.bloglocation.co.uk/blog/{R:1}" logRewrittenUrl="false" />
               <serverVariables>
                            <set name="HTTP_ACCEPT_ENCODING" value="" />
            </serverVariables>
        </rule>
    

    Outbound Rule:

    <outboundRules> 
                <rule name="WordPress Blog Outbound Rule" preCondition="ResponseIsHtml" enabled="true" stopProcessing="false">
                      <match filterByTags="A, Area, Base, Form, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://www.bloglocation.co.uk/blog/(.*)" />
                      <action type="Rewrite" value="https://www.mainsite.co.uk/blog/{R:2}" />
                        <conditions>
                            <add input="{URL}" pattern="^/blog/.*" />
                        </conditions>
                </rule> 
                <preConditions> 
                      <preCondition name="ResponseIsHtml"> 
                            <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" /> 
                      </preCondition> 
                </preConditions> 
          </outboundRules>
    

    I have included the path in the Umbraco reserved paths:

    <add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/Development,~/styles,~/scripts,~/fonts,~/blog" />
    

    The reverse proxy works however when in place there are intermittent issues with the admin interface within Umbraco, for example the content collections are blank. The errors on the console are along the lines of:

    GET DependencyHandler.axds=[cut] :16 https://www.mainsite.co.uk/umbraco/views/propertyeditors/changepassword/changepassword./html 500 (URL Rewrite Module Error)
    

    And:

    DependencyHandler.axd?s=[cut]…:16 GET https://www.mainsite.co.uk/app_plugins/archetype/views/archetype.default.html 500 (URL Rewrite Module Error.)(anonymous function) @ DependencyHandler.axd?
    

    I've isolated the problem to being when the outbound rule in in place, but I am at a loss as to how I can fix this...

    Can anyone tell me why/what the error is, and does anyone have any suggestions to fix it?

    Thanks,

    A!

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Aug 30, 2016 @ 11:32
    Sebastiaan Janssen
    0

    I think the best way to remedy this is to not apply the rewrite for the ~/umbraco and ~/App_Plugins path:

    <add input="{REQUEST_URI}" negate="true" pattern="^/umbraco" />
    <add input="{REQUEST_URI}" negate="true" pattern="^/App_Plugins" />
    

    There may be other negates that you have to add in, but this should give you a start.

Please Sign in or register to post replies

Write your reply to:

Draft