## Template Apache .htaccess file for serving vocabularies.
## This file is configured at make time, with the following
## substitutions:
##
## @BASE@ should be the path component of the base URI of the
## vocabulary distribution, that is, without the protocol and
## authority components.
##
## @SUBDIR@ is a versioned subdirectory, where the public URIs
## redirect to. This is not an advertised directory, but it needs
## to be generally accessible.
##
## @FILEOPTS@ is a list of the supported vocabulary names,
## separated by vertical bars. For example 'AOIM|AAkeys'. This
## lists the vocabularies which this file will actually serve.
##
## This file is patterned after Recipe 3 in the W3C document 'Best
## Practice Recipes for Publishing RDF Vocabularies', at
##
# Apache .htaccess file
AddType application/rdf+xml .rdf
# The MIME type for .n3 should be text/rdf+n3, not application/n3:
# see MIME notes at
#
# The MIME type for Turtle is text/turtle, though this has not
# completed its registration: see
#
AddType text/rdf+n3 .n3
AddType text/turtle .ttl
# For Charset types, see
AddCharset UTF-8 .n3
AddCharset UTF-8 .ttl
AddCharset UTF-8 .html
RewriteEngine On
# This base must match the directory where this file is located.
RewriteBase @BASE@
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^(@FILEOPTS@)$ @SUBDIR@/$1/$1.rdf [R=303]
RewriteCond %{HTTP_ACCEPT} text/rdf\+n3 [OR]
RewriteCond %{HTTP_ACCEPT} application/n3 [OR]
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^(@FILEOPTS@)$ @SUBDIR@/$1/$1.ttl [R=303]
# No accept conditions: make the .html version the default
RewriteRule ^(@FILEOPTS@)$ @SUBDIR@/$1/$1.html [R=303]