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