Hello,
You can achieve this goal by modifying
~\App_Code\Application\CMSAppBase.cs file -
CMSBeginRequest() method, where you can check the current URL using
CMS.GlobalHelper.UrlHelper.CurrentURL property, and according to it, you can redirect to a required URL with the following code:
CMS.GlobalHelper.UrlHelper.PermanentRedirect(String URLForRedirection);
which executes 301 redirect. This way you can set the redirection for all documents you need.
Best regards,
Filip Ligac