views:

29

answers:

1

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.

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.

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

The ! will exclude drupal_directory and robots.txt etc...

Robert
I think this is the exact opposite of what I'm trying to do... I want the drupal directory to be included in the rewrite rule so that drupal's index.php is not directly called. It's hard to explain why...
msumme
Oh, sorry then. If you remove the ! then only the things listed will be sent to index.php.
Robert