1

Here is the config.xml

<admin>
    <routers>
            <adminhtml>
                        <args>
                            <modules>
                                <Example_Csfollowup before="Mage_Adminhtml">Example_Csfollowup_Adminhtml</Example_Csfollowup>
                            </modules>
                        </args>
            </adminhtml>
    </routers>
</admin>

here is the controllers at app\code\local\Example\Csfollowup\controllers\Adminhtml\CustomController.php

class Example_Csfollowup_Adminhtml_CustomController extends Mage_Adminhtml_Controller_Action
{
    public function indexAction()
    {

        echo 'abc';

        //$this->renderLayout();
    }

    public function listAction()
    {

    }
}

but when i visit localhost/m1/index.php/admin/custom, it redirect me to 404, anyone know what is the url it should be?

  • 1
    Please add in config.xml <admin> before <routers>. Do you have acl file? – Vadym Kalin Jun 19 '17 at 6:39
  • admin is exist in my code, just missing in question – hkguile Jun 19 '17 at 6:48
3

Try adding a menu and add link inside it, Magento admin will check for security key value in URL, if its not correct or missing, it will redirect you to dashboard page.

Add adminhtml.xml in your module's etc folder.

<?xml version="1.0"?>
<config>
    <menu>
        <csfollowup module="csfollowup">
            <title>CS Follow</title>
            <sort_order>100</sort_order>               
            <children>
                <items module="csfollowup">
                    <title>My Page</title>
                    <sort_order>0</sort_order>
                    <action>adminhtml/custom</action>
                </items>
            </children>
        </csfollowup>
    </menu>
</config>

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.