2

我根据域名设置语言(en 表示 en.example.com,tr 表示 tr.example.com):

resources.router.routes.plain.type = "Zend_Controller_Router_Route"
resources.router.routes.plain.route = "/:module/:controller/:action"
resources.router.routes.plain.defaults.language= "en"
resources.router.routes.plain.defaults.module = "content"
resources.router.routes.plain.defaults.controller = "index"
resources.router.routes.plain.defaults.action = "index"

resources.router.routes.plain1.type = "Zend_Controller_Router_Route"
resources.router.routes.plain1.abstract = 1
resources.router.routes.plain1.route = "/:module/:controller/:action/*"
resources.router.routes.plain.defaults.module = "content"
resources.router.routes.plain.defaults.controller = "index"
resources.router.routes.plain.defaults.action = "index"

resources.router.routes.dom0.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.dom0.abstract = 1
resources.router.routes.dom0.route = "en.example.com"
resources.router.routes.dom0.defaults.language= "en"
resources.router.routes.chn1.type = Zend_Controller_Router_Route_Chain
resources.router.routes.chn1.chain = "dom0, plain1"

resources.router.routes.dom1.type = "Zend_Controller_Router_Route_Hostname"
resources.router.routes.dom1.abstract = 1
resources.router.routes.dom1.route = "tr.example.com"
resources.router.routes.dom1.defaults.language= "tr"
resources.router.routes.chn2.type = Zend_Controller_Router_Route_Chain
resources.router.routes.chn2.chain = "dom1, plain1"

这里的问题是,当我只使用模块名调用 url 而没有指定控制器或操作时:tr.example.com/content/ 我将语言设置为“en”

但是当我使用模块名称、控制器和操作调用时:tr.example.com/content/article/read 一切都很好

我做错了什么?

提前致谢

4

1 回答 1

1

您尚未为 plain1 指定默认模块、控制器和操作。

于 2011-10-19T15:00:30.883 回答