如何解决如何在 web.config 中为子文件夹编写规则?
我有 3 个网页,其中 2 个在像这样的顶部的子文件夹中。
mydomain.com/index.html
mydomain.com/appen/index.html
mydomain.com/admin/index.html
我需要一个规则来加载 mydomain.com/appen/
和 mydomain.com/appen
(没有最后一个 /)
对于 mydomain.com/admin/
如果您使用任何其他网址,它应该加载带有子文件夹的 mydomain.com
,例如 mydomain.com/products/
应该加载 mydomain.com/index.html
With the below rules I can use:
`mydomain.com/appen/` this loads the correct page
but not without the last /
`mydomain.com/appen` this is not loading the page,it loading the top index page `mydomain.com/index.html` instead.
And if I try
`mydomain.com/admin/` I get an error,so I have to use the full url `mydomain.com/admin/index.html` for that page to load
<rule name="appen/" stopProcessing="true">
<match url="^appen/$" />
<action type="None" />
</rule>
<rule name="app" stopProcessing="true">
<match url="^appen$" />
<action type="None" />
</rule>
<rule name="admin/" stopProcessing="true">
<match url="^admin/$" />
<action type="None" />
</rule>
<rule name="adm" stopProcessing="true">
<match url="^admin$" />
<action type="None" />
</rule>
<rule name="redirect all requests" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" pattern="" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.asp" appendQueryString="true" />
</rule>
那么我该如何重写上面的规则,以便我可以加载所有页面。
非常感谢任何输入,谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。