开发者

.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 subdirecto开发者_C百科ry'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.


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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜