we're using a variable called "slug" to identify different content pages.
we recently changed a slug's value from "siqterms" to "siq-terms". They both still resolve. Will the old slug expire and if so, when?
we're using a variable called "slug" to identify different content pages.
we recently changed a slug's value from "siqterms" to "siq-terms". They both still resolve. Will the old slug expire and if so, when?
Hi @Alan-SpotHero, Prismic saves all previous UID (āslugā in your case) values for a given document. This way if the UID value is changed, old links arenāt broken.
You have a couple of options for this.
1. Setup a rerouting system (recommended)
For this, you just need to make a check in your routing system. If the UID used isnāt the current UID value, something like this:
if (uid !== document.uid)
Then redirect to the url that uses the current UID.
This will ensure that old links arenāt broken and that all old links will redirect to the current one.
2. Delete the old UID value
You can read more about this here:
āBut basically you just need to duplicate the document, set the UID on the new document as you want. Then archive or delete the original. This will clear out any old UID values.
Thanks - Iāll bring this back to my engineers!
I canāt Duplicate document. I get a āclone disabledā icon. Would like to do this so that I can then delete original thus removing old UID.
@outreach My guess is that your document is a āSingleā type document. You (or someone else in your Prismic repo with admin rights) just need to edit the Custom Type for that document, change it from āSingleā to āRepeatableā. Then youāll be able to duplicate the document.
After youāre done with everything, then you can switch it back to āSingleā.
That worked and was able to archive and old UID is not showing up anymore. But once you change from Single to Repeatable, I guess you canāt go back to Single because that option is disabled now.
Thatās strange. Can you send me the following and Iāll look into it:
If you donāt want to share that publicly, you can send it to me in a private message.
@outreach Thanks for sending that info. I took a look and the issue is that you need to fully delete the extra documents from your archive of that type before you can switch it back to a Singleton.
Here is an article that explains how to fully delete them:
This should solve the issue for you