How to configure the level two domain name in Phalcon project?

Source: Internet
Author: User
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.