Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?


That'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.


I actually think the OP's suggestion is the most elegant of everything I've seen here.

It's a matter of aesthetics.


With the query string I'd expect the arbitrary title would actually be rendered in the served page :)

    &title=get%20a%20load%20of%20this%20guy


My 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.


Search 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).


HTML 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: