Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hydra: added rewrites for subpath extension/ #2261

Merged
merged 5 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions hydra/.htaccess
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Created by Markus Lanthaler

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.markus-lanthaler.com/hydra/$1 [R=302,L]
10 changes: 10 additions & 0 deletions hydra/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Hydra Core Vocabulary and extensions

URLs:
- https://w3id.org/hydra/
- https://w3id.org/hydra/extension/
- https://w3id.org/hydra/extension/*/

Contact: [Hydra Community Group](https://hydra-cg.com) <[email protected]>

W3ID created by [Markus Lanthaler](https://github.com/lanthaler), maintained by [Tomasz Pluskiewicz](https://github.com/tpluscode) and [Karol Szczepański](https://github.com/alien-mcl)
32 changes: 32 additions & 0 deletions hydra/extension/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Created by Tomasz Pluskiewicz

Options +FollowSymLinks

AddType application/rdf+xml .rdf
AddType application/ld+json .jsonld
AddType application/n-triples .nt
AddType text/turtle .ttl

RewriteEngine on

# Redirect HTML requests to extensions home page
RewriteCond %{HTTP_ACCEPT} !application/rdf\+xml.*(text/html|application/xhtml\+xml|text/\*|\*/\*)
RewriteCond %{HTTP_ACCEPT} text/html [OR]
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml [OR]
RewriteCond %{HTTP_ACCEPT} text/\* [OR]
RewriteCond %{HTTP_ACCEPT} \*/\* [OR]
RewriteCond %{HTTP_USER_AGENT} ^Mozilla/.*
RewriteRule ^$ https://hydracg.github.io/extensions/ [R=303,L]

# Redirect RDF serilizations to their respective documens
tpluscode marked this conversation as resolved.
Show resolved Hide resolved
RewriteCond %{HTTP_ACCEPT} ^.*application/rdf\+xml.*
RewriteRule ^$ https://hydracg.github.io/extensions.rdf [R=303,L]
RewriteCond %{HTTP_ACCEPT} ^.*application/n-triples.*
RewriteRule ^$ https://hydracg.github.io/extensions.nt [R=303,L]
RewriteCond %{HTTP_ACCEPT} ^.*application/ld\+json.*
RewriteRule ^$ https://hydracg.github.io/extensions.jsonld [R=303,L]
RewriteCond %{HTTP_ACCEPT} ^.*text/turtle.*
RewriteRule ^$ https://hydracg.github.io/extensions.ttl [R=303,L]

# Subpaths are all HTML
RewriteRule (.*) https://hydracg.github.io/extensions/$1 [R=303,L]