0
votes

Error while following http://alanstorm.com/magento_controller_hello_world:-

Not Found

The requested URL /magento/helloworld was not found on this server.

C:\wamp\www\magento\app\code\local\Bsl\Helloworld\controllers\IndexController.php

    <?php 
    class Bsl_Helloworld_IndexController extends Mage_Core_Controller_Front_Action 
    {        
        public function indexAction()
       {
            echo 'Hello Index!';
       } 
    } 

C:\wamp\www\magento\app\code\local\Bsl\Helloworld\etc\config.xml

<config>    
    <modules>
        <Bsl_Helloworld>
            <version>0.1.0</version>
        </Bsl_Helloworld>
    </modules>
    <frontend>
        <routers>
            <helloworld>
                <use>standard</use>
                <args>
                    <module>Bsl_Helloworld</module>
                    <frontName>helloworld</frontName>
                </args>
            </helloworld>
        </routers>  
    </frontend>
</config>

C:\wamp\www\magento\app\etc\modules\Bsl_Helloworld.xml

<config>
<modules>
    <Bsl_Helloworld>
        <active>true</active>
        <codePool>local</codePool>
    </Bsl_Helloworld>
</modules>
</config>
2
try magento.com/helloworld/index/indexNaumov
No it is also showing same ErrorLalji
You disable cahe? admin->system->cache managment->check all and disable?Naumov
Yes done but no luckLalji
Ok. Bsl last literal this big I or small l. check you folder name and classes.Naumov

2 Answers

2
votes

You're code is all correct, you are just hitting the wrong URL. Controller URLs are built with this formula:

http://example.com/frontName/actionControllerName/actionMethod/

The action name index will be applied if no action method is given. So in your case your URL would be http://example.com/helloworld/index with example being your domain. Since your action is index you don't have to expressly include it is the URL.

0
votes

This url is working perfectly http://magento/index.php/helloworld

By Having index.php