Yesterday we reviewed how to find broken links on your website. Today we’ll review how to redirect broken links to useful pages.
When changing the actual link pointing to your site is A) impossible (you don’t own the site.) or B) impractical (this change needs to happen in many places), a good idea is to try to systematically redirect the traffic using .htaccess or Meta Tags. Our strategy will be based on free, accessible tools and redundant system design.
Strategy: Fix your links and those who link to you.
Step 1 : Find out what is broken.
Here’s an easy guide to broken link testing.
Step 2: Locate the Correct Web page or Create a new one.
You’ll need the correct address to redirect to. Even if you’ve deleted the page, it’s a great idea to create a new one. Links are precious things!
Step 3 : Create a .htaccess redirect for each page or folder that is broken.
Indiana University has a great post I reference on .htaccess redirection here.
Step 4 : Create a meta tag redirect for each page.
Even if you have a .htaccess redirect, you may want to hedge your bets and create a redirecting landing page. In other words, create a page with the exact filename as the one in the mistaken link and use it to redirect to the correct page. Again, Indiana University has a great meta tag redirect tutorial here.
Note: You should also create landing pages for any new directories you are creating as well as .htaccess redirects for them as well. For example, if there is a mistaken link to yoursite.com/files/somepage.html, you should create an index file at yoursite.com/files/index.html.
Step 5: Extra credit
You will never be able to anticipate all the possible typos people may put in links to your site. A great strategy is to create a site-wide 404 error page to act as a graceful catch-all for any missing links. Putting a search function so users can look for exactly what they want on your site is a great mitigation strategy as well. Both of these could be posts of their own. If they’d be helpful, please let me know in the comments section below.