2 Sites + Backend In 1 App

I have 2 webites that use the same code, but different themes. I’ve been looking at Yii2 and think I can do the same thing, with 2 ‘frontends’. The 2 sites are sub domains of my main site, which is on a hosted server.

I will need at least 1 backend, but I’m not sure how I can access the backend without a sub.sub.domain.

Can anyone help me out on this?

No sub.sub.domain required.

You can use Kartik-v’s yii2-app-practical-a template instead of the Advanced template. Also read the url.md section called “Parameterized hostnames” in the definitive guide. Read the comments under the yii2-app-practical-a description in the Extension area of this site. Put common models, extensions, and modules that are shared among your domain and subdomains including backend under the common directory structure. Create the basic structure for each new subdomain by copying and renaming frontend/ as many times as required. Create your web/ files in the same fashion as backend/.

You can administer all of your applications (i.e., subdomains) from a single backend application.

I’m a bit short of time tonight or would elaborate more, but ask questions if you need more information.

The way I understood /frontend, /backend; was that you set the vhost for say podcast.newsradio1620.com to point to /frontend/www. It seemed like the Yii designers then wanted admin.newsradio1620.com to point to /backend/www, instead of the Yii1 way of podcast.newsradio1620.com/admin. I’m just trying to get my mind translating old way to new way.

I’m looking for how to translate it out of the box. Way do I need an add on? I understand that someone has figured this out, but it just seems like I have to add a bunch of stuff to make this work, when I didn’t with 1.1. Just seems strange.