perma-id/w3id.org

allow browser (html) dereferencing of i-adopt terms to abuse the available local fragment identifiers

marc-portier opened this issue · 1 comments

@SirkoS, registered maintainer of i-adopt section at w3id.org

it would be great if the dereferencing of i-adopt terms in the browser would actually end up at the targeted fragment-identifier in the documentation.

For example:

  • following through on [https://w3id.org/iadopt/ont/Variable]
  • should effectively end up at [https://i-adopt.github.io/index.html#%2FVariable] (*)

Currently however one ends up via a double redirect at the top of the documentation:

curl -s -I --url https://w3id.org/iadopt/ont/Variable -H "Accept: text/html" | grep Location
Location: https://w3id.org/iadopt/

curl -s -I --url https://w3id.org/iadopt/ -H "Accept: text/html"|grep Location
Location: https://i-adopt.github.io/index.html

I think this could be achieved by adding an extra RewriteRule preceding this one at line #55:

# warning - unchecked code :
RewriteRule ^(.+)$ https://i-adopt.github.io/index.html#%2F$1 [NE,R=303,L]    # new entry mapping the fragments
RewriteRule ^$ https://i-adopt.github.io/index.html [R=303,L]                 # existing entry

(*) Note the current generation of the index.html is inserting a / at the start of every div@id to mark the fragment-identifier position. Unsure why this option was taken, but it makes the injection of %2F at the start of the fragment-identifier essential.
Note that this might change when following up on e.g. this pull request

SirkoS commented

Hi @marc-portier,
thanks for the suggestions- looks reasonable to me.
I'll try to test the suggested changes and create an according pull request here as soon as the the mentioned pull request is merged.