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
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communitycustom_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(&$path, &$options, $original_path) {
if (preg_match('|^search/([^/]+)/(.+)|', $path, $matches)) {
$path = 'search/' . $matches[1] . '/' . $matches[2] . '.html';
}
}
function custom_url_rewrite_inbound(&$result, $path, $path_language) {
if (preg_match('|^search/([^/]+)/(.+)\.html$|', $path, $matches)) {
$result = 'search/' . $matches[1] . '/' . $matches[2];
}
}