I’m currently in the process of development and thinking about URL structure. For example social networks make it possible to specify usernames after a slash that seems logical.
As a result, the structure turns into something like
example.com/username/(blog, account, album, etc.), but here there is a problem – once a user is registered, he\she gets an ID. Much time can pass before the user decides to customize URL address, so search engine already may have in its DB links like
example.com/id12345. Later user can customize\change URL again, then in a month again, and then again in a six months.
Here there are questions:
How social networks solve such issue? What is the algorithm? Does DB do record of all address changes that this user has made and in case if there is a request of ‘old’ URL, redirection occurs to the new one?
How to act in cases when this user lets say have made 3 changes, in all cases giving different names, such as
qwerty? What if after all these changes, the other user wants to take a
firefly, which the 1st user had sometime ago?
After all, if to allow the 2nd user to use already freed
fireflyaddress, there is a chance (albeit small) that redirection would be made to the 2nd user, instead of the 1st one. Forbid to other users to use someone’s previously used names?