Check for Broken Links on your Website

Background

Broken links on your website can create a bad user experience and can also lower the ranking of your web site in search engine optimization (SEO).
You can prevent this from happening with prevention and detection.

Here are some examples of broken links:

How to Fix Them

Prevention

You can improve the quality of your website by choosing references that are reputable and well established.

These are links that point to an external website. As the owner, you should choose trustworthy and informative website links to help improve the quality and ranking of your website.

These are external websites that link to your site. You may not have much control over how they link to your site. However, by publishing useful content on your website, you can boost your ranking on search results.

Create a Custom 404 Page for Your Website:

A good custom 404 error page can decrease the user frustration by breaking it to them gently and help them return to your home page, or easily report the problem to you. Adding a little creativity and humour to the page helps as well.

Detection

You can validate your internal and external links manually by using an online link checker, such as W3C link checker.

You can add an existing library to your project to check for broken links on your site automatically, either from Nuget(.NET) or NPM(Javascript).

You can also refactor your code to automatically check your website for broken links.