Skip to content

Commit 0159d66

Browse files
authored
Refactor EMG .htaccess rewrite rules for TIB TS
Refactor rewrite rules for EMG vocabulary to streamline HTML and RDF/XML content serving.
1 parent 84891da commit 0159d66

1 file changed

Lines changed: 20 additions & 29 deletions

File tree

emg/.htaccess

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,33 @@ RewriteEngine on
1111
# Directive to ensure *.rdf files served as appropriate content type
1212
AddType application/rdf+xml .owl
1313

14-
#Rewrite rules for emg vocabulary
14+
# HTML ontology docs
15+
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
16+
RewriteCond %{HTTP_ACCEPT} text/html [OR]
17+
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
18+
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
19+
RewriteRule ^(EMG_[0-9]+)$ https://owl.emglossary.helmholtz-metadaten.de/index.html#$1 [R=303,NE,L]
20+
21+
# Rewrite rule for /emg to serve HTML content
22+
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml)
23+
RewriteCond %{HTTP_ACCEPT} text/html [OR]
24+
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
25+
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
26+
RewriteRule ^$ https://owl.emglossary.helmholtz-metadaten.de [R=303,NE,L]
27+
28+
# Rewrite rule for /emg to serve RDF/XML content
29+
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
30+
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
31+
RewriteRule ^$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/emg.owl [R=303,NE,L]
32+
33+
# Rewrite rules for emg v3.0 vocabulary docs
1534
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml|text/\*|\*/\*)
1635
RewriteCond %{HTTP_ACCEPT} text/html [OR]
1736
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
1837
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
1938
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
2039
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
2140

22-
# emg v3.0.0 docs
2341
RewriteRule ^v3.0.0$ https://owl.emglossary.helmholtz-metadaten.de/ [R=303,L]
2442
RewriteRule ^v3.0.0/$ https://owl.emglossary.helmholtz-metadaten.de/ [R=303,L]
2543
RewriteRule ^v3.0.0/(EMG_[0-9]+)$ https://owl.emglossary.helmholtz-metadaten.de/index.html#$1 [R=303,NE,L]
@@ -37,36 +55,9 @@ RewriteRule ^v2.0.0$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_ow
3755
RewriteRule ^v2.0.0/$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/previous-versions/v2.0.0/emg.owl [R=303,L]
3856
RewriteRule ^v2.0.0/(EMG_[0-9]+)$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/previous-versions/v2.0.0/emg.owl [R=303,NE,L]
3957

40-
4158
## v1.0.0
4259
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.*
4360
RewriteRule ^v1.0.0$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/previous-versions/v1.0.0/emg.owl [R=303,L]
4461
RewriteRule ^v1.0.0/$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/previous-versions/v1.0.0/emg.owl [R=303,L]
4562
RewriteRule ^v1.0.0/(EMG_[0-9]+)$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/previous-versions/v1.0.0/emg.owl [R=303,NE,L]
4663

47-
# HTML ontology docs
48-
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml|text/\*|\*/\*)
49-
RewriteCond %{HTTP_ACCEPT} text/html [OR]
50-
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
51-
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
52-
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
53-
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
54-
RewriteRule ^(EMG_[0-9]+)$ https://owl.emglossary.helmholtz-metadaten.de/index.html#$1 [R=303,NE,L]
55-
56-
# Rewrite rule for /emg to serve HTML content
57-
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml|text/\*|\*/\*)
58-
RewriteCond %{HTTP_ACCEPT} text/html [OR]
59-
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
60-
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
61-
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
62-
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
63-
RewriteRule ^$ https://owl.emglossary.helmholtz-metadaten.de [R=303,NE,L]
64-
65-
# Rewrite rule for /emg to serve RDF/XML content
66-
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.* [OR]
67-
RewriteCond %{HTTP_ACCEPT} ^.*application/xml.* [OR]
68-
RewriteCond %{HTTP_ACCEPT} ^.*text/xml.*
69-
RewriteRule ^$ https://codebase.helmholtz.cloud/em_glossary/em_glossary_owl/-/raw/main/emg.owl [R=303,NE,L]
70-
71-
72-

0 commit comments

Comments
 (0)