I'm trying to put some static html files and directories inside drupal. The mod rewrite keeps sending a 404 file not found back to drupal.

How can I get around this?

Comments

zonker’s picture

This is really not well explained in the docs, particularly if you are running an entire site under drupal. Here's what I have in my httpd.conf for the mod_rewrite section:

        # Various rewrite rules.
        <IfModule mod_rewrite.c>
                RewriteEngine on

                # Rewrite current-style URLs of the form 'index.php?q=x'.
                RewriteCond /usr/local/www/data/drupal/%{REQUEST_FILENAME} !-f
                RewriteCond /usr/local/www/data/drupal/%{REQUEST_FILENAME} !-d
                RewriteRule ^/(.*)$ /index.php?q=$1 [L,QSA]
        </IfModule>

You don't need to bother with RewriteBase, or the rules for older versions of drupal. Also, the last rewriterule is different from the one in .htaccess. I've found it necessary to put in the full pathname of the drupal installation for the rewrite conditions. Make sure to change it to whereever your drupal instance is installed.

This configuration tell drupal to only send URIs to drupal when the file does not already exist.

-nick