1

在项目中,我有很多控制器,例如 Index、Member、Download。

现在我想将 www.test.com/index/product 之类的网址设为 www.test.com/product

但不想将网址 www.test.com/member/signup 更改为 www.test.com/signup

PS:我在application.ini中添加了4行

resources.router.routes.default.chains.index.type = "Zend_Controller_Router_Route"
resources.router.routes.default.chains.index.route = ":controller/:action/*"
resources.router.routes.default.chains.index.defaults.controller = "index"
resources.router.routes.default.chains.index.defaults.action = "index"

困扰了我很多天,希望有人指出

4

1 回答 1

2

假设您实际上没有产品控制器,您可以添加以下内容:

resources.router.routes.default.chains.index.type = "Zend_Controller_Router_Route"
resources.router.routes.default.chains.index.route = "product/"
resources.router.routes.default.chains.index.defaults.controller = "index"
resources.router.routes.default.chains.index.defaults.action = "product"

现在www.test.com/index/productwww.test.com/product都可以工作并最终在同一个地方。

于 2013-03-28T19:57:01.290 回答