HTTP spec overview

Just because I find the HTTP spec so confusing at times and badly needed an overview:


5 thoughts on “HTTP spec overview

  1. You're welcome! :-)I should warn you that I'm not an expert on HTTP, I think I generally got things right but consult the spec if in doubt.. :p

  2. Even in 2006, people continue giving their files the three-letter extension "htm". Why? Just in case there's an MS-DOS user somewhere?Actually, it's better to omit the extension from the link completely. This link works, too: there are several files with different extensions available, content negotiation happens.)

  3. Why end a link with .htm? well, firstly I like showing nerds like myself what sort of content the link will give you. You know, I'd hover a link ending with .pdf a little while thinking about whether I really want Adobe Reader to open when I have X other programs open. Something.exe when you don't expect a download smells fishy. That sort of thing..htm over .html is just a habit.My site is configured for content negotiation as you just found out, but I've learnt the hard way NOT to rely on it – the algorithm seems a bit complicated and in practice Apache 1.3 is thoroughly confused by my old habit of naming files index.js or index.css along with index.htm . Depending on the UA's accept headers I've seen Apache serve pure CSS or JavaScript instead of the expected HTML page. Perhaps it's my fault for using similar file names but hey, the tool should cope with my quirks and not the other way around.Another Apache CN quirk is that if you have a directory and a file with the same name, redirection to the directory always wins. So if you have/books//books.en.htm/ request /books you're sent to the directory without any content negotiation.Even when content-negotiation works it causes problems – because I tried to use it for language negotiation and Apache would often not be able to decide what language to send – even if only one file was available! Hence, it would show a 406 error page, and IE would show it's friendly error page as if it was a 404. Well, blame IE but seriously – I can't have a site where IE tells visitors half of the pages are not found!Given all these issues I usually keep extensions on my links, thank you very much.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s