Broken Links in LinkValidation Job that are not actually broken

  • Updated
Description

Sometimes the broken links in the link validation job are not actually broken. You can open the link in the browser without a problem. 

The reason it shows as broken is that CmsCore uses a HEAD request to ping the external URL and to test for its validity. Even if one can open the link in the browser (which is a GET request), the server may still block HEAD requests. If the HEAD requests are blocked, the link validation job will report the links as invalid.

 

Steps

The steps below will allow someone to check the link.

  1.  Open Postman app
  2. Enter the URL
  3. Set the request method to HEAD
  4. In the Headers tab, add the User-Agent header to "EPiServer Link Checker". 
  5. Click send.

If the result returns 403/404, It means that the link is not configured to be checked by other systems.  Hence the linkValidation job reports it as broken. 

We can add a linkValidator node as a child to the <episerver> node of the web.config. Use regex in linkValidator to exclude these links from showing up in the broken link report.

Here is the syntax:

<linkValidator
maximumRunTime="4:00:00"
recheckInterval="30.00:00:00"
internalLinkValidation="Api">
<excludePatterns>
<add regex="www.riversidetransit.com"/>
</excludePatterns>
</linkValidator>