You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
norman
changed the title
You should not be able to reuse an old slug from another record's slug history
Should you be able to reuse an old slug from another record's slug history?
May 28, 2015
Was surprised to find out Friendly ID's behavior in this regard.
Some context: I run a site where users can post projects. Each project has a URL like example.com/projects/foobar where foobar is a slug generated by Friendly ID. We use the history option so when projects are renamed (e.g. to turbo-donkey) the old links continue to work and redirect to the new page instead.
Here's the problem: If someone adds a different project with a slug that was previously used (e.g. foobar), then that project won't have a working URL. As /projects/foobar still redirects to turbo-donkey.
Even if the most recently created slug would take precedence, you'd still end up in a situation where old links to /projects/foobar, which used to redirect to point to one project, now start pointing to a different project.
The solution is, as the title of this issue suggests, to prevent reusing old slugs.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
See #663.
The text was updated successfully, but these errors were encountered: