How to 301 redirect a CDN media library item url?

Hello,

We have a number of PDF's that are updated each year with new information. These PDF's generally get a decent level of traffic and are indexed by search engines as well as bookmarked by our users.

We understand it is not possible to update the existing media library file and it is necessary to upload a new PDF and manually update all links throughout the website to point to the new file.

How do we add a 301 redirect for the CDN url so that search engine results and users with old bookmarked links are redirected to the new PDF version?

This is important for SEO and user experience.

Thank you.

Hi there,

Welcome to the Prismic community,
Can you please share with us the name of the repository that you using (in a private message if necessary) to be able to investigate?

Best,
Fares

Hi @prismic_user,

Thanks for posting, and welcome to the Prismic Community :slight_smile:

This problem is actually about to be partly resolved.

We've received a lot of feedback from users that they have trouble managing PDFs in search engine results, so we have decided to prevent PDFs from appearing in search engines. This gives users more control over how their content is distributed. It also improves security. (While we discourage users from uploading sensitive information to the Media Library, sometimes it still happens, and that information can get unknowingly indexed and distributed in search engines.)

We have already changed our search engine settings to block Google from indexing PDFs hosted with Prismic. The change should take effect over the coming weeks.

As per redirecting a PDF, I don't think that's possible. (I'm checking with my dev team to make sure, and I'll let you know what they say.) If you have one file that you need to be able to update or replace regularly, it might be better to host the PDF on your own server, so you can have absolute control over it.

I hope this clarifies things. Let me know if you have any other questions.

Best,
Sam