I am building a quiz site.
User can create quizzes and choose a title for their quiz.
I was thinking about using the title with the ID in the URL and here I have multiple ideas, which all have multple pro's and con's.
IDEA 1 (currently my favourite):
Use the title of the quiz with the ID, e.g.:
https://www.example/com/play/1-capitals-of-europe
1 is the ID of the quiz and that is the only info I need to correctly load the site. If the user changes the title to something else, it will still work and I will not have dead links (404) somewhere in the google index, e.g.:
https://www.example/com/play/1-capitals-of-europe-very-hard
Both links will load the same quiz, but its bad for SEO? Now google will have same content under two different domains?
To solve this I could use canonical links/tags to tell google its the same content. But if the user edits the quiz title 100 times, then there will be 100 canonical links/tags and I need to save a history of title edits into the DB.
Still no idea how to handle titles in foreign languages, e.g. russian or chinese? Probably there are ways to URL encode this, but in these cases I could just take the ID.
NOTE: Titles are not unique, so its possible for a different user to have a domain like this:
https://www.example/com/play/2-capitals-of-europe
IDEA 2
Save for every quiz a URL identifier string, which the user can create aswell. The quiz will have a title, which is for display and a URL identifier, which cannot be changed after the quiz has been created. This way I have nice looking URL's and have not to worry about canonical stuff etc.
The bad things is: I think choosing a URL identifier or a "permanent title" may be confusing for the user. Also in case of a typo nothing can't be done.
IDEA 3
Do not bother with nice looking URL's, just use the ID or a random hash for the URL and thats it, e.g.:
https://www.example/com/play/egst1672-38dd32ew
https://www.example/com/play/1-foo-bar-baz
it would load the page but have a canonical pointing to the current correct URL.