Right URL rewrite after 404 redirect Is it possible to rewrite the url in a 404 redirect according to the page which is actually being displayed ?

For example, if the non-existent url "/fzenk" is requested, and you have configured the default 404 error page to be the front-page, the url in the address bar after the redirect should be front-page's.

I tried Global Redirect module but it didn't work. Is it possible to do the 404 redirect = URL-rewrite with another module or should we request a new feature ?



Update:

While it is possible to do it, it seems to be a bad idea to rewrite 404 pages url.
Thanks to Krister Andersson answer, I seem to have got it right.

function THEME_preprocess_page(&amp;$variables, $hook) {
   $status = drupal_get_http_header("status");  
   if($status == "404 Not Found") {
      // get the configured 404 error page url :
      $not_found_url = variable_get('site_404');
      unset($_GET['destination']);
      drupal_goto($not_found_url);
   }
}


It will rewrite the url according to the configured default 404 error page, it works with multilingual variable too.