找不到magento 404

时间:2015-11-15 17:39:43

标签: php magento magento-1.9

我是magento的新人。我休息它的教程并创建我的第一个模块。 但它没有找到404:

config.xml文件如下:

<?xml version='1.0'?>
<config>    
    <modules>
        <Magentotutorial_Helloworld>
            <version>0.1.0</version>
        </Magentotutorial_Helloworld>
    </modules>

</config>

和Magento_Helloworld.xml是:

<config>
    <modules>
        <Magentotutorial_Helloworld>
            <active>true</active>
            <codePool>local</codePool>
        </Magentotutorial_Helloworld>
    </modules>
    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>Magentotutorial_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>  
    </frontend>
</config>

,控制器是:

class Magentotutorial_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {

    public function indexAction() {
        die( 'Hello Index!');
    }

}

现在我试试

http://127.0.0.1/magento/index.php/helloworld/index/index

并看到404页面!问题出在哪里?

我清除了管理员的缓存!

2 个答案:

答案 0 :(得分:1)

xml文件的内容应如下所示: &#39;应用程序的/ etc /模块/ Magentotutorial_Helloworld.xml&#39;:

<?xml version="1.0"?>
<config>
    <modules>
        <Magentotutorial_Helloworld>
            <active>true</active>
            <codePool>local</codePool>
        </Magentotutorial_Helloworld>
    </modules>
</config>

&#39;应用程序/代码/本地/ Magentotutorial /的Helloworld的/ etc / config.xml的&#39;:

<?xml version="1.0"?>
<config>    
    <modules>
        <Magentotutorial_Helloworld>
            <version>0.1.0</version>
        </Magentotutorial_Helloworld>
    </modules>
    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>Magentotutorial_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>  
    </frontend>
</config>

P.S。控制器应该在&app; / code / local / Magentotutorial / Helloworld / controllers /&#39;目录

答案 1 :(得分:1)

$ a2enmod rewrite
$ service apache2 restart
相关问题