Search code examples
apachejson-ldlinked-datacontent-negotiationhttp-status-code-303

How do I set content negotiation for .jsonld files and .html?


I'm developing a Linked Data application and I need to use 303 URIs for my dataset. Currently, I have a dataset of 22500 .jsonld files with URIs as follows:

http://example.com/project/resource/file.jsonld

And I want to redirect browsers looking for text/html content to:

http://example.com/project/page/file.html

Which are not semantic files, so they are more readable.

Does anyone know how can I do this with Apache 2.4.10? I've been considering the type-map files, but I was wondering if there are another more efficient solutions than creating 22500 .var files.


Solution

  • Look at W3C: Best Practice Recipes for Publishing RDF Vocabularies. Although it is about publishing vocabularies, it lists a number of recipes for configuring content negotiation on Apache that apply equally to datasets.

    The other key documentation for doing this is Apache Module mod_rewrite.