在 web.config 中插入 URL 重写规则后出现错误 404?

Error 404 after inserting URL rewrite rule in web.config?

我想将所有大写的 url 重定向到小写版本。例如:

https://www.droidafrica.net/Phone/Tecno-Spark-2-Go-Edition/
https://www.droidafrica.net/phone/tecno-spark-2-go-edition/

我把下面的代码放在web.config里了。它在应用更改后有效,但大多数设备规格的特色图像缩略图都出现错误 404。我是否遗漏了什么?

(虽然我暂时删除了代码)。

<rewrite>
        <rules>
            <rule name="LowerCaseRule" stopProcessing="true">
            <match url="[A-Z]" ignoreCase="false" />
            <action type="Redirect" url="{ToLower:{URL}}" />
            </rule>
        </rules>
    </rewrite>

仍然想知道为什么我收到错误 404。

这是无需添加更多条件即可为我工作的代码;仔细看,和第一个有点不一样。

<rewrite>
    <rules>
        <rule name="Convert to lower case" stopProcessing="true">  
        <match url=".*[A-Z].*" ignoreCase="false" />  
        <action type="Redirect" url="{ToLower:{R:0}}" redirectType="Permanent" />  
        </rule>  
    </rules>
</rewrite>

感谢RuslanY Blog