view onto/af/.htaccess @ 19:1e79ce3ff5f5 tip

Simplify and cut some non-working resource paths
author Chris Cannam
date Wed, 08 Nov 2017 15:27:23 +0000
parents 1e44d666ced1
children
line wrap: on
line source
# Turn off MultiViews
Options -MultiViews

# Directive to ensure *.rdf files served as appropriate content type, 
# if not present in main apache config
AddType application/rdf+xml .rdf
AddType text/rdf+n3 .n3

# Rewrite engine setup
RewriteEngine On
RewriteBase /onto/af

# Rewrite rule to serve HTML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^(.*onto/af)$ $1/
RewriteRule ^(.*)$ http://dbtune.org/onto/doc/audio_features.html [R=303]

# Rewrite rule to serve directed HTML content from class/prop URIs
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^/(.+) http://dbtune.org/onto/doc/audio_features.html [R=303,NE]

# Rewrite rule to serve RDF/XML content if requested
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^ http://dbtune.org/onto/doc/audio_features.rdf [R=303]

# Same for text/n3 and application/x-turtle
RewriteCond %{HTTP_ACCEPT} application/x\-turtle [OR]
RewriteCond %{HTTP_ACCEPT} application/turtle [OR]
RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
RewriteCond %{HTTP_ACCEPT} text/rdf\+n3
RewriteRule ^ http://dbtune.org/onto/doc/audio_features.n3 [R=303]

# Choose the default response 
# --------------------------- 

# Rewrite rule to serve RDF/XML content by default
#RewriteRule ^example4/ example4-content/2005-10-31.rdf [R=303]

# Rewrite rules to serve HTML content by default (disabled)
# (To enable this option, uncomment the two rewrite rules below,
# and comment out the rewrite rule directly above)
RewriteRule ^$ http://dbtune.org/onto/doc/audio_features.html [R=303]
#RewriteRule ^(.+) http://dbtune.org/onto/doc/audio_features.html [R=303,NE]