Need a sitewide php link validator

DewChugr

Photoshop God
Jun 26, 2006
1,977
66
0
48.655139,-119.644032
I have a site with many pages and I need to check it for bad links. Any one have experience with a good php script that will crawl a site and display all bad links with the page they are on, codes for invalid, moved, etc. Ideally it would be able to ignore specified directories and be fairly fast.
 


It's fairly simple to create this php script.. go thru all your page list and crawl for those keyword (moved, 404, etc) if exist then page is broken... here's the script :

Code:
<?php
$myFile = "listofpages.txt";
$fh = fopen($myFile, 'r');
if($fh) {
  while(!feof($fh)) {
    $url = fgets($fh);
    $result = simple_curl($url);
    if (preg_match("404",$result)) echo "<br>$url doesn't exist";
  }
}
fclose($fh);
?>
 
To much work. I just used Xenu.

It's fairly simple to create this php script.. go thru all your page list and crawl for those keyword (moved, 404, etc) if exist then page is broken... here's the script :

Code:
<?php
$myFile = "listofpages.txt";
$fh = fopen($myFile, 'r');
if($fh) {
  while(!feof($fh)) {
    $url = fgets($fh);
    $result = simple_curl($url);
    if (preg_match("404",$result)) echo "<br>$url doesn't exist";
  }
}
fclose($fh);
?>