1

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
3
  • If a user edits the quiz title, the new new URL would become the new canonical. The old URLs canonical tag would point to the current canonical. Why would you want to have multiple canonicals? Every page should have exactly one. Can you explain more about why you would need to keep track of the old ones? Commented Aug 28, 2022 at 23:52
  • @StephenOstermiller What if the user edits the title multiple times? Then the first version still have to point to the newest one. Thats why there should be multiple canonicals
    – Roman
    Commented Aug 29, 2022 at 12:03
  • All versions should point to the newest one. You shouldn't have to keep track any old versions, just make sure all variations (whether ever used or not) have the current version as the canonical. So if a user changes the URL to https://www.example/com/play/1-foo-bar-baz it would load the page but have a canonical pointing to the current correct URL. Commented Aug 29, 2022 at 12:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.