I have a site that stores archived data extracted from an old application environment (Lotus/IBM Notes). The data is stored as lots of individual .pdf files, 1 per record from the old application. Lotus Notes provided a 'doclink' feature that creates links between records, in the extracted .pdf files these are represented as URL links. Unfortunately the links don't work because they just reference the GUID of the record rather than the filename of the .pdf.


Link is: http://server/site/content/4A2581B4000053274A25797C002B23F8.pdf

PDF is at: http://server/site/content/Application A - Descriptive Filename(4A2581B4000053274A25797C002B23F8).pdf

When clicking on a link you are taken to the 404 'Page Not Found' page.


I'd like to customise this page to include a 'Search Results' web part with a query that just searches for that GUID.

I've managed to create a custom 404 page with the 'Search Results' web part, but cannot find a way to extract just the GUID value from the url parameter [requestUrl] that is passed to the 404 page.


Is it possible to perform any text parsing on the query string parameters to help filter out the GUID?

  • What version of SharePoint? How are you currently crawling the content? (Are you using "Web Site" or "File Share", etc.) – Matthew McDermott Apr 15 '19 at 20:01
  • SharePoint Online. We are utilising the OOTB search features from SharePoint Online. – Dave ONeill Apr 15 '19 at 21:23

I would implement this as a custom display template. You could add JavaScript logic to perform the URL transformation. Create a custom content type for the PDFs in the library and apply a Result Type Rule that triggers on that content type and applies the Display Template.

  • I can see that this may be an option for us to consider. I was hoping to avoid too much in the way of customisation, but this may be the best approach for us. I'll try this out in the coming days and mark as Answer if we can get to work. Thanks – Dave ONeill Apr 18 '19 at 2:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.