-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
.htaccess
230 lines (181 loc) · 13.1 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
Options +FollowSymLinks
RewriteEngine on
# Directive to allow Cross origin requests
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "Origin, X-Requested-With, Accept, Accept-Language"
Header always set Access-Control-Allow-Methods "GET, OPTIONS"
# Rewrite Base URL - OLD
# RewriteRule ^$ http://xapi.vocab.pub [R=302]
#######################################################################################################
################################ xAPI Ontology & Statement Context ####################################
#######################################################################################################
# Ontology Rewrite rule to serve HTML content from the vocabulary URI if requested
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 ^ontology/?$ https://adlnet.github.io/xapi-ontology [R=303]
# Ontology Rewrite rule to serve RDF/XML content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^ontology/?$ https://adlnet.github.io/xapi-ontology/ontology.rdf [R=303]
# Ontology Rewrite rule to serve Turtle content from the vocabulary URI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^ontology/?$ https://adlnet.github.io/xapi-ontology/ontology.ttl [R=303]
# JSON-LD xAPI STATEMENT CONTEXT
# Context for xAPI Statements published as constrained JSON-LD
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^statement-context$ https://adlnet.github.io/xapi-ontology/statement-context.jsonld [R=303]
# JSON-LD xAPI STATEMENT CONTEXT
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 ^statement-context$ https://adlnet.github.io/xapi-ontology/statement-context.jsonld [R=303]
#######################################################################################################
###################################### OLD adlnet.gov IRI RULES #######################################
#######################################################################################################
# Serve HTML content at profile IRI if requested based on redirect on old ADL website and also handle ADL's cmi5 verbs
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 ^adl/verbs/abandoned/?$ https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/63799980-a0fb-4ead-9ed2-25f7a65734f5 [R=303]
RewriteRule ^adl/verbs/satisfied/?$ https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/e3212e03-237f-4684-8f65-e27c7375d30b [R=303]
RewriteRule ^adl/verbs/waived/?$ https://profiles.adlnet.gov/profile/a929b474-9518-45a2-bd47-24696c602754/concepts/582cbd06-8920-4748-917f-5c1af8244a82 [R=303]
RewriteRule ^adl/verbs/logged-in/?$ https://profiles.adlnet.gov/profile/c752b257-047f-4718-b353-d29238fef2c2/concepts/b5bea04f-3f49-4b9d-a7e9-4202af00dd4c [R=303]
RewriteRule ^adl/verbs/logged-out/?$ https://profiles.adlnet.gov/profile/c752b257-047f-4718-b353-d29238fef2c2/concepts/7ce10260-ffa0-4d0f-a5c3-ed795e60b276 [R=303]
RewriteRule ^adl/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://profiles.adlnet.gov/search [R=303]
#######################################################################################################
#################### XAPI Published Profiles | HTML Content Negotiation RULES #########################
#######################################################################################################
# Manual Redirect Rules for specific profiles
# ---------------------------
# Serve HTML content at profile IRI if requested
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 ^navy/?$ https://navy-xapi-library.bitbucket.io [R=303]
RewriteRule ^navy/index.html$ https://navy-xapi-library.bitbucket.io [R=303]
RewriteRule ^navy/(.*?)\.html$ https://navy-xapi-library.bitbucket.io [R=303]
# Consolidated HTML Rules to account for vocab/profile pattern match and two child paths after
# ---------------------------
# Serve HTML content at profile IRI if requested
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/.*
# Old Rule RewriteRule ^([0-9a-zA-Z\-]+)/?$ http://xapi.vocab.pub/describe/?url=https://w3id.org/xapi/$1 [R=303]
RewriteRule ^([0-9a-zA-Z\-]+)/?$ https://profiles.adlnet.gov/api/profile?iri=https://w3id.org/xapi/$1 [R=303]
# Serve HTML content at profile IRI if x.x.x version requested
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/.*
# Old Rule RewriteRule ^([0-9a-zA-Z\-]+)/v[0-9][0-9.]*/?$ http://xapi.vocab.pub/describe/?url=https://w3id.org/xapi/$1 [R=303]
RewriteRule ^([0-9a-zA-Z\-]+)/v[0-9][0-9.]*/?$ https://profiles.adlnet.gov/api/profile?iri=https://w3id.org/xapi/$1 [R=303]
# Serve HTML content at type IRI if requested
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/.*
# Old Rule RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ http://xapi.vocab.pub/describe/?url=https://w3id.org/xapi/$1 [R=303]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://profiles.adlnet.gov/api/profile?iri=https://w3id.org/xapi/$1 [R=303]
# Serve HTML content at vocabulary term IRI if requested
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/.*
# Old Rule RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ http://xapi.vocab.pub/describe/?url=https://w3id.org/xapi/$1/$2/$3 [R=303]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://profiles.adlnet.gov/api/profile?iri=https://w3id.org/xapi/$1/$2/$3 [R=303]
# Serve HTML content at vocabulary term IRI if requested
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/.*
# Old Rule RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ http://xapi.vocab.pub/describe/?url=https://w3id.org/xapi/$1/$2/$3/$4 [R=303]
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://profiles.adlnet.gov/api/profile?iri=https://w3id.org/xapi/$1/$2/$3/$4 [R=303]
#######################################################################################################
##################### XAPI Authored Profiles | RDF Content Negotiation RULES ##########################
#######################################################################################################
# Serve Turtle at profile IRI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.ttl [R=303]
# Serve Turtle for the x.x.x version of the profile if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^([0-9a-zA-Z\-]+)/v[0-9][0-9.]*/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$2/$1.ttl [R=303]
# Serve Turtle at vocabulary type IRI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.ttl [R=303]
# Serve Turtle at vocabulary term IRI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.ttl [R=303]
# Serve Turtle at vocabulary term IRI if requested
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.ttl [R=303]
# Serve JSON-LD at profile IRI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve JSON-LD for the x.x.x version of the profile
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/v[0-9][0-9.]*/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$2/$1.jsonld [R=303]
# Serve JSON-LD at vocabulary type IRI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve JSON-LD at vocabulary term IRI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve JSON-LD at vocabulary term IRI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve JSON-LD at vocabulary term IRI if requested
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve Constrained JSON-LD at profile IRI if JSON is requested
RewriteCond %{HTTP_ACCEPT} application/json
RewriteRule ^([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve Constrained JSON-LD at profile IRI if x.x.x version and JSON is requested
RewriteCond %{HTTP_ACCEPT} application/json
RewriteRule ^([0-9a-zA-Z\-]+)/v[0-9][0-9.]*/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$2/$1.jsonld [R=303]
# Serve Constrained JSON-LD at vocabulary type IRI if JSON is requested
RewriteCond %{HTTP_ACCEPT} application/json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve Constrained JSON-LD at vocabulary term IRI if JSON is requested
RewriteCond %{HTTP_ACCEPT} application/json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
# Serve Constrained JSON-LD at vocabulary term IRI if JSON is requested
RewriteCond %{HTTP_ACCEPT} application/json
RewriteRule ^([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/([0-9a-zA-Z\-]+)/?$ https://adlnet.github.io/xapi-authored-profiles/$1/$1.jsonld [R=303]
#######################################################################################################
################################ ACROSS X LANGUAGE NEGOTIATION RULES ##################################
#######################################################################################################
# Serve zh-tw HTML content at vocabulary IRI if requested
RewriteCond %{HTTP:Accept-Language} ^zh-tw [NC]
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 ^acrossx/?$ http://xapi-cop.net/vocab/zh-tw [R=303]
# Serve zh-tw content at vocabulary term IRI if requested
RewriteCond %{HTTP:Accept-Language} ^zh-tw [NC]
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 ^acrossx/(.*)/(.*)$ http://xapi-cop.net/vocab/zh-tw/#$2 [R=303,NE]
# Serve zh-cn HTML content at vocabulary IRI if requested
RewriteCond %{HTTP:Accept-Language} ^zh-cn [NC]
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 ^acrossx/?$ http://xapi-cop.net/vocab/zh-cn [R=303]
# Serve zh-cn content at vocabulary term IRI if requested
RewriteCond %{HTTP:Accept-Language} ^zh-cn [NC]
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 ^acrossx/(.*)/(.*)$ http://xapi-cop.net/vocab/zh-cn/#$2 [R=303,NE]
# END ACROSSX VOCABULARY LANGUAGE NEGOTIATION RULES
# ---------------------------