我的web.config中有两个规则,规则名称InboundRule正在运行,并重定向到正确的PDF文件。但是带有尾随页码的第二条规则不是,看起来他们俩都达到了InboundRule并且没有添加页码来打开PDF文件
是否可以匹配页码并将文件打开到正确的页面?
<rule name="InboundRule" enabled="true" stopProcessing="true">
<match url="cars\/model\/(\w+)\/index.html" />
<conditions trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="cars\/\/(\w+)\/index.html" negate="true"/>
</conditions>
<action type="Redirect" url="/cars/model/content/PDF/{R:1}.pdf" logRewrittenUrl="true"/>
</rule>
<rule name="InboundRuleTrailingPageNumber" enabled="true" stopProcessing="true">
<match url="cars\/model\/(\w+)\/index.html(\w+)" />
<conditions trackAllCaptures="false">
<add input="{REQUEST_URI}" pattern="cars\/model\/(\w+)\/index.html(\w+)" negate="true"/>
</conditions>
<action type="Redirect" url="/cars/model/content/PDF/{R:1}.pdf#page={R:2}" logRewrittenUrl="true"/>
</rule>
更新后的规则仍然不起作用,唯一起作用的规则是汽车LandingPage。
<!--Cars LandingPage-->
<rule name="PatientGLInboundRule" enabled="true" stopProcessing="true">
<match url="cars\/model\/(.*)\/index.html" />
<conditions trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="cars\/model\/(.*)\/index.html" negate="true"/>
</conditions>
<action type="Redirect" url="/cars/model/content/PDF/{R:1}-File.pdf" logRewrittenUrl="true"/>
</rule>
<!--Cars LandingPage -->
<!--Cars Page Number within URL -->
<rule name="CarsInboundRulePageNumberInURL" enabled="true" stopProcessing="true">
<match url="cars\/model\/(.*)\/(.*)\/index.html" />
<conditions trackAllCaptures="false">
<add input="{HTTP_HOST}" pattern="cars\/model\/(.*)\/(.*)\/index.html" negate="true"/>
</conditions>
<action type="Redirect" url="/cars/model/content/PDF/{R:1}-File.pdf#page={R:2}" logRewrittenUrl="true"/>
</rule>
<!--Cars Page Number within URL -->
<!--Cars Trailing Page Number -->
<rule name="CarsInboundRuleTrailingPageNumber" enabled="true" stopProcessing="true">
<match url="cars\/model\/(.*)\/index.html#(.*)" />
<conditions trackAllCaptures="false">
<add input="{REQUEST_URI}" pattern="cars\/model\/(.*)\/index.html(.*)" negate="true"/>
</conditions>
<action type="Redirect" url="/cars/model/content/PDF/{R:1}-File.pdf#page={R:2}" logRewrittenUrl="true"/>
</rule>
<!--Cars Trailing Page Number -->