Magento控制器:indexAction有效,但所有其他操作返回404


Magento controller: indexAction works but all other Actions return 404

我有一个自定义模块,它带有一个几乎不需要操作的控制器。例如:testAction,indexAction等等。

我可以使用访问indexAction

www.example.com/module/controller/

www.example.com/module/controller/index

但所有其他操作,例如(www.example.com/module/controller/test)返回404找不到页面。

有趣的是,当我更改Magento数据库时,一切都正常(我可以访问所有操作),而不会更改代码(我有两个数据库,它可以通过测试,但无法通过实时测试)。

在主题布局xml 中尝试此操作

<module_controller_action translate="label">
   <reference name="content">
      <block type="core/template" name="name" template="path/to/form.phtml"/>
   </reference>
</module_controller_action>

 public function testAction() {
    $this->loadLayout();
    $this->renderLayout();
 }
相关文章: