Phalcon in the multi-module, the official website gave such an example, the URL for the MVC application (MVC applications)
However, there is no mention of the two-level domain name configuration method, here just said two module configuration it?
The official website gives two modules, the domain name should be like this: first, http://www.webtest.com/rfrontend/controller/action
Second, http://www.webtest.com/backend/controller/action
But that's not what I want, I want a two-level domain.
First, http://www.webtest.com/controller/action for the front page
Second, http://backend.webtest.com/controller/action for the background page
Like the general Web site has a two-level domain-level configuration for PC and mobile stations so that
PC Domain: http://www.webtest.com/controller/action
Mobile Station: Http://m.webtest.com/controller/action
Q: In the Phalcon framework, how to implement such a two-level domain name configuration? Thank you.
Reply content:
Phalcon in the multi-module, the official website gave such an example, the URL for the MVC application (MVC applications)
However, there is no mention of the two-level domain name configuration method, here just said two module configuration it?
The official website gives two modules, the domain name should be like this: first, http://www.webtest.com/rfrontend/controller/action
Second, http://www.webtest.com/backend/controller/action
But that's not what I want, I want a two-level domain.
First, http://www.webtest.com/controller/action for the front page
Second, http://backend.webtest.com/controller/action for the background page
Like the general Web site has a two-level domain-level configuration for PC and mobile stations so that
PC Domain: http://www.webtest.com/controller/action
Mobile Station: Http://m.webtest.com/controller/action
Q: In the Phalcon framework, how to implement such a two-level domain name configuration? Thank you.
Domain name and framework it's okay.
The two-level domain name to do DNS resolution to the specified server IP, if two domain names on the same server with Nginx configuration multi-domain binding.
If you have such a domain name, you can look at: Configure app1.domain.com and app2.domain.com multiple Web apps on the same server
$router->add ('/:controller/:action/:p arams ', Array (' module ' = ' Module1 ', ' controller ' = 1, ' action ' = 2, ' Params ' = 3)->sethostname (' module1.site.com ');
$router->add ('/:controller/:action/:p arams ', Array (' module ' = ' module2 ', ' controller ' = 1, ' action ' = 2, ' Params ' = 3)->sethostname (' module2.site.com ');
Try it on trial.