我正在使用URL Rewriter.NET(与 URL Rewriting.NET 相比,我非常喜欢它 - 看起来更通用,不要误会我的意思,我喜欢 URL Rewriting.NET,但它似乎没有鉴于我对该工具的了解,以满足需求)。我正在尝试使用default-documents节点重新定义站点的默认文档。我尝试将其添加到重写器节点,但出现 web.config 错误
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The element 'default-documents' is not allowed.
Source Error:
Line 187:
Line 188: <rewriter>
Line 189: <default-documents>
Line 190: <document>default.aspx</document>
Line 191: <document>index.aspx</document>
过去有没有人使用过这个工具,有没有人知道把这个节点放在哪里(或正确使用)?
编辑:
我尝试了下面的建议,但它似乎并不完全正确。这是我的额外配置文件中的内容(这是配置文件中的唯一内容)
<rewriter>
<rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js)(\?.+)?)$" to="$1" processing="stop" />
<default-documents>
<document>default.aspx</document>
<document>index.aspx</document>
</default-documents>
</rewriter>