Index: .htaccess =================================================================== RCS file: /cvs/drupal/drupal/.htaccess,v retrieving revision 1.75 diff -u -F^f -r1.75 .htaccess --- .htaccess 14 Jul 2006 01:03:28 -0000 1.75 +++ .htaccess 12 Aug 2006 12:10:19 -0000 @@ -8,6 +8,11 @@ Deny from all +# This overrides the Drupal 404 handler for files that should never be handled by Drupal + + ErrorDocument 404 default + + # Don't show directory listings for URLs which map to a directory. Options -Indexes @@ -83,6 +88,7 @@ #RewriteRule module.php index.php?q=%1 [L] # Rewrite current-style URLs of the form 'index.php?q=x'. + RewriteCond %{REQUEST_FILENAME} !\.(png|gif|jpe?g|s?html|css|js|cgi|swf|flv)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Index: index.php =================================================================== RCS file: /cvs/drupal/drupal/index.php,v retrieving revision 1.90 diff -u -F^f -r1.90 index.php --- index.php 27 Jan 2006 18:51:51 -0000 1.90 +++ index.php 12 Aug 2006 12:10:19 -0000 @@ -9,6 +9,12 @@ * prints the appropriate page. */ +// This prevents Drupal from bootstrapping if the request is for a non-existent resource +if (preg_match("/\.(png|gif|jpe?g|s?html|css|js|cgi|swf|flv)$/", $_SERVER['QUERY_STRING'])) { + header('HTTP/1.0 404 Not Found'); + exit(); +} + require_once './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);