Index: html/includes/common.inc
===================================================================
--- html/includes/common.inc (revision 7001)
+++ html/includes/common.inc (working copy)
@@ -343,26 +343,9 @@
watchdog('page not found', check_plain($_GET['q']), NULL, WATCHDOG_WARNING);
- // Keep old path for reference.
- if (!isset($_REQUEST['destination'])) {
- $_REQUEST['destination'] = $_GET['q'];
- }
-
- $path = drupal_get_normal_path(variable_get('site_404', ''));
- if ($path && $path != $_GET['q']) {
- // Set the active item in case there are tabs to display, or other
- // dependencies on the path.
- menu_set_active_item($path);
- $return = menu_execute_active_handler($path);
- }
-
- if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
- drupal_set_title(t('Page not found'));
- $return = t('The requested page could not be found.');
- }
-
- // To conserve CPU and bandwidth, omit the blocks.
- print theme('page', $return, FALSE);
+ global $conf;
+ include_once $conf['404_file'];
+ exit;
}
/**
Index: html/.htaccess
===================================================================
--- html/.htaccess (revision 7001)
+++ html/.htaccess (working copy)
@@ -13,15 +13,9 @@
# Follow symbolic links in this directory.
Options +FollowSymLinks
-# Make Drupal handle any 404 errors.
-ErrorDocument 404 /index.php
+# Use a custom 404 file, instead of Drupal
+ErrorDocument 404 /sites/all/modules/custom/library/404.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
@@ -101,7 +95,14 @@
# RewriteBase /
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
+
RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_URI} !^/files/
+ RewriteCond %{REQUEST_URI} \.(txt|png|gif|jpe?g|shtml?|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$
+ RewriteCond %{REQUEST_URI} !^404.%1$
+ RewriteRule ^(.*)$ 404.%1 [L]
+
+ RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
- RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]