1

This is my activation file, in app/etc/modules/My_Test.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <My_Test>
            <active>true</active>
            <codePool>local</codePool>
        </My_Test>
    </modules>
</config>

This is my config file in app/code/local/MY/Test/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>

        <helpers>
            <my_test>
                <class>My_Test_Helper</class>
            </my_test>
        </helpers>
        <models>
            <mytest>
                <class>My_Test_Model</class>
            </my_test>
        </models>
        <blocks>
            <my_test>
                <class>My_Test_Block</class>
            </my_test>
        </blocks>
    </global>

    <frontend>
        <routers>
            <my_test>
                <use>standard</use>
                <args>
                    <module>My_Test</module>
                    <frontName>test</frontName>
                </args>
            </my_test>
        </routers>
    </frontend>

</config>

This is my controllers code in app/core/local/My/Test/controllers/IndexController.php

<?php
class My_Test_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        echo "This is the Module MyTest";
    }
}

Now when i am giving the url 176.58.99.99/herbal/index.php/test/index/index 176.58.99.99/herbal/index.php/test/ 176.58.99.99/herbal/test/index/index 176.58.99.99/herbal/test/

Its showing 404 error

4

2 回答 2

1

你说你的控制器位于app/core/local/My/Test/controllers/IndexController.php它应该放置如下:app/code/local/My/Test/controllers/IndexController.php

于 2012-09-19T06:36:22.880 回答
0

我有同样的问题,但就我而言,这是关于文件权限的。确保您的文件和目录具有适当的访问权限,否则,magento 将永远无法读取这些文件。

于 2015-08-05T19:53:55.280 回答