1

I am trying to create a simnple Hello World Module in Magento 1.9 but i keep getting 404 error.

Please what am i doing wrong?

Below is my code :

config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Practice_ControllerTest>
            <version>0.0.1</version>
        </Practice_ControllerTest>
    </modules>

    <frontend>
        <routers>
            <test_controller>
                <use>Standard</use>
                <args>
                    <module>Practice_ControllerTest</module>
                    <frontName>requestflowtest</frontName>
                </args>
            </test_controller>
        </routers>
    </frontend>

</config>

IndexController.php

<?php

class Practice_ControllerTest_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction(){
        echo '<h1>Hello World</h1>';
    }

}

I cant seem to figure out what i am doing wrong.

Thanks

3

1 Answer 1

0

Your frontend router is not properly declared, you need to replace:

        <test_controller>
            <use>Standard</use>
            <args>
                <module>Practice_ControllerTest</module>
                <frontName>requestflowtest</frontName>
            </args>
        </test_controller>

With:

        <requestflowtest>
            <use>standard</use>
            <args>
                <module>Practice_ControllerTest</module>
                <frontName>requestflowtest</frontName>
            </args>
        </requestflowtest>

Notice the lowercase "s" in "standard"

2
  • Thanks Mate.. I appreciate.. Please could you guide me on how to format codes in here? Commented Sep 27, 2016 at 15:36
  • @user2531490 Select your code and click the preformatted text icon in the WYSIWYG (5th icon from the left) Commented Sep 27, 2016 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.