-
Notifications
You must be signed in to change notification settings - Fork 7
/
.htaccess
42 lines (32 loc) · 1.82 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Turn off MultiViews, multiple content types need multiple extensions
Options -MultiViews
AddType text/html;charset=UTF-8 .html
AddType text/n3;charset=UTF-8 .n3
AddType application/n-triples .nt
AddType application/rdf+xml .rdf
AddType text/turtle;charset=UTF-8 .ttl
# Rewrite engine setup
RewriteEngine On
RewriteBase /
# Rewrite rule to serve HTML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteRule ^(discovery|xkos|phdd)$ $1.html [R=303]
# Rewrite rule to serve N3 content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/n3 [OR]
RewriteCond %{HTTP_ACCEPT} text/rdf\+n3
RewriteRule ^(discovery|xkos|phdd)$ $1.n3 [R=303]
# Rewrite rule to serve N-triples content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/n-triples
RewriteRule ^(discovery|xkos|phdd)$ $1.nt [R=303]
# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^(discovery|xkos|phdd)$ $1.rdf [R=303]
# Rewrite rule to serve Turtle content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
RewriteCond %{HTTP_ACCEPT} application/x-turtle
RewriteRule ^(discovery|xkos|phdd)$ $1.ttl [R=303]
# Rewrite rule to serve HTML content from the vocabulary URI by default
RewriteRule ^(discovery|xkos|phdd)$ $1.html [R=303]
# Redirect for empty path to RDF page at DDI Alliance
RewriteRule ^$ http://www.ddialliance.org/Specification/RDF [R=303]