What’s the best URL structure for WIP Questions? #wip
Right now the URL of this question has just the ID: https://wip.chat/questions/639
I think it would be good to add more descriptive slugs. Both for SEO purposes, but also to give people a better indication of what the question is about when shared on platforms where there's no preview.
I'm considering a few options:
- ID-slug, e.g. https://wip.chat/questions/639-whats-the-best-url-structure-for-wip-questions
- slug-ID, e.g. https://wip.chat/questions/whats-the-best-url-structure-for-wip-questions-639
- slug, e.g. https://wip.chat/questions/whats-the-best-url-structure-for-wip-questions
Or maybe even abbreviate the "questions" part so it becomes something like this:
That way when the link gets truncated there's more room for the actual question to be visible.
Using just the slug without an ID is the most descriptive* and probably most SEO-friendly. The downside is that we need save the slug and any historical ones in order to retrieve the related question. In Rails this is pretty straightforward though using the FriendlyId gem.
(* the ID does however suggest how old the question is. A lower ID means an older question. I'm not sure if that's an advantage or disadvantage. Probably doesn't matter that much. )
Slug-ID or the one like Medium does (Slug-BigUniqueID). The advantage is that 2 questions can be same so only way to differentiate is by unique IDs :)
Thanks! I think having duplicate questions won't happen too often (because why ask the same question twice?), but I do indeed need to keep it mind for when it does happen.
I'm thinking of just adding an incrementing number to the end of the slug (e.g. "foo-bar" for the original question, and "foo-bar-2" for the duplicate question)
That might work too.
because why ask the same question twice?
It will happen because there is no search yet so it depends when you will implement it. But again nobody searches because its harder than directly asking (personal opinion because that's what I do all the time on StackOverflow 😂)
For it not to happen you will need a similar questions functionality like StackOverflow