开发者

Zend Framework: set Module as Subdomain

开发者 https://www.devze.com 2023-01-23 11:40 出处:网络
I want to create routes to also get links like: my.site.com(/:controller/:action) admin.site.com(/:controller/:action)

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_Rout开发者_如何学Pythone"
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 do I fix this?

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


I had a similar problem using wildcard subdomains on a local enviroment. I was sure of my routing however the hosts file didin't contain the subdomain. This worked for me

127.0.0.1  mydomain.local
127.0.0.1  subdomain.mydomain.local
0

精彩评论

暂无评论...
验证码 换一张
取 消