Yii App On Subfolder Not Working

I have a Yii application on cpanel that is located on /home/domain_folder/public_html/portal/yii_application and I put a .htaccess inside yii_application folder with the following code

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

now I need to rewrite the url using a .htaccess on root folder /home/domain_folder/public_html and remove /portal/yii_application on the url. I tried this one

RewriteEngine on

RewriteCond %{REQUEST_URI} !^/portal/yii_application/

RewriteRule ^(.*)$ portal/yii_application/$1 [L]

but it’s not working it still append portal/yii_application on my url even if I typed on domain.com/admin/site/login, here is my config.php url rule

‘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>'


        ),


    ),

Is there anyone here who can help me with this?

Thanks