Zend Framework:将模块设置为子域
我想创建路由来获取如下链接:
- my.site.com(/:controller/:action)
- admin.site.com(/:controller/:action)
我尝试添加:
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"
但没有任何反应..(服务器没有发现),我该如何解决这个问题?
我已经阅读了有关此的 zend 文档,但我仍然无法让它工作。
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 do I fix this?
I've read the zend documentation about this but I still can't get it to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在本地环境中使用通配符子域时遇到了类似的问题。我确信我的路由,但是主机文件不包含子域。这对我有用
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