Add rewrite rules for /test-suite/vocab to get appropriate type.
authorGregg Kellogg <gregg@kellogg-assoc.com>
Fri, 23 Aug 2013 17:50:35 -0700
changeset 1918 3026519e09c7
parent 1917 efcebc9dedf3
child 1919 6a47cbf16fd5
Add rewrite rules for /test-suite/vocab to get appropriate type.
.htaccess
--- a/.htaccess	Fri Aug 23 17:34:59 2013 -0700
+++ b/.htaccess	Fri Aug 23 17:50:35 2013 -0700
@@ -3,3 +3,35 @@
    SetHandler default_handler
    Header set Access-Control-Allow-Origin "*"
 </FilesMatch>
+
+# Turn off MultiViews
+Options -MultiViews
+
+# Directive to ensure *.ttl and .jsonld files served appropriately
+AddType text/turtle .ttl
+AddType application/ld+json .jsonld
+
+# Rewrite engine setup
+RewriteEngine On
+RewriteBase /test-suite
+
+# Rewrite rule to serve HTML content from the vocabulary URI if requested
+RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
+RewriteCond %{HTTP_ACCEPT} text/html [OR]
+RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
+RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
+RewriteRule ^vocab$ vocab.html [R=303]
+
+# Rewrite rule to serve Turtle content from the vocabulary URI if requested
+RewriteCond %{HTTP_ACCEPT} text/turtle
+RewriteRule ^vocab$ vocab.ttl [R=303]
+
+# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
+RewriteCond %{HTTP_ACCEPT} application/ld+json
+RewriteRule ^vocab$ vocab.jsonld [R=303]
+
+# Choose the default response
+# ---------------------------
+
+# Rewrite rule to serve the HTML content from the vocabulary URI by default
+RewriteRule ^vocab$ vocab.ttl [R=303]