Zend Framework: install the module as a subdomain

I want to create routes to also get links like:

  • my.site.com (/: controller /: action)
  • admin.site.com (/: controller /: action)

I tried to add:

resources.router.routes.www.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.www.route = ":module.nameofmysite.com"
resources.router.routes.www.defaults.module = "default"
resources.router.routes.www.chains.index.type = "Zend_Controller_Router_Route"
resources.router.routes.www.chains.index.route = ":controller/:action/*"
resources.router.routes.www.chains.index.defaults.controller = "index"
resources.router.routes.www.chains.index.defaults.action = "index"

But nothing happens. (Server not found), how can I fix this?

I read the zend documentation about this, but I still can't get it to work.

+3
source share
1 answer

I had a similar problem using wildcard subdomains on a local environment. I was sure of my routing, however the hosts file did not contain a subdomain. It worked for me

127.0.0.1  mydomain.local
127.0.0.1  subdomain.mydomain.local
+3
source

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


All Articles