Thanks, I’ll give that a try, the reason I’m trying to do this to allow me to run the same codebase on different sites but serve different content based on the domain.
If anyone’s tried this before I’d love any tips they could give me
I found this post attempting to do something similar. I was able to get it to work by moving the Yii entry script (index.php) and the default .htaccess up from the subdirectory to the webroot (so that they reside directly under public_html). Once you move index.php and .htaccess to the root directory, all web requests will be routed directly to index.php under webroot (rather than to the subdirectory), thus eliminating the /subdirectory part of the url.
After you move the files, you will need to edit index.php to update the references to the yii.php file (under the Yii framework directory) as well as the Yii config file (main.php). Lastly, you will need to move the assets directory to directly the webroot, since by default, Yii expects the assets directory to be located in the same location as the entry script).
That should be all you need to do, but if you need more details, I describe the approach fully here:
I have two websites (podcast.newsradio1620.com & podcast.catcountry987.com) that use the same site to function. The only difference is the index.php file sets a theme and db connection based on the request containing newsradio or catcountry. I have a basic config file that I merge_array with station specific config.
The web server has two virtual hosts that both point to the index.php file/