404 Controller Page not found using Magento

I created these files ... based on the TutsPlus Premium Magento Tutorial
I am using the latest Magento right now.

File path

\ App \ code \ Local \ TutsPlus \ Demo \ and etc.

these are codes

config.xml

<config>
    <global>
        <models>
            <demo>
                <class>TutsPlus_Demo_Model</class>
            </demo>
        </models>

        <blocks>
            <demo>
                <class>TutsPlus_Demo_Block</class>
            </demo>
        </blocks>

        <helpers>
            <demo>
                <class>TutsPlus_Demo_Helper</class>
            </demo>
        </helpers>

    </global>

    <frontend>
        <routers>
            <tutsplus_demo>
                <use>standard</use>
                <args>
                    <module>TutsPlus_Demo</module>
                    <frontName>demo</frontName>
                </args>
            </tutsplus_demo>
        </routers>
    </frontend>

</config>

      


App \ Code \ Local \ TutsPlus \ Demo \ Controllers

these are codes

IndexController.php

<?php

class TutsPlus_Demo_IndexController extends Mage_Core_Controller_Front_Action {

    public function sayHelloAction() {
        echo "Hello Junar";
    }

}

      

The output should be: Hi Junar, but this gives me a 404 not found page

+3


source to share


3 answers


You have a file to include your module in

app / etc / modules / TutsPlus_Demo.xml?

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

      



, you must enable your module first for your module to work.

you can call it on request of this url.

http://yourdomain/yourmagento/demo/index/sayHello

      

+1


source


try:



<config>
    <global>
        <models>
            <demo>
                <class>TutsPlus_Demo_Model</class>
            </demo>
        </models>

        <blocks>
            <demo>
                <class>TutsPlus_Demo_Block</class>
            </demo>
        </blocks>

        <helpers>
            <demo>
                <class>TutsPlus_Demo_Helper</class>
            </demo>
        </helpers>

    </global>

    <frontend>
        <routers>
            <demo>
                <use>standard</use>
                <args>
                    <module>TutsPlus_Demo</module>
                    <frontName>demo</frontName>
                </args>
            </demo>
        </routers>
    </frontend>

</config>

      

+1


source


I dare to suggest that, assuming you have a typo in your question, the problem is with your file controller name:

IndexController.xml should be ----> IndexController.php

+1


source







All Articles