A project pointed by many domain, dispatch to different module, and one domain is action as a parent domain

A little hard to descripe my situation, I am trying.

Assume that I have many domain, like www.parent.com, www.child1.com, www.child2.com
One parent and many many child, the domain is totally different, call it parent or child just because their functional differences set by human.

assume I had a laminas mvc project.
parent.com reflect to default module application. and home page in module application
child1.com reflect to module child1. and home page in module child1
child2.com reflect to module child2. and home page in module child2

above requirement can be fixed by laminas’s hostname router.

The following request I can not solve.
child domain’s every path can be visited by parent domain.
reflection like the following:
child1’s index home page visited the same page with parent domain

besides, domain child1.com can not reach other modulce content except child1 module.
other child domain should keep the same rule. each child domain can only access it’s own module content.

I don’t know how to fulfil the above request.

anybody can give some advises?

Register only the modules that the child domain should use. This can be done with different configuration files for each child domain.

thank you!

I found a better way by using nginx proxy to solve my problem.

Before I thought to write a custom router which is similar to hostname router. But it is too hard to me.

Nobody suggested that either, because it would be pointless work.

And what is the solution? Others might also be interested.

sorry that, a little busy yesterday.

The solution as following:
server {
listen 80;
server_name www.child1.com;
location / {
proxy_pass http://www.parent.com/child1/;

I think this might work