Take a look at this post by Hanselman. Although this post is about accepting typically invalid characters in the URL he also mentions how to configure the length of the path and the query string
While we're in here, note that in ASP.NET 4 you can also change allowed path and queryString lengths: