mod_rewrite virtual directory to particular controller

I have a Yii site installed on folder "yiisite" which is directly under document root of my site "". This site has a controller "controller".

I want visitors to be able to access particular part (controller) of this yii site by using a virtual direcotry "fakedir".

So that requests like




would get rewritten to




A simple rule like:

fakedir(.*)$ /yiidir/index.php/controller/$1 [QSA]

Does not work. No matter what I enter after "fakedir", it always resolves to base action (index.php) as if there was nothing there.

How can I solve this problem?




Or is this practically impossible?

Could it be something related to PHP’s $_SERVER[‘REQUEST_URI’] and $_SERVER[‘REQUEST_URL’] not getting properly populated with what’s included in rewritten URL?