Best way to format pretty URLs for numeric IDs

后端 未结 10 1962
谎友^
谎友^ 2021-02-02 02:48

Alright, so let\'s say I\'m writing a forum application, and I want pretty URLs. However, all my tables use numeric IDs, so I\'m not sure the best way to format the URLs for tho

10条回答
  •  终归单人心
    2021-02-02 03:33

    i would suggest the first one, since the topic title can be changed for clarity, by the admins and then the url will be inconsistent.

    www.example.com/topic/123456
    

    also allows one to just edit the last bit of the url (the numbers and jump to another topic), not likely to happen but still a usable feature.

提交回复
热议问题