Previous Next

Thread: trouble rewriting a root directory without a slash

Last post 10-06-2008 11:27 PM by DanielVL. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-06-2008, 8:34 PM

    • rberk
    • Not Ranked
    • Joined on 10-07-2008, 12:09 AM
    • Posts 1

    trouble rewriting a root directory without a slash

    I want to write a simple rule that says if someone requests "http://localhost/test" or "http://localhost/test/" then execute "http://localhost/test/service.svc/".

    The following rule handles "http://localhost/test/" fine, but not "http://localhost/test".

    <rule name="service root" enabled="true" stopProcessing="true">
        <match url="^/?$" />
        <action type="Rewrite" url="service.svc/" appendQueryString="false" />
    </rule>

    The failed request tracing shows:

    URL_REWRITE_START RequestURL="/test", Scope="Distributed" 00:01:46.297
    RULE_EVALUATION_START RuleName="service root", RequestURL="", QueryString="", PatternSyntax="ECMAScript", StopProcessing="true", RelativePath="/test/" 00:01:46.297
    RULE_EVALUATION_END RuleName="service root", RequestURL="test", QueryString="", StopProcessing="true", Succeeded="false" 00:01:46.297
    URL_REWRITE_END RequestURL="" 00:01:46.297

    Given our hosting configuration and deployment constraints, I need this rule to exist in the web.config of the "test" directory.

    Ideas anyone?

    Thanks.

  • 10-06-2008, 11:27 PM In reply to

    • DanielVL
    • Top 50 Contributor
    • Joined on 10-07-2006, 2:00 PM
    • Redmond, WA, USA
    • Posts 73

    Re: trouble rewriting a root directory without a slash

    Hi,

    This scenario is broken, we are expecting always the trailing slash in the root directory. Please send me a message if you need a fix for this. Sorry about this inconvenience.

    Thank you.

    Daniel Vasquez Lopez
    IIS Team
    Tags:
Page 1 of 1 (2 items)
Page view counter