We’ve needed to have a linkchecker in place on the WMS for a while, but for technical and time reasons we’ve been unable to implement it until now. The good news is that the Drupal community already have a very good linkchecker module, which we will be pushing out to all sites in the near future.
The module we are using is called, unsurprisingly linkchecker and provides site managers with three things:
- A Broken Links report which usually exists on the Reports menu, but we are moving to the Content menu as our site managers don’t have access to Reports.
- A Broken Links tab on user profiles which provides a quick way to get broken links for content only you have created.
- Messages at the top of node edit pages listing broken links in that node.
The module is very configurable, so here are some of the decisions we’ve made for configuration. Note that we may change some of these decisions based on feedback we receive:
- Only scan page and block content types
- Check both internal and external liks
- Re-check every 4 weeks
- Do not auto-updated 301s (see below)
- Only provide reporting on the site. We plan to add email reporting as a future enhancement.
A note on status codes: The linkchecker will report various status codes for links it considers broken. The code for a page not found is 404, but other codes can be returned too, such as:
- 500 – The server encountered an error
- 503 – Service currently unavailable
- 504 – Timeout
- 401 – Unauthorized (probably requires authentication)
- 403 – Forbidden
- 301 – Moved permanently
In the case of 301, linkchecker has the ability to automatically fix the link to whatever it was moved to. This is a nice feature, but it makes us a bit nervous so we’re leaving it off for now until we can test that it doesn’t break anything. 301 responses can be ignored, but it is better to fix them.