Index: .htaccess =================================================================== RCS file: /cvs/drupal/drupal/.htaccess,v retrieving revision 1.109 diff -u -p -r1.109 .htaccess --- .htaccess 5 May 2010 06:15:59 -0000 1.109 +++ .htaccess 16 Jul 2010 19:30:39 -0000 @@ -16,12 +16,6 @@ Options +FollowSymLinks # Make Drupal handle any 404 errors. ErrorDocument 404 /index.php -# Force simple error message for requests for non-existent favicon.ico. - - # There is no end quote below, for compatibility with Apache 1.3. - ErrorDocument 404 "The requested file favicon.ico was not found. - - # Set the default handler. DirectoryIndex index.php index.html index.htm Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.409 diff -u -p -r1.409 bootstrap.inc --- includes/bootstrap.inc 10 Jul 2010 17:27:50 -0000 1.409 +++ includes/bootstrap.inc 16 Jul 2010 19:30:40 -0000 @@ -2301,6 +2301,28 @@ function drupal_maintenance_theme() { } /** + * Returns a simple 404 Not Found page. + * + * If fast 404 pages are enabled, and this is a matching page then print a + * simple 404 page and exit. + * + * This function is called from drupal_deliver_html_page() at the time when a + * a normal 404 page is generated, but it can also optionally be called directly + * from settings.php to prevent a Drupal bootstrap on these pages. See + * documentation in settings.php for the benefits and drawbacks of using this. + */ +function drupal_fast_404() { + $fast_paths = variable_get('404_fast_paths', FALSE); + if ($fast_paths && preg_match($fast_paths, $_GET['q'])) { + drupal_add_http_header('Status', '404 Not Found'); + $fast_404_html = variable_get('404_fast_html', '404 Not Found

Not Found

The requested URL "@path" was not found on this server.

'); + // Replace @path in the variable with the page path. + print strtr($fast_404_html, array('@path' => check_plain(request_uri()))); + exit; + } +} + +/** * Return TRUE if a Drupal installation is currently being attempted. */ function drupal_installation_attempted() { Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1192 diff -u -p -r1.1192 common.inc --- includes/common.inc 16 Jul 2010 02:37:05 -0000 1.1192 +++ includes/common.inc 16 Jul 2010 19:30:40 -0000 @@ -2392,11 +2392,14 @@ function drupal_deliver_html_page($page_ // @todo: Break these up into separate functions? switch ($page_callback_result) { case MENU_NOT_FOUND: + watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); + + // Check for and return a fast 404 page if configured. + drupal_fast_404(); + // Print a 404 page. drupal_add_http_header('Status', '404 Not Found'); - watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING); - // Keep old path for reference, and to allow forms to redirect to it. if (!isset($_GET['destination'])) { $_GET['destination'] = $_GET['q']; @@ -2413,7 +2416,7 @@ function drupal_deliver_html_page($page_ if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) { // Standard 404 handler. drupal_set_title(t('Page not found')); - $return = t('The requested page could not be found.'); + $return = t('The requested page "@path" could not be found.', array('@path' => request_uri())); } drupal_set_page_content($return); Index: modules/locale/locale.test =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v retrieving revision 1.73 diff -u -p -r1.73 locale.test --- modules/locale/locale.test 26 Jun 2010 19:55:47 -0000 1.73 +++ modules/locale/locale.test 16 Jul 2010 19:30:40 -0000 @@ -260,9 +260,8 @@ class LocaleTranslationFunctionalTest ex $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.')); // Reload to remove $name. $this->drupalGet($path); - $this->assertNoText($langcode, t('Language code not found.')); - $this->assertNoText($name, t('Name not found.')); - $this->assertNoText($native, t('Native not found.')); + // Verify that language is no longer found. + $this->assertResponse(404, t('Language no longer found.')); $this->drupalLogout(); // Delete the string.