.htaccess web.config URL重写未重写

.htaccess web.config URL重写未重写,.htaccess,mod-rewrite,web-config,.htaccess,Mod Rewrite,Web Config,最近我在web.config中的一条重写规则出现了问题。它给了我一个500的错误,但它在过去是有效的。然而,我最近不得不将它从.htaccess改为web.config,所以我觉得这可能是问题的一部分,但它过去甚至在更改后仍能工作,所以我不知道问题出在哪里 web.config当前被视为刚刚导入的规则(现在导入后默认),内容如下: <?xml version="1.0" encoding="UTF-8"?> <configuration> <syst

最近我在web.config中的一条重写规则出现了问题。它给了我一个500的错误,但它在过去是有效的。然而,我最近不得不将它从.htaccess改为web.config,所以我觉得这可能是问题的一部分,但它过去甚至在更改后仍能工作,所以我不知道问题出在哪里

web.config当前被视为刚刚导入的规则(现在导入后默认),内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1" enabled="false" stopProcessing="true">
                    <match url="^images/([a-zA-Z0-9_-]+\.)(jpg|png|gif)$" ignoreCase="false" />
                    <action type="Rewrite" url="images/old/{R:1}{R:2}" />
                </rule>
                <rule name="Imported Rule 2" enabled="false" stopProcessing="true">
                    <match url="^images/thumbs/([a-zA-Z0-9_-]+\.)(jpg|png|gif)$" ignoreCase="false" />
                    <action type="Rewrite" url="images/old/{R:1}th.{R:2}" />
                </rule>
                <rule name="Imported Rule 3" enabled="false" stopProcessing="true">
                    <match url="^api$" ignoreCase="false" />
                    <action type="Rewrite" url="api.php" />
                </rule>
                <rule name="Imported Rule 4" enabled="false" stopProcessing="true">
                    <match url="^images/(\w*\.)(jpg|png|gif)$" ignoreCase="false" />
                    <action type="Rewrite" url="images/old/{R:1}{R:2}" />
                </rule>
                <rule name="Imported Rule 5" enabled="false" stopProcessing="true">
                    <match url="^images/thumbs/(\w*\.)(jpg|png|gif)$" ignoreCase="false" />
                    <action type="Rewrite" url="images/old/{R:1}th.{R:2}" />
                </rule>
                <rule name="Imported Rule 6" enabled="false" stopProcessing="true">
                    <match url="." ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
                        <add input="{URL}" pattern="\.([a-z]{1,4})$" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

我不是web.config的高手,所以如果你知道导入后它可能无法工作的原因,你能帮忙吗?非常感谢