diff --git a/.htaccess b/.htaccess
index 9c4a161..4ca69ea 100644
--- a/.htaccess
+++ b/.htaccess
@@ -16,9 +16,6 @@ Options +FollowSymLinks
 # Multiviews creates problems with aliased URLs and is not needed for Drupal.
 Options -Multiviews
 
-# Make Drupal handle any 404 errors.
-ErrorDocument 404 /index.php
-
 # Force simple error message for requests for non-existent favicon.ico.
 <Files favicon.ico>
   # There is no end quote below, for compatibility with Apache 1.3.
@@ -61,6 +58,13 @@ DirectoryIndex index.php index.html index.htm
   </FilesMatch>
 </IfModule>
 
+<IfModule !mod_expires.c>
+  # When mod_rewrite is enabled, all requests (including those generating 404
+  # errors) are passed on to index.php. But when mod_rewrite is disabled, we
+  # explicitly define a 404 handler.
+  ErrorDocument 404 /index.php
+</IfModule>
+
 # Various rewrite rules.
 <IfModule mod_rewrite.c>
   RewriteEngine on
