Accessing Application Relative URI in Rewrite MapsRSS

1 reply

Last post Apr 06, 2009 11:57 AM by lonevvolf

  • Accessing Application Relative URI in Rewrite Maps

    Apr 06, 2009 11:52 AM|lonevvolf|LINK

    I have noticed that the URL being sent to the rewrite maps is the complete URI, regardless of where the application is running.  In other words, if my application is set up at A, the URL:

    http://localhost/A/B/C

    will send the string:

    "/A/B/C" to the rewrite map, even though I would ideally like to match on an application-relative URI, for portability between production and development.  I would like to send "/B/C" to the map.  Is there a way to do this?

  • Re: Accessing Application Relative URI in Rewrite Maps

    Apr 06, 2009 11:57 AM|lonevvolf|LINK

    Just answered my own question.  I just changed the match rule to look like this:

    <rule name="Rewrite Map" stopProcessing="false">

    <match url="^(.*)" />

    <conditions>

    <add input="{SearchMachineMap:{R:1}}" pattern="(.+)" />

    </conditions>

    <action type="Rewrite" url="{C:1}" appendQueryString="false" />

    </rule>