IIS URL重写以访问子文件夹内容

IIS URL重写以访问子文件夹内容,iis,web-config,Iis,Web Config,是否可以创建URL重写,将子文件夹的内容放在根目录中 例子: /第/Article 1页可从/Article 1访问 /页面/otherstuff将从/otherstuff访问 我不想使用虚拟目录,因为我们谈论的是/pages文件夹中的数百个静态页面。我自己找到了答案。。。这就成功了: <rule name="RemoveSEOFolder" stopProcessing="true"> <match url="^seo$|^seo/(.*)$" /> &

是否可以创建URL重写,将子文件夹的内容放在根目录中

例子: /第/Article 1页可从/Article 1访问

/页面/otherstuff将从/otherstuff访问


我不想使用虚拟目录,因为我们谈论的是/pages文件夹中的数百个静态页面。

我自己找到了答案。。。这就成功了:

<rule name="RemoveSEOFolder" stopProcessing="true">
    <match url="^seo$|^seo/(.*)$" />
    <conditions>
    </conditions>
    <action type="Redirect" url="seo/{R:1}" />
</rule>
<rule name="RewriteToFile">
    <match url="^(?!seo/)(.*)" />
    <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    </conditions>
    <action type="Rewrite" url="seo/{R:1}" />
</rule>