Skip to main content
1 of 2
Rajeev K Tomy
  • 17.3k
  • 6
  • 63
  • 103

This is the path reference that you are provided in layout file

<path>earnings/earnings/</path>

This will set your link to this path http://www.mysite.com/earnings/earnings. When magento looks for this path, it cannot find a valid controller definition. That is why it throws 404 error. So set your path to

  <path>earnings/</path>
         or
   <path>earnings/index/</path>

will solve your issue. Now the link look like http://www.mysite.com/earnings/index/. You have defined your block for this specific url. Note you have used earning_index_index handle in your layout file. This handle will be processed by magneto only when http://www.mysite.com/earnings/index/ url get requested.

Note: In order to work this url perfectly, you should have an IndexController.php is defined for your module and this file should hold this method.

public function indexAction() {

   $this->loadLayout();
   $this->renderLayout();
}

If this method and this file is not defined for your module, Magento will throw 404 error again.

Rajeev K Tomy
  • 17.3k
  • 6
  • 63
  • 103