Router for custom module not being recognized by Magento

2.5k views Asked by At

I am following this tutorial to create a custom module. For some reason i can't get magento to recognize the routers( i get a Magento 404 error) when i hit http://exmaple.com/helloworld/index/index. I've verfied that the module is enabled in the Admin. There's only 2 files for this tut config.xml and IndexController.php. Thank you in advance!

Module is in /code/local/Russ/Helloworld

/etc/config.xml

<config>
    <modules>
        <Russ_Helloworld>
            <version>0.1.0</version>
        </Russ_Helloworld>
    </modules>

    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>Russ_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>
    </frontend>

</config>

controllers/IndexController.php

<?php

class Russ_Helloworld_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction() {
        echo 'Hello Index!';
    }

}

?>

Magento 1.6.2

2

There are 2 answers

2
MagePsycho On

Make sure that Store Code is not allowed to the URL:
(System > Configuration > Web > Add Store Code to Urls = No)

Thanks

0
dannosaur On

Did you put a config file in app/etc/modules to activate the extension? You'll need this file to tell Magento that your extension even exists.

Try put this in app/etc/modules/Russ_Helloworld.xml

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

Then, clear Magento's cache and it should pick it up.