How to create a sub-domain in CakePHP?

前端 未结 3 1584
渐次进展
渐次进展 2021-01-06 04:59

CakePHP version-2.5.5

My domain name is http://www.thechatfun.com

Profile page link - http://www.thechatfun.com/users/profile

Chat page

3条回答
  •  不知归路
    2021-01-06 05:27

    profile.thechatfun.com and www.chat.thechatfun.com are different domains. It's possible for a single http server to handle both of these domains, but it won't happen automatically.

    Assuming your webserver is Apache, you will first need to configure the webserver to handle these domains correctly. You can add a VirtualHost directive so that both of these domains are handled by the same Virtual Host and share a document root, or you can add a Virtual Host for each and have separate document root directories for each domain.

    Your webserver first receives the HTTP request, then passes the request to PHP for processing. So, if your webserver isn't configured properly to handle these domains, you won't have the ability to control this in PHP or CakePHP.

提交回复
热议问题