简体   繁体   English

IIS 7中的请求URL无效

[英]The request URL is invalid in IIS 7

here is my URL 这是我的网址

http://abc.domain.com/controller/action/A74444C3A7FA858C7995CA9954CBCF1E26604634767C5575396D908E8415CF8CCC04C05F49FED0AA9D9743B69ABF232BDE9787A5222D081DA638896C0D2379A673E1747A2FFE1158F14AF098B2899D2ABEB4EA738D89369627E479796B6B2B9EA9B247CC59EF10E3A88B6A56A87F0818E2AD2A942FFA31F1C941BB7AF6FDC55FE6733353F28DFAC1827688604CBFBAB4856E6C75F810D13923F9D913F51F5B02980163E6CD63BC04610AD2C12E07360D7BC2C69F1B0CD03E http://abc.domain.com/controller/action/A74444C3A7FA858C7995CA9954CBCF1E26604634767C5575396D908E8415CF8CCC04C05F49FED0AA9D9743B69ABF232BDE9787A5222D081DA638896C0D2379A673E1747A2FFE1158F14AF098B2899D2ABEB4EA738D89369627E479796B6B2B9EA9B247CC59EF10E3A88B6A56A87F0818E2AD2A942FFA31F1C941BB7AF6FDC55FE6733353F28DFAC1827688604CBFBAB4856E6C75F810D13923F9D913F51F5B02980163E6CD63BC04610AD2C12E07360D7BC2C69F1B0CD03E

There are no invalid characters in the URL itself as everything is encrypted. URL本身没有无效字符,因为所有内容都已加密。 Still I am getting 我还是得到了

Bad Request - Invalid URL HTTP Error 400. The request URL is invalid. 错误请求 - 无效的URL HTTP错误400.请求URL无效。

I know the URL is awfully long and I was able to resolve that issue in my Cassini by adding this httpRuntime maxUrlLength="512" 我知道URL非常长,我能够通过添加此httpRuntime maxUrlLength =“512”来解决我的Cassini中的问题

in the web.config 在web.config中

However in IIS7 even after playing around with the requestfiltering maxurl and maxquerystring values I have not been able to resolve this. 但是在IIS7中,即使在使用requestfiltering maxurl和maxquerystring值之后,我还是无法解决这个问题。

This is an asp.net mvc 3 application. 这是一个asp.net mvc 3应用程序。

This one is for posterity and for tracking my own problem. 这个是为后代和跟踪我自己的问题。 It's been said in another answer however, not as explicitly. 然而,在另一个答案中已经说过,而不是明确地说。

I've had the same problem on my end. 我最终遇到了同样的问题。 The answer is of course to transfer the long URL segment to a Query string. 答案当然是将长URL段转移到Query字符串。 Easier to handle. 更容易处理。

The problem however is that HTTP.sys is not even letting the request through because a segment of the URL is exceeding 260 or so characters. 然而问题是HTTP.sys甚至没有让请求通过,因为URL的一段超过260个字符。 However, we still had to support it. 但是,我们仍然必须支持它。

You can change that setting in the registry. 您可以在注册表中更改该设置。 Once you reboot, the url will work. 重新启动后,网址将会正常运行。

Registry: 注册地:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters]
"UrlSegmentMaxLength"=dword:00000400

This will effectively set the segment length to 1024. 这将有效地将段长度设置为1024。

Source 资源

Your problem is you're not using a query string, but a path. 您的问题是您没有使用查询字符串,而是使用路径。 A path has a maximum length of 255. 路径的最大长度为255。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM