2

I disabled Magento cache before I began to work on this.

I can see my module is visible in "System/Configuration/Advance/Disable Modules Output" listing.

But if I call this module as http://localhost/mag/index.php/mymodule/index I get 404 Not Found error.

Can you please point out where I'm doing wrong here? I need to understand why.

Thanks in advance

Here are my codes

app/code/local/Mycompany/mymodule/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>            
        </Mycompany_Mymodule>
    </modules>
    <frontend>
        <routers>
            <mymodule>
                <use>standard</use>
                <args>
                    <module>Mycompnay_Mymodule</module>
                    <frontName>mymodule</frontName>
                </args>
            </mymodule>
        </routers>
    </frontend>
</config>

app/etc/modules/Mycompany_Mymodule.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <active>true</active>
            <codepool>local</codepool>
        </Mycompany_Mymodule>
    </modules>
</config>

app/code/local/Mycompany/Mymodule/controllers/IndexController.php

class Mycompany_Mymodule_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        echo 'hello World!';
    }   
}
  • Is your controller on app/local/Mycompany/Mymodule/controllers/IndexController.php location? It should be app/code/local/Mycompany/Mymodule/controllers/IndexController.php – Jaimin Sutariya Jul 29 '17 at 7:53
  • Thanks Jaimin, Yes my controller is its under app/code/local/Mycompany/Mymodule/controllers/IndexControlle‌​r.php previously it was a type. – Roshan ruzaik Jul 29 '17 at 7:56
2

You have a typo mistake in app/code/local/Mycompany/mymodule/etc/config.xml You have used Mycompnay_Mymodule inplace of Mycompany_Mymodule at line

<module>Mycompnay_Mymodule</module>

There is one more change you need to do to make it work. Open your app/etc/modules/Mycompany_Mymodule.xml change

<codepool>local</codepool>

To

<codePool>local</codePool>

With a capital P

It should work for you.

  • Thanks Jaimin, I did change it and was expecting that it was the reason.. and double checked all other codes line by line for any typo. But still the same. – Roshan ruzaik Jul 29 '17 at 8:26
  • @Roshanruzaik Please check updated answer. – Jaimin Sutariya Jul 29 '17 at 8:31
  • 1
    Spot on Jaimin! indeed this was the mistake I did. Its now working.Thank you very much! – Roshan ruzaik Jul 29 '17 at 8:36
0

Problem with your router name <mymoduleroutename> It's should be <mymodule>

Update this below code in your file path:-

app/code/local/Mycompany/Mymodule/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Mycompany_Mymodule>
            <version>0.1.0</version>            
        </Mycompany_Mymodule>
    </modules>
    <frontend>
        <routers>
            <mymodule>
                <use>standard</use>
                <args>
                    <module>Mycompnay_Mymodule</module>
                    <frontName>mymodule</frontName>
                </args>
            </mymodule>
        </routers>
    </frontend>
</config>

I Hope It's helpful for you.

  • Thanks Umesh, I changed it to <mymodule> but still the same. – Roshan ruzaik Jul 29 '17 at 8:00
  • Please clear cache once again and check @Roshanruzaik – Randhir Yadav Jul 29 '17 at 8:36
  • Thanks for the tip Umesh. But actual reason was <codepool> . I 'v already selected the correct solution. – Roshan ruzaik Jul 29 '17 at 8:41
  • cool@Roshanruzaik – Randhir Yadav Jul 29 '17 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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