4 ms·
While I agree that HN URLs are are very non-descriptive, one problem of the proposed solution might be submissions that get their titles edited by mods later?
by mstolpm 13y ago
While I agree that HN URLs are are very non-descriptive, one problem of the proposed solution might be submissions that get their titles edited by mods later?
- 3rd3 13y agoMy thought was that it could just match ^\d*?(?=-) and ignore the title. I think the adantage of the dash over a separate parameter is that it would look more compact and the advantage over achors is that it does not misuse the URL semantics ("The fragment identifier #fragment, if present, specifies a part or a position within the overall resource or document"). And the title is an identifier of the item, so it would still make sense regarding the semantics of the id-parameter.
- Bill_Dimm 13y agoSearch engine spiders, scrapers, etc. would end up hitting a bunch of dupes when the title change causes a new URL to be generated that really points to the same content (not that spiders don't already have to deal with that mess on other websites).
- latk 13y agoHTML headers can include a `<link rel="canonical" …>` that points to the up-to-date URL of this item. Furthermore, outdated or invalid titles could be redirected with a "301 moved permanently" to the current title.
- latk 13y agoThat's not an issue if only the ID is used to identify the submission, whereas the title slug is only human-readable fluff. E.g /item/1234/original-submission /item/1234/edited-title /item/1234/arbitrary-string /item/1234/ This could also be done with the current query string approach, e.g. /item?id=1234&title=original-submission /item?id=1234&title=edited-title /item?id=1234&title=arbitrary-string /item?id=1234 OP's suggestion of having the title be part of the ID would be quite inelegant, but possible if the real ID is only the digits up to the first hyphen. Ideally, the title would be completely ignored, but other titles would redirect to an URL with the current title.