This is the path reference that you are provided in a layout file
<path>earnings/earnings/</path>
This will set your link to this path http://www.mysitewebsite.com/earnings/earnings
. When magentoMagento 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 looklooks like http://www.mysitewebsite.com/earnings/index/
. You have defined your block for this specific urlURL. Note you have used earning_index_index
handle in your layout file. This handle will be processed by magnetoMagento only when http://www.mysitewebsite.com/earnings/index/
urlURL get requested.
Note: In order to work this urlURL 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 isare not defined for your module, Magento will throw 404 error
again.