Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
340541c
commit f015d97
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
Header set Access-Control-Allow-Origin * | ||
Options +FollowSymLinks | ||
RewriteEngine on | ||
|
||
# OCO [start] | ||
RewriteRule ^ontology/([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])\.(html|xml|json|ttl|nt)$ https://opencitations.github.io/ontology/$1/ontology.$2 [R=303,L] | ||
RewriteRule ^ontology\.(html|xml|json|ttl|nt)$ https://opencitations.github.io/ontology/current/ontology.$1 [R=303,L] | ||
|
||
# Rewrite rule to serve HTML content from the vocabulary URI if requested | ||
RewriteCond %{HTTP_ACCEPT} html | ||
RewriteRule ^ontology(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?$ /oc/ontology$1.html [R=303,L] | ||
|
||
# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested | ||
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml [OR] | ||
RewriteCond %{HTTP_ACCEPT} application/xml | ||
RewriteRule ^ontology(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?$ /oc/ontology$1.xml [R=303,L] | ||
|
||
# Rewrite rule to serve Turtle content from the vocabulary URI if requested | ||
RewriteCond %{HTTP_ACCEPT} text/n3 [OR] | ||
RewriteCond %{HTTP_ACCEPT} text/turtle | ||
RewriteRule ^ontology(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?$ /oc/ontology$1.ttl [R=303,L] | ||
|
||
# Rewrite rule to serve Notation3 content from the vocabulary URI if requested | ||
RewriteCond %{HTTP_ACCEPT} application/n-triples [OR] | ||
RewriteCond %{HTTP_ACCEPT} text/plain | ||
RewriteRule ^ontology(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?$ /oc/ontology$1.nt [R=303,L] | ||
|
||
# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested | ||
RewriteCond %{HTTP_ACCEPT} application/ld\+json [OR] | ||
RewriteCond %{HTTP_ACCEPT} application/json | ||
RewriteRule ^ontology(/[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])?$ /oc/ontology$1.json [R=303,L] | ||
# OCO [end] | ||
|
||
RewriteRule ^(.*)$ http://opencitations.net/$1 [R=302,L] |