How to make Drupal 6 search result URL have ".html" at the end?
custom_url_rewrite_outbound() is not the only function you need to place in settings.php; you need also custom_url_rewrite_inbound(), which converts back the URL to the one known by Drupal.

For those functions, you can use code similar to the following one:

function custom_url_rewrite_outbound(&amp;$path, &amp;$options, $original_path) {
  if (preg_match('|^search/([^/]+)/(.+)|', $path, $matches)) {
    $path = 'search/' . $matches[1] . '/' . $matches[2] . '.html';
  }
}

function custom_url_rewrite_inbound(&amp;$result, $path, $path_language) {
  if (preg_match('|^search/([^/]+)/(.+)\.html$|', $path, $matches)) {
    $result = 'search/' . $matches[1] . '/' . $matches[2];
  }
}