You can access questions with tags by link construction:

http://stackoverflow.com/questions/tagged/[tag1] or [tag2] or [tag3]

But when I combine a lot of tags I get an error 400 (invalid URL). In my case the URL length was 755 characters.

But when I use the link

http://stackoverflow.com/feeds/tag?tagnames=[tag1] or [tag2] or [tag3]&sort=newest

then the page is loaded, even though I used the same big set of tags (and this time we have 768 characters).

When I pass the link to my RSS reader (with %20 instead of a space)

http://stackoverflow.com/feeds/tag?tagnames=[tag1]%20or%20[tag2]%20or%20[tag3]

all data was properly loaded with no errors (908 characters this time).

Is there some bug/limitation to the length of the first link construction (http://stackoverflow.com/questions/tagged/%5Btags%5D) that does not apply to second method (http://stackoverflow.com/feeds/tag?tagnames=%5Btags%5D)?

share|improve this question
    
It's very likely that the URL mapper (which redirects you to the second format "under the hood") has a max limit somehow. Either it has a fail-safe that is enabled above a certain URL length (for performance reasons or whatnot), or the regular expression engine simply doesn't match more than a certain number of characters, resulting in a failed match. –  Blixt Nov 6 '09 at 14:28
add comment

1 Answer

up vote 2 down vote accepted

URLs of the form

http://example.com/tagged/foo+bar+baz

have a "path length limit" of about ~260 characters

URLs of the form

http://example.com/?tags=foo+bar+baz

do not.

edit: we can now change this, as we've switched to .NET 4.0 which supports the HttpRuntimeSection.MaxUrlLength property -- for now I am relaxing it to 512 characters, from the default of 260.

see related SO question about general practical length of URLs at:
http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-an-url

share|improve this answer
    
Re-he-he-heally! I wonder what is so special about 260 chars. I mean, shouldn't it be 255 chars? MAX_PATH in windows is also 260 chars. I wonder if this is different on linux-based systems. –  bobobobo Apr 29 '10 at 0:39
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .