#39;+#39; symbol problem in URL in IIS 7.x(IIS 7.x 中 URL 中的“+符号问题)
问题描述
我们在查询字符串中发送一个 HTML 编码字符串.它在 IIS 6(Windows 2003)上运行良好.我们最近将网站移至 Windows 2008 (IIS 7.x).由于移动任何包含+"号的查询字符串,即%2b"在服务器上给出错误404 - 找不到文件或目录."
We are sending an HTML encoded string in the Query string. It was working fine on IIS 6 (windows 2003). We have recently moved the website to Windows 2008 (IIS 7.x). Since the move any Query String that contains "+" sign i.e., "%2b" gives error on the server "404 - File or directory not found."
有什么帮助吗?
最好的问候.
推荐答案
您遇到此错误的原因是 IIS7 出于安全原因引入了新的 URL 过滤规则.因此,作为 URL 中安全原因的一部分,默认情况下会阻止+"号.
The reason why you are facing this error is that IIS7 has introduced new URL filtering rules for security reasons. So '+' sign is blocked by default as part of security reason in URL.
要解决此问题,您必须在 web.config 文件中设置 allowDoubleEscaping="true".这是执行此操作的标签.
To resolve this issue you have to set allowDoubleEscaping="true" in web.config files. Here is the tag to do that.
<system.webServer>
<security>
<requestFiltering allowDoubleEscaping="true">
</requestFiltering>
</security>
这篇关于IIS 7.x 中 URL 中的“+"符号问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IIS 7.x 中 URL 中的“+"符号问题


- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- C# 中多线程网络服务器的模式 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01