w3c / epub-specs

Shared workspace for EPUB 3 specifications.
Other
306 stars 60 forks source link

Added a redirect function to the index page #2565

Closed iherman closed 1 year ago

iherman commented 1 year ago

At makes it possible to redirect (through the .htaccess trick), e.g.

https://www.w3.org/publishing/epub33/epub-33 to https://www.w3.org/TR/epub-33

Just as

https://www.w3.org/publishing/epub32/epub-contentdocs went to the relevant 32 spec.

mattgarrish commented 1 year ago

I don't think I follow what's going on. Where are the hashes in the URL coming from that this script picks up on?

If I put in https://www.w3.org/publishing/epub33/epub-33, are you saying there's already a redirect on that URL that will put "epub-33" into the hash, so it redirects first here as https://w3c.github.io/epub33/#epub-33 and then this page will grab the hash and do another redirect?

iherman commented 1 year ago

I don't think I follow what's going on. Where are the hashes in the URL coming from that this script picks up on?

If I put in https://www.w3.org/publishing/epub33/epub-33, are you saying there's already a redirect on that URL that will put "epub-33" into the hash, so it redirects first here as https://w3c.github.io/epub33/#epub-33 and then this page will grab the hash and do another redirect?

Yes (well, almost; it redirects to https://w3c.github.io/epub33/index-page/#epub-33). And it is very convoluted, I know, and it would be more direct to just add a set of boring .htaccess lines. The only thing that motivated me to do it this way is that this script can be modified at any time by, e.g., you (if we publish a new document, for example) and you would not depend on me (or a team member) to go back to the .htaccess file (which is strictly team access only).

If you think that is over the top, I am happy to use .htaccess directly...

iherman commented 1 year ago

(And, b.t.w., we had the same problems with some a11 reports; we may use the same approach to avoid massaging .htaccess for those as well.)

mattgarrish commented 1 year ago

Ah, okay, that makes sense now. I'm fine with keeping it; I just wasn't sure what the first part of getting URLs here was.