[RECIPES] question for apache folks

Hi Dan,

Here's a question to ask apache folks on our recipes bug...

We would like to perform different redirects from a single URI, with the 
redirect target conditional upon the content type given in the "Accept:" 
request header.

We see this as a type of content negotiation, where the result of the 
negotiation is a redirect (303), rather than directly serving content.

We'd like to use Apache's built-in content negotiation algorithms to 
implement this via Apache configuration directives. What would be the 
simplest server configuration to achieve this?

The simplest way we can think of doing this is to do Apache configuration 
like ...

# rewrite from negotiable URI to type-map
RewriteRule /example/negotiable /example/negotiable.var

# redirect from mapped URIs to content-specific locations
RewriteRule /example/negotiable.rdf http://example.com/content.rdf [R=303]
RewriteRule /example/negotiable.html http://example2.com/content.html 
[R=303]

... with /example/negotiable.var like ...

Content-Type: application/rdf+xml
URI: negotiable.rdf

Content-Type: text/html
URI: negotiable.html

... would this work? Is there a simpler way of implementing the same 
behaviour?

Cheers,

Al.

Received on Tuesday, 9 October 2007 13:35:13 UTC