-->

IIS URL rewrite in child virtual directory not red

2019-06-18 02:24发布

问题:

I have Asp.NET Application installed on 'default web site\orchard'... accessible at http://localhost/orchard, and I want to use URL Rewrite. I added rules:

<rewrite>
    <rewriteMaps>
        <rewriteMap name="Blogger">
            <add key="/aaa" value="/tags/tag1" />
        </rewriteMap>
    </rewriteMaps>
    <rules>
        <clear />
        <rule name="Rewrite rule1 for Blogger" stopProcessing="true">
        <match url=".*" />
            <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                <add input="{Blogger:{REQUEST_URI}}" pattern="(.*)" />
            </conditions>
            <action type="Redirect" url="{C:1}" appendQueryString="false" redirectType="Permanent" />
        </rule>
    </rules>
</rewrite>

But when I go to http://localhost/orchard/aaa then error 404 is returned instead of redirecting to http://localhost/orchard/tags/tag1.

When I put my web application in the root folder of website redirection works. http://localhost/aaa is redirected to http://localhost/tags/tag1.

What I'm doing wrong?

Thanks for help.