iisurl-routingiis-8

How do I configure the maximum subdirectory depth in IIS?


I'm running an ASP.NET service on IIS8 and I'm running into an error I wasn't expecting. When fed a URL like example.com/144/299/322/400/511/622/733/844/977/101/119/127/130/144/153/162/172/183/195/207/210/221/235/242/255/261/274/287/296/304/314/326 (32 levels deep) it is perfectly happy.

example.com/144/299/322/400/511/622/733/844/977/101/119/127/130/144/153/162/172/183/195/207/210/221/235/242/255/261/274/287/296/304/314/326/335 (33 levels deep) gets me an IIS error. I can remove the final slash and add more characters, so it's not a URL length limitation.

The IIS error information is not terribly useful:

And all my Googling has led me to believe that no one else has ever run into this limit, which seems strange and unlikely so I'm guessing that I am using entirely incorrect terminology.


Solution

  • The default Maximum Url Segments limit in IIS 8 is defined as 32. Anything longer will return an error.

    The link below will assist you in finding and updating this setting for whatever is appropriate for your site.

    IIS 8.0 What's New - Website Settings