Skip to content

Commit

Permalink
Merge pull request perma-id#1949 from m-markovic/master
Browse files Browse the repository at this point in the history
Update .htaccess
  • Loading branch information
dgarijo authored Dec 15, 2020
2 parents 77c2393 + 4fdc248 commit 1eb9591
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions sao/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,38 @@ AddType application/rdf+xml .owl
AddType text/turtle .ttl
AddType application/n-triples .n3
AddType application/ld+json .json
# Rewrite engine setup
RewriteEngine On
#Change the path to the folder here
RewriteBase https://rains-uoa.github.io/SAO-Ontology/

# Rewrite rule to serve HTML content from the vocabulary URI if requested
RewriteEngine on

# Rewrite rule for latest version.
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 ^$ index-en.html [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/index-en.html [R=303,L]

# Rewrite rule to serve JSON-LD content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^$ ontology.json [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/ontology.json [R=303,L]

# Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^$ ontology.xml [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/ontology.xml [R=303,L]

# Rewrite rule to serve N-Triples content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/n-triples
RewriteRule ^$ ontology.nt [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/ontology.nt [R=303,L]

# Rewrite rule to serve TTL content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle [OR]
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
RewriteCond %{HTTP_ACCEPT} \*/turtle
RewriteRule ^$ ontology.ttl [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/ontology.ttl [R=303,L]

RewriteCond %{HTTP_ACCEPT} .+
RewriteRule ^$ 406.html [R=406,L]
RewriteRule ^(.*)$ https://rains-uoa.github.io/SAO-Ontology/406.html [R=406,L]
# Default response
# ---------------------------
# Rewrite rule to serve the RDF/XML content from the vocabulary URI by default
RewriteRule ^$ ontology.xml [R=303,L]
RewriteRule ^$ https://rains-uoa.github.io/SAO-Ontology/ontology.xml [R=303,L]

0 comments on commit 1eb9591

Please sign in to comment.