Issue with URL length in IIS7 (Windows Server 2008)

六眼飞鱼酱① 提交于 2019-12-25 12:54:13

问题


i have an issue with url lengths in iis7. If you go to:

http://www.somesite.com/myaccount/login.htm?ReturnUrl=aa2Fmyaccounta2FdefaultaaspxadnoaauserSuppliedIdentifierahttpa3Aa2Fa2Faaaaaaamaapenidacoma2Fadnoaareturnatoasigahandleaa7B633942228855348748a7Da7BaRINLQa3Da3Da7DadnoaareturnatoasigaxSa2FFPGusD7UvskGqfkJq4QtEYjc4fSVFoa2F3sXNwCBteGOBJ8mipo7yLsuSk2hEgLogbzn6SthYb0wY3pBQM1OQa3Da3Daopenidaassocahandleaa7BHMACaSHA256a7Da7B4b051c2ba7Da7ddufPa2BAa3Da3Da7Daopenidaclaimedaidahttpa3Aa2Fa2Faaaaaaaaaopbnidacoma2Faopenidaidentityahttpa3Aa2Fa2Faaaaaaaabcpenidacoma2Faopenidamodeaidaresaopenidansahttpa3Aa2Fa2Fspec

The page will load fine but if you add one more character to the end it will throw an error. This might seem abit picky to you but it's stopping me from using open id on my login form since it returns a long url. One option i did consider was changing the requestFiltering, therefore in my web.config i have the following:

<system.webServer>
    <security>
        <requestFiltering>
            <requestLimits maxQueryString="999999999" maxUrl="999999999" />
        </requestFiltering>
    </security>
</system.webServer>

But this did not resolve the issue. I'd appreciate it if someone could help. Thanks


回答1:


This is a limitation of Windows and there is currently no workaround

See this StackOverflow article for more information:

ASP.NET url MAX_PATH limit




回答2:


nfplee - Are you using Ionics Isapi Rewrite Filter (IIRF) by any chance? I just ran into the same issue where long urls always returns a 404.

If I disable IIRF everything works fine.




回答3:


You may do something in web.config as follows.

<system.web>
  <httpRuntime maxUrlLength="4000"/>
</system.web>


来源:https://stackoverflow.com/questions/1762387/issue-with-url-length-in-iis7-windows-server-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!