The Boston Diaries

The ongoing saga of a programmer who doesn't live in Boston, nor does he even like Boston, but yet named his weblog/journal “The Boston Diaries.”

Go figure.

Sunday, February 16, 2003

Query Redirects in HTTP, or rather, the lack of documentation thereof

Over the past few days, Mark and I have been going back and forth about implementation details in Seminole. It started out with a question about encoding URLs—when do you convert a space to %20 and when do you covert it to + (answer: you can always use %20 but you can only convert a space to a + in the query portion of a URL) but eventually got around to a point not covered in RFC-2616.

I like your idea of storing the query separate in the HttpdRequest object. It's a good idea, and I think may fix a problem where we do redirects and forget to tack on the query string. For example:

Redirecting http://server/some/directory?stuff

Probably doesn't work now.

Email from Mark

Only thing is, RFC-2616 doesn't cover this situation. Sure, it covers what to do when redirecting a POST (and even goes into mind-numbing detail about when and when not to convert a POST to a GET when redirecting, and how that interacts with proxy and caching servers) but not what to do when redirecting a GET with a query.

I did some tests with Apache, and from what I can see, if Apache generates the redirect (for example, to it passes along the query string ( is redirected to but if the redirect comes from the Redirect directive (for example, to, then the query portion of the URL is dropped entirely ( is redirected to—note the missing query string) and since the RFC is quite mum on what the correct behavior is, we're having to wing it for now.

Obligatory Picture

[“I am NOT a number, I am … a Q-CODE!”]

Obligatory Contact Info

Obligatory Feeds

Obligatory Links

Obligatory Miscellaneous

You have my permission to link freely to any entry here. Go ahead, I won't bite. I promise.

The dates are the permanent links to that day's entries (or entry, if there is only one entry). The titles are the permanent links to that entry only. The format for the links are simple: Start with the base link for this site:, then add the date you are interested in, say 2000/08/01, so that would make the final URL:

You can also specify the entire month by leaving off the day portion. You can even select an arbitrary portion of time.

You may also note subtle shading of the links and that's intentional: the “closer” the link is (relative to the page) the “brighter” it appears. It's an experiment in using color shading to denote the distance a link is from here. If you don't notice it, don't worry; it's not all that important.

It is assumed that every brand name, slogan, corporate name, symbol, design element, et cetera mentioned in these pages is a protected and/or trademarked entity, the sole property of its owner(s), and acknowledgement of this status is implied.

Copyright © 1999-2024 by Sean Conner. All Rights Reserved.