Skip to content

Commit e2ec0d8

Browse files
authored
Merge pull request #72 from Materials-Data-Science-and-Informatics/asmo-patch-1
Update .htaccess for ASMO
2 parents 4c52f9c + 399d55b commit e2ec0d8

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

asmo/.htaccess

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,33 @@
55
# Resource location: https://raw.githubusercontent.com/OCDO/asmo/main/asmo.owl
66

77
Options +FollowSymLinks
8-
9-
8+
Options -MultiViews
109
RewriteEngine on
1110

12-
# Redirect for ASMO ontology
13-
RewriteRule ^$ https://raw.githubusercontent.com/OCDO/asmo/main/asmo.owl [R=303,L]
11+
# Directive to ensure *.rdf files served as appropriate content type
12+
AddType application/rdf+xml .owl
1413

14+
# asmo v1.0.0 docs
15+
RewriteRule ^v1.0.0$ https://ocdo.github.io/asmo/ [R=303,L]
16+
RewriteRule ^v1.0.0/$ https://ocdo.github.io/asmo/ [R=303,L]
17+
RewriteRule ^v1.0.0/$ https://ocdo.github.io/asmo/#$1 [R=303,NE,L]
18+
19+
# asmo v1.0.0 owl
20+
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.*
21+
RewriteRule ^v1.0.0$ https://raw.githubusercontent.com/OCDO/asmo/main/asmo.owl [R=303,L]
22+
RewriteRule ^v1.0.0/$ https://raw.githubusercontent.com/OCDO/asmo/main/asmo.owl [R=303,L]
23+
24+
# Rewrite rule to serve HTML content - terms
25+
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml|text/\*|\*/\*)
26+
RewriteCond %{HTTP_ACCEPT} text/html [OR]
27+
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
28+
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
29+
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
30+
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
31+
RewriteRule ^(.*)$ https://ocdo.github.io/asmo/#$1 [R=303,NE,L]
32+
33+
# Rewrite rule to serve RDF/XML content
34+
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.* [OR]
35+
RewriteCond %{HTTP_ACCEPT} ^.*application/xml.* [OR]
36+
RewriteCond %{HTTP_ACCEPT} ^.*text/xml.*
37+
RewriteRule ^$ https://raw.githubusercontent.com/OCDO/asmo/main/asmo.owl [R=303,NE,L]

0 commit comments

Comments
 (0)