Config File From Url

I have application like


where yiiApplication is also folder inside www folder (maybe not so important information)

I have two config files inside protected/config/ config1.php and config2.php

config files point to two databases, same structure and different data.

is it possible to supply config parameter in url, something like




and from this url to determine which config file to load with


and then to continue running application like from url without config parameter

Well, you can add a couple of lines of code to index.php, detect config name from request and store it somewhere (cookie, session etc)

that is what i am truing to do, and i need help with those couple of lines.

adding /configX between ‘index.php’ and ‘?controller/action’ seams like correct way of altering url but after loading the first page, static pictures on site are not loaded, and links and buttons dont work.

Links on the page dont have config parameter so next request is without config.

What i figure is that i need to alter some $_SERVER variables before calling Yii::createWebApplication, so that application still thinks it is loaded from url without config parameter, but which ones?

Somehow i see more problems rising with this approach. Search results point to some server variables, with production and development envirnoments, but my applications work on same site. Anyone had simmilar functionality [SOLVED]?

How about sitename/yiiApplication/index.php?config=1 ?