How to make Drupal 6 search result URL have ".html" at the end? I want the search result URL become

http://www.site.com/search/node/Search for something.html
http://www.site.com/search/node/cars.html


I've looked into custom_url_rewrite_outbound() but there is not much I can understand
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];
  }
}