Revyu Content Negotiation Fixed
So, when you lookup the URI of something on Revyu (like a review, a person, a reviewed thing, or a tag), we do something in the background called content negotiation, which basically tries to give you information back in the form that you (or your browser) asked for. (In fact, we actually we use HTTP303 redirect response to send your browser to a location where the information is available in the format you asked for, but you may never notice this as your browser handles it automatically). In most cases your browser will have asked for HTML, but if you are using some form of Semantic Web application it will like have asked for RDF/XML.
Now for something a bit more techie… When Revyu was first implemented we used mod_rewrite rules in the site’s main .htaccess file to carry out this content negotiation following recipes in the excellent Best Practice Recipes for Publishing RDF Vocabularies. This all seemed to work a treat until we tried the site with Disco, when it became clear something was wrong. Whilst working on the very cool Ripple, Joshua Shinavier spotted that q values in the Accept header of the HTTP requests to Revyu were the problem. Thanks Josh!
Basically, as noted in an earlier post, the old mod_rewrite approach only worked if one content type was listed in the Accept header. This is actually not a very common scenario, especially with the growth of GRDDL, and as well as Disco it also broke TimBL et al’s Tabulator.
So, we’ve finally managed to make the time to fix this, and have moved the content negotiation away from htaccess and mod_rewrite, and into a little bit of PHP code. Architecturally it feels like a slightly cludgy way of doing it, but it works nicely according to my tests with the Firefox Modify Headers/LiveHTTPHeaders Plugins, CURL, and Disco.
Here is an example starting point for a Disco session browsing around Revyu and beyond:
Designing with Web Standards, by Jeffrey Zeldman
Enjoy!