I am using yii to develop an application. I want to have 1 codebase on the server and have that code point to a differet database depending if im in a sub domain. All databases will be identical.
I have a few pages that are on my main site; eg. www.test.com, which point to the main databse, and when the user logs in, point them over to the subdomain, now with the new connection string so the code works as normal for them.
Could someone help me out as to what I need to do to accomplish this please. I have a textbox on the login screen that says "enter your keyword", so it could be boat for example and the code would end up shooting them to "boat.test.com". And then from there how do I make it work with some specific files for that client?
Any help would be appreciated!! Thanks in advance
If you use a LAMP stack, you can set this up fairly easily. Here's how:
Under Windows you can do the same thing, but everything that remains in your document root needs to be duplicated once you move the application out of document root.
Here is an interesting page to read: http://www.yiiframework.com/wiki/116/moving-project-code-outside-of-webroot-plus-multiple-project-support/