I have a working Yii app which has resides in the document root of the hosting account, all working happily at the primary domain.
Now I want to add a development version. I want http://dev.example.com/ to refer to a Yii app located in the /dev directory of the same account.
To clarify, here’s how I want things to work:
http://example.com shows a self contained app which resides at the document root (e.g. /http_docs/)
http://dev.example.com shows another self contained app which resides at /http_docs/dev/
There is no overlap between these applications - i.e. they use different databases, and are completely separate implementations of Yii, yet the virtual server on the hosting account does not distinguish between the two domains - they both resolve to the same directory on the host.
I want the app on the dev. subdomain to be accessible without /dev in the path. So I am trying to pull the /dev out of the href and src attributes wherever they appear. I seem to have been successful with the href in the <a> tags, as all my links are appearing correctly (i.e. http://dev.example.com/index.php as opposed to http://dev.example.com/index.php); however all my css files are still being linked to at /dev/css rather than just /css.
In my main config file, I have the following for urlManager:
'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'baseUrl'=>'', 'rules'=>array( 'user/<user:[\w\.]+>'=>'profile/show', ... ), ),
The baseUrl specification there seems to have applied correctly to the createUrl() method, however, where is the best place to call Yii::app()->setBaseUrl() for the other URLs that don’t go thru the urlManager?
It is on a Zeus server, which means standard Apache rewrites aren’t applicable. However I am generally capable of writing the rewrite rules, and the site is working quite well in spite of this single hiccup.