Skip to content

Commit 663bf47

Browse files
committed
/dpv fix examples 404 - redirect to version
- the examples links e.g. https://w3id.org/dpv/examples#E0029 give a 404 as the rule is set to go to https://w3c.github.io/dpv/examples/#E0066 which results in a 404 - the correct link should go to the 2.0 versioned page as examples are declared in every version even if the files are outside the versioned folders at root level - so the file https://w3c.github.io/dpv/examples/E0066.ttl is shown as https://w3c.github.io/dpv/2.0/examples#E0066 - the fix is to write rules that go to the actual file for RDF content types and go to the versioned page for HTML content type - fixes w3c/dpv#200
1 parent ce61e4a commit 663bf47

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dpv/.htaccess

+13
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,19 @@ RewriteRule ^2.0/justifications/owl$ %{ENV:BASE}/2.0/justifications/justificatio
739739

740740
RewriteRule ^2.0/justifications/owl$ %{ENV:BASE}/2.0/justifications/justifications-owl.html [R=302,L]
741741

742+
### Examples
743+
744+
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
745+
RewriteRule ^examples#([\w-]+)$ %{ENV:BASE}/examples/$1.rdf [R=302,L]
746+
RewriteCond %{HTTP_ACCEPT} text/turtle
747+
RewriteRule ^examples#([\w-]+)$ %{ENV:BASE}/examples/$1.ttl [R=302,L]
748+
RewriteCond %{HTTP_ACCEPT} application/n\-triples
749+
RewriteRule ^examples#([\w-]+)$ %{ENV:BASE}/examples/$1.n3 [R=302,L]
750+
RewriteCond %{HTTP_ACCEPT} application/ld\+json
751+
RewriteRule ^examples#([\w-]+)$ %{ENV:BASE}/examples/$1.jsonld [R=302,L]
752+
753+
RewriteRule ^examples#([\w-]+)$ %{ENV:BASE}/2.0/examples#$1 [NE,R=302,L]
754+
742755
########## DEPRECATED URLS ARE REDIRECTED
743756

744757
RewriteRule ^dpv-gdpr$ https://w3id.org/dpv/legal/eu/gdpr [R=302,L]

0 commit comments

Comments
 (0)