我想航線我的網址/resolution/index/res/1024x768
到/resolution/1024x768
在application.ini
路由代碼:Zend框架的路由問題
resources.router.routes.resolution.route = '/resolution/:res/'
resources.router.routes.resolution.type = "Zend_Controller_Router_Route"
resources.router.routes.resolution.defaults.module = default
resources.router.routes.resolution.defaults.controller = resolution
resources.router.routes.resolution.defaults.action = index
resources.router.routes.resolution.defaults.res=
的問題是,它在我的本地計算機上,但不是在我的主機工作。 此網址mysite.com/resolution/index/res/1024x768
有效,但/resolution/1024x768
沒有。我還需要在生產環境中做些什麼?
訪問/resolution/1024x768
當我得到後續請求參數:
Request Parameters:
array (
'controller' => 'resolution',
'action' => '1024x768',
'module' => 'default',
)
更新:怪異因爲它可能聲音,在需要上述路由代碼的第一行被置於雙引號內,像這樣:
resources.router.routes.resolution.route = "/resolution/:res/"
哪些是在本地主機相同的URL請求參數? – emaillenin 2011-06-02 05:44:08
嘗試改變你的路線'分辨率/:res'(沒有斜線) – emaillenin 2011-06-02 05:52:23
@emaillenin試過,沒有工作 – anp 2011-06-02 08:43:41