Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
IIS URL重写-规则捕获,尽管文件存在_Iis_Url Rewriting - Fatal编程技术网

IIS URL重写-规则捕获,尽管文件存在

IIS URL重写-规则捕获,尽管文件存在,iis,url-rewriting,Iis,Url Rewriting,我有一个重写URL的规则,除非物理文件存在(所以可以返回静态文件)——但是由于某种原因,这些规则还是被重写了,这让我非常沮丧 这是我的Web.config: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <clear />

我有一个重写URL的规则,除非物理文件存在(所以可以返回静态文件)——但是由于某种原因,这些规则还是被重写了,这让我非常沮丧

这是我的Web.config:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<system.webServer>

    <rewrite>
        <rules>
            <clear />
            <rule name="Front Page">
                <match url="/?" />
                <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
                <action type="Rewrite" url="/Home/FrontPage" />
            </rule>
            <rule name="Map Everything" stopProcessing="true">
                <match url="^(.*)$" ignoreCase="true" />
                <conditions>
                    <add input="{REQUEST_FILENAME}" matchType="IsFile"      negate="true" />
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                </conditions>
                <action type="Rewrite" url="EntryPoint.php/{R:1}" appendQueryString="true" />
            </rule>

        </rules>
    </rewrite>

</system.webServer>

啊,原来问题出在“首页”规则上,而“/”规则与我本应使用“^$”的所有内容都匹配

在解决这个问题之后,IsFile/IsDirectory规则得到了遵守