News for hackers. Stuff that matters.
Re:Database IDs Have No Place in URIs (2008) by slig on Friday May 10, 2019 @08:35AM (#19877105)
For a content website such as SO, the biggest advantage of using /<id>/<slug>/ is being able to update the `slug` whenever the `title` of your content changes, and then it's very easy do a 301 redirect and you're good to go.
Re:Database IDs Have No Place in URIs (2008) by dqybh on Friday May 10, 2019 @09:15AM (#19877384)
If you're afraid of Google bombing, the redirect is not even necessary, just make sure the <link rel=canonical> tag contains the correct URL.
Re:Database IDs Have No Place in URIs (2008) by eli on Friday May 10, 2019 @04:25PM (#19881900)
I prefer redirects because if someone edits a URL to look like /1234/offensive-phrase-here/ and shares the link I don't want it to appear that we choose that phrase as a slug.
Re:Database IDs Have No Place in URIs (2008) by slig on Friday May 10, 2019 @10:23AM (#19877964)
That's a great suggestion, thanks!