Tuesday, August 24, 2010

How to find the Broken links in a website

Borken links identification in a website
As i have created a website live cricket scores, my interest gradually increased to maintain that to the perfect. In this jorney I have just came accross how to check the broken links for the website and what measures needs to be taken to prevent or eliminate that.
When I did my basic research I got the following stuff, which might be useful for every website moderator.

How to check the Broken Links in a website?

I used the following websites with which I hvae tested and got the list of broken links
  1. See LinkChecker for Firefox, some more info you can get at this link http://www.kevinfreitas.net/extensions/linkchecker/
  2. For Windows there is Xenu's Link Sleuth.
  3. For Mac, Integrity link Checker http://peacockmedia.co.uk/integrity/  (personally I have not used this,i dont know what to comment on this).
Other tools which gave me some stuff was
  1. W3C Link Checker.
  2. Even Google Webmaster will give you the crawl errors, you can try that.
There are times that i try to write my own spider to check this, the algorithm looks like following
// Alogorithm to recursively check for broken links  and log all errors at one file

// First get the Url of the page,
function check_links($page)
{
         $html = fetch_page($page);
         if(!$html)
        {
                   // Log page to failures log
                  ------------
                  ------------
        }
       else
       {
            // Find all html, img, etc links on page
            $links = find_links_on_page($html);

          foreach($links as $link) {
        
                    check_links($link);
         }
      }

}

If you are very eager to develop a own spider this algorithm will help you a bit.

Thats all about the link checker.