.htaccess – Rewrite a request to one directory before the request is handled by that directory?

I’m trying to exclude all BUT one directory from a rewrite rule. I want the request to be handled by the index.php file in the root directory which will then include the subdirectory’s index.php file as part of a script after wrapping it with it’s own code.

This is a really strange problem, since I’m trying to wrap Drupal within a WordPress installation so that the existing site structure can stay put, and I can use a custom template to wrap the drupal output in a slightly customized wordpress theme.

Read More

If anybody has any idea how I can do this, I would be very very thankful.

htaccess files seem like arcane arts. Nobody seems to really get them that well, and I am no exception.

Related posts

Leave a Reply

1 comment

  1. RewriteEngine on 
    RewriteCond $1 !^(drupal_directory|robots.txt) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]
    

    The ! will exclude drupal_directory and robots.txt etc…