M Gholami
M Gholami

Reputation: 971

magento 404 not found

I am new in magento . I fallow its tutorial and create my first module. but it's returns 404 not found:

config.xml file is below:

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

</config>

and Magento_Helloworld.xml is:

<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>

and the controller is :

class Magentotutorial_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {

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

}

now I try

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

and see 404 page! where is the problem?

I cleared cache from admin!

Upvotes: 1

Views: 285

Answers (2)

Eduardo Wutzl
Eduardo Wutzl

Reputation: 26

$ a2enmod rewrite
$ service apache2 restart

Upvotes: 1

Neodan
Neodan

Reputation: 5252

The content of your xml files should looks like this: 'app/etc/modules/Magentotutorial_Helloworld.xml':

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

'app/code/local/Magentotutorial/Helloworld/etc/config.xml':

<?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. controller should be in the 'app/code/local/Magentotutorial/Helloworld/controllers/' directory

Upvotes: 1

Related Questions