I’ve got a site with profiles where the slug can be changed by the user. I would like to implement automatic rewriting of these slug changes. Either in Ruby or Nginx, is there any libraries or guides on how to do this?
There’s these https://www.ruby-toolbox.com/categories/URL_Rewriting but at what layer would this best be implemented?
What’s your experiences and best practices?
I don’t know if there is a library around. But would I would do is:
If you follow that approach it assumes that a slug already used by a user in the past cannot be reused.
Hope that helps.