Skip to content

Commit

Permalink
redirect to versioned/latest files
Browse files Browse the repository at this point in the history
  • Loading branch information
keski committed Sep 18, 2023
1 parent fe1cb24 commit 723c89d
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions CEON/.htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,24 @@ RewriteRule ^catalogue/?$ https://liusemweb.github.io/CEON/catalogue [R=308,L]
# Redirect specific catalogue request
RewriteRule ^catalogue/(.+)/?$ https://liusemweb.github.io/CEON/catalogue/$1 [R=303,NE,L]

# Redirect to latest version for RDF/XML
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^ontology/(\w+)/?$ https://liusemweb.github.io/CEON/ontology/$1/latest/$1.owl [R=303,NE,L]

# Redirect versioned request for RDF/XML
# Redirect request to versioned/latest RDF/XML
RewriteCond %{HTTP_ACCEPT} application/rdf\+xml
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/$1.owl [R=303,NE,L]
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?|latest)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/$1.rdf [R=303,NE,L]

# Redirect to latest version for Turtle
# Redirect request to versioned/latest Turtle
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^ontology/(\w+)/?$ https://liusemweb.github.io/CEON/ontology/$1/latest/$1.ttl [R=303,NE,L]
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?|latest)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/$1.ttl [R=303,NE,L]

# Redirect versioned request for Turtle
RewriteCond %{HTTP_ACCEPT} text/turtle
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/$1.ttl [R=303,NE,L]
# Redirect request to versioned/latest JSON-LD
RewriteCond %{HTTP_ACCEPT} application/ld\+json
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?|latest)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/$1.jsonld [R=303,NE,L]

# Redirect to latest version for any text-oriented MIME type to the documentation
RewriteRule ^ontology/(\w+)/?$ https://liusemweb.github.io/CEON/ontology/$1/latest/index.html [R=303,NE,L]
# Redirect to specific file
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?|latest)/(\w+\.(\w+))$ https://liusemweb.github.io/CEON/ontology/$1/$2/$3 [R=303,NE,L]

# Redirect versioned request for any text-oriented MIME type to the documentation
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/index.html [R=303,NE,L]
RewriteRule ^ontology/(\w+)/([0-9]\.[0-9](?:\.[0-9])?|latest)/?$ https://liusemweb.github.io/CEON/ontology/$1/$2/index.html [R=303,NE,L]

# Default redirect for unmatched patterns to GitHub project
RewriteRule ^.* https://github.com/LiUSemWeb/CEON [R=303,NE,L]

0 comments on commit 723c89d

Please sign in to comment.