Install Yii In Subdirectory

On my hosted server i have several yii websites that use a single yii framework. On this particular one i want to put the yii app in a sub-directory. The only page thats opening is the index, when i go to all other pages like register i get a 404 error page. Must be something with the htaccess file, since its so foreign to me.

directory structure.

i need to be able to put the yii webapp inside the app directory instead of either site1, site2 or site3 directory.




/yiiframework

   /site1

   /site2

   /site3/app



index file




<?php


// change the following paths if necessary

$yii=dirname(__FILE__).'/../../yii/framework/yii.php';

$config=dirname(__FILE__).'/protected/config/main.php';





require_once($yii);

Yii::createWebApplication($config)->run();

.htaccess


Options +FollowSymLinks

IndexIgnore */*

RewriteEngine on

RewriteBase /




# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d


# otherwise forward it to index.php

RewriteRule . index.php

config main.php url manager settings


'urlManager'=>array(

        'urlFormat'=>'path',

                    'showScriptName'=>false,

        'rules'=>array(

            '<controller:\w+>/<id:\d+>'=>'<controller>/view',

                     '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

            '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',


        ),

    ),

what is the error? what is missing?

I figured it out. Had to change RewriteBase from / to /app