Best way to format pretty URLs for numeric IDs

后端 未结 10 1873
谎友^
谎友^ 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:35

    Stackoverflow seems to using pattern 3, with the title being ignored completely (just the id is used).

    That makes for nice semantic URL, and is also easy to implement, and still works if the title changes later.

    Of course, the title could be completely fake:

    Best way to format pretty URLs for numeric IDs

提交回复
热议问题