How to handle 301s

Any ideas for how to handle 301s in Prismic? Our marketing team needs to be able to add and edit 301s.

I was thinking of simply creating a Custom Type for 301s, one field for the old URL and another field for where we want that traffic redirected to.

Any reason that's a bad idea or another way you think we could handle it?

One issue I see with that is a lack of validation around the old URL. There is the possibility that the URL we're redirecting is actually a good, live URL. In that case, I don't know how we'd provide any validation around that, but that case isn't a huge concern.

Thanks all!

Hello Dru, welcome to the Community!

What you’ve suggested is a good idea. Once you have created your 301 Custom Type, which can add a Group field and within the group a Key Text field to list the old UIDs, then on all your other pages add a Content Relationship field, so you can create a direct link to each of the 301 documents.

I can also think of a somewhat simpler approach, where you add a new tab to your Page Custom types, and in that tab place the same Group with Key Text fields mentioned above. As each page has its individual URL, a tab could be a faster and more effective solution.

Thank you for the help Paulina!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.