CakePHP multisite (e.g. WPMU + domain mapping) ... maybe?

So, I am just starting to play with CakePHP and wonder if the following is possible:

A single Cake installation, with a super login login. Then, administrators with access to the specified "subsites", as well as the ability to create / edit content and users on these subsites. Finally, the ability to match domain names (not subdomains, but unique domains) with routes; so instead of mysite.com/subsite/posts/1 it will just be newdomain.com/posts/1

Essentially, I want to replicate the experience of using multi-user Wordpress (with domain conversion).

Is it possible? If so, what should I look at?

+2
source share
1 answer

Sure. You can even use the same set of code and just configure specific domains to point to the code. Then, in the code base, associate the domain identifier with each user and content so that he knows where he belongs. You can have admin users for all domains. Then, when you add regular users, you can specify which domain they belong to.

You can set the domain check in the Config / bootstrap.php file, and then configure the domain as follows:

Configure::write('domain_id', 'someDomainSpecificID'); 

Then you need to support only one set of codes and one database from many domains.

If the domains must be physically separated, you can configure one place for ADMIN users (a single database) and run everything against it.

There are many ways you could create it, it just depends on your specific needs. It sounds like a cool project.

+1
source

Source: https://habr.com/ru/post/977685/


All Articles