hosting subdomain points to folder


I have deployed the basic sample yii app in to the sub domain ( ). Internally points to the folder in the hosting server say ‘/root/[color="#FF0000"]test[/color]’

After the deployment, i can see all the css files point to the URL

How can i configure ‘Yii::app()->request->baseUrl;’, to point directly to my subdomain.

Appreciate your time


Why do you need test subfolder in end of your base url?

This will look for main.css in folder /root/test/test/css/

As I know Yii::app()->request->baseUrl cannot be changed since application located in folder cannot point to other folder…

So, there is two ways:

  1. Put the application in test folder (/root/test/test)

  2. Use old application folder, but fix the link to css file

Hope this helps

Hi Thanks for the details,

But it is not only for the css files, all the links in my site pre-pended with the folder name ‘test’

‘test’ is nothing but the folder in my hosting under root. and i have copied my sample application to that folder and pointing the subdomain to that folder.

I hope i am missing some configuration for these kind of subdomain setup in yii

It would be great if some one get me the solution for this issue

Appreciate your time. Thanks

Yii::app()->request->baseUrl cannot be modified. Maybe you can just define a variable in your index file like :


or use setPathOfAlias()