IIS URL重写模块根目录映射

IIS URL重写模块根目录映射,iis,url-rewrite-module,Iis,Url Rewrite Module,我正在IIS 8上使用URL重写模块 我希望能够将对*.archive的所有调用映射到使用以下代码工作的页面处理程序 <rule name="Redirect .archive extension" stopProcessing="true"> <match url="^(.*).archive" ignoreCase="true" /> <conditions logicalGrouping="MatchAny">

我正在IIS 8上使用URL重写模块

我希望能够将对*.archive的所有调用映射到使用以下代码工作的页面处理程序

<rule name="Redirect .archive extension" stopProcessing="true">
          <match url="^(.*).archive" ignoreCase="true" />
          <conditions logicalGrouping="MatchAny">
            <add input="{URL}" pattern="(.*).archive$" ignoreCase="false" />
          </conditions>          
          <action type="Rewrite" url="PageHandler.ashx?path={C:1}" />
        </rule>
有人举过我如何实现上述目标并遵守存档规则的例子吗

谢谢
标记可以使用以下重写规则:

 <rule name="Redirect .archive extension" stopProcessing="true">
      <match url="www.sample1.com/(.*)" ignoreCase="true" negate="true" />
      <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_URI}" pattern="(.*)" />
      </conditions>          
      <action type="Rewrite" url="page1.html?path={C:1}" appendQueryString="false" logRewrittenUrl="true" />
    </rule>
注: 根据您的要求修改主机名并重写url

问候,,
Jalpa

您可以尝试使用此规则注意:根据您的要求修改重写url。这非常有效,谢谢;只有一个问题,是否可以仅将其用于子目录?例如;呼叫将使用默认文档?是的,您可以这样做。我将修改解决方案并将其作为答案发布。请检查答案。
 <rule name="Redirect .archive extension" stopProcessing="true">
      <match url="www.sample1.com/(.*)" ignoreCase="true" negate="true" />
      <conditions logicalGrouping="MatchAll">
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                    <add input="{REQUEST_URI}" pattern="(.*)" />
      </conditions>          
      <action type="Rewrite" url="page1.html?path={C:1}" appendQueryString="false" logRewrittenUrl="true" />
    </rule>