I would like to know if it is possible to change the default route of :module/:controller/:action/* to something like /my/prefix/:module/:controller/:action/*, keeping the possibility to not specify a module and/or controller and/or action.

有帮助吗?

解决方案

You can set baseUrl in application.ini

resources.frontController.baseUrl = "my/prefix/"

and you can ofcourse not specify module/controller/view but it will be default one = default/index/index unless you set up different default module/controller/view.

其他提示

You have to setup the front controller resource in the application ini.

resources.frontController.baseurl = "/my/prefix/"

Another thing you can do is add the prefix to each route in your resource router like this:

resources.router.routes.route-name.route = "/my/prefix/module/controller/action"
resources.router.routes.route-name.defaults.module = "module"
resources.router.routes.route-name.defaults.controller = "controller"
resources.router.routes.route-name.defaults.action = "action"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top