3 ms·
> 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
by Gametroleum 5y 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
- usrusr 5y agoA page URL. I guess this could be considered the canonical example of hn not always linking to the coolest source?
- cpach 5y agoIt works fine without the suffix as well: https://www.w3.org/Provider/Style/URI https://www.w3.org/Provider/Style/URI
- japanuspus 5y agoAlthough there is no redirect, the proposed best practice URL also works: https://www.w3.org/Provider/Style/URI https://www.w3.org/Provider/Style/URI
- slver 5y ago> You may not be using HTML for that page in 20 years time Yes it might be all Flash.
- yoursunny 5y agoSince 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.
- ketozhang 5y agoTo 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 https://www.w3.org/Provider/Style/URI works 2. If https://www.w3.org/Provider/Style/URI.html 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 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