--- search404.module	2006-01-27 16:51:41.000000000 -0500
+++ search404.module.new	2006-01-27 16:51:19.000000000 -0500
@@ -35,6 +35,23 @@
 function search404_page() {
   $output = t('<p>The page you requested was not found.</p>');
 
+    include_once('search404.php');
+    $url = request_uri();
+
+    $source_url = parse_url($url);
+    $source = $source_url['path'];
+    $source .= (!empty($source_url['query'])) ? '?' . $source_url['query'] : NULL;
+    // $source .= (!empty($source_url['anchor'])) ? '#' . $source_url['anchor'] : NULL;
+
+    if ($array_order == 'd2s') {
+      $migration = array_flip($migration);
+    }
+
+   if (array_key_exists($source, $migration)) {
+       $destination = ereg_replace('^/', '', $migration[$source]); 
+       drupal_goto($destination);
+    }
+
   if (user_access('search content')) {
     $ignore = array('dump', 'zip', 'avi', 'a');
     
@@ -104,4 +121,4 @@
   return (variable_get('site_404', '') == 'search404');
 }
 
-?>
\ No newline at end of file
+?>
