2
votes

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
did you clear your cache in the admin panel?Philip
Did you add the file to app/etc/modules?Alan Storm
Yes i did. I am able to see the custom module among the other modules in the Admin, and it is enabledrussjman
can you show the live link? Or is it hosted locally?Philip
Break the XML in your config.xml, and turn on developer mode (see index.php). Verify a parse error.benmarks

2 Answers

3
votes

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

Thanks

1
votes

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.