Hacker News new | ask | show | jobs
by Gametroleum 1830 days ago
> What to leave out

> [..]

> File name extension. This is a very common one. "cgi", even ".html" is something which will change. You may not be using HTML for that page in 20 years time, but you might want today's links to it to still be valid. The canonical way of making links to the W3C site doesn't use the extension.(how?)

And the page URL is [...]/URI.html

6 comments

It works fine without the suffix as well: https://www.w3.org/Provider/Style/URI
Since I switched from ASP to PHP (2008), I avoided file extensions in page URI in most cases, and instead placed every page into its own folder. This is compatible with every web server without using rewrite rules.

When I switched from PHP to static generators (2017), most URIs continued working without redirects.

Although there is no redirect, the proposed best practice URL also works: https://www.w3.org/Provider/Style/URI
To be fair, it's the OP that chose to use the URL with the extension. However, you could say WC3 could've disable their servers from automatically creating URLs with file extension if they wanted to follow this.

1. https://www.w3.org/Provider/Style/URI works

2. If https://www.w3.org/Provider/Style/URI.html is ever 404 then you get a very useful 300 page (e.g., try https://www.w3.org/Provider/Style/URI.foobar)

3. However, from (2) you can see Spanish page is encoded as `.../URL.html.es` which is bad because `.../URI.es` does not exist

A page URL. I guess this could be considered the canonical example of hn not always linking to the coolest source?
> You may not be using HTML for that page in 20 years time

Yes it might be all Flash.