I’ve never tried that, but if I understand it correctly, you basically have a single Kirby installation, only your /site, /content, thumbs/ and /assets/avatars folders contain subfolders for each domain, e.g.
So that gives me common folders used by all three sites, so the core/assets/templates/blueprints/panel can all be updated at once.
With the setup above, every client can manage their own content, but all three sites are actually being powered by the same core/template/plugin files.
Ok, I briefly tested this locally with Mamp and got it to work:
Use the example site.php and put it into the root of your kirby install. Change domains to fit your setup, I used fake domains called domain-1.com and domain-2.com
Create subfolders with those domain names like I explained above, i.e.
I used the starterkit as a basis, so I moved all the stuff from the original /site and /content folders into /content/domain-1.com and site/domain-2.com and then copied and pasted the stuff into the /content/domain-2.com and /site/domain-2.com
In my /etc/hosts file I added the following lines:
127.0.0.1 domain-1.com
127.0.0.1 domain-2.com
In my httpd-vhosts.conf file I added the Virtual hosts (Mamp/conf/apache/extra):
@heyallan: If you don’t need different templates etc. you can also use a setup as described by @samnabi. In that setup, only the content folder is different for the domains, all the rest (templates, snippets, configuration, thumbs etc.) is shared by the different domains.
@samnabi Yes, that’s right, but what I meant to say was that if you want to share templates across sites, you don’t need to have different template folders (no matter where you put them).
I think it worked like this because /etc/hosts file takes both domains to 127.0.0.1, that’s where MAMP is running with a kirby installation. Then site.php handles both domains. Good.
I think vhosts settings didn’t take any effect because it assumes port :80, and I had MAMP set to default :8888, I made them match and it worked. There’s tricky configurations everywhere.
In my case, I’m interested in having same kirby installation for both domains.
Then… if hosts, and site.php, makes it all work seamlessly, is vhosts really necessary?
I get the feel that vhosts is used in other kind of websites where no site.php exist, or where domains will contain separate contents.
I’m new to this, I’m not sure if I’m getting it right.