4

I have gone through this tutorial on youtube

Quick start to magento customization - part 1

As I don't have knowledge on php, I understood only the configuration layout part.

The video says that if we type localhost/magento/requestflowtest, we will see a page saying Helloworld. but I am getting error "404 not found".

What I have done by going through the tutorial is as follows:

  • In app/code/local --> created a folder name "Practice" (case sensitive)
  • In app/code/local/Practice --> created a new folder name "ControllerTest"
  • In app/code/local/Practice/ControllerTest/ --> created a new folder name "etc"
  • In app/code/local/Practice/ControllerTest/etc --> created a xml file "config.xml" . The content in it is as follows:

config.xml:

<?xml version="1.0."?>
<config>
    <modules>
        <Practice_ControllerTest>
            <version>0.0.1</version>
        </Practice_ControllerTest>
    </modules>
    <frontend>
        <routers>
            <test_controller>
                <use>standard</use>
                <args>
                    <module>Practice_ControllerTest</module>
                    <frontName>requestflowtest</frontName>
                </args>
            </test_controller>
        </routers>
    </frontend>
</config>
  • Then in app/etc/modules --> Created a new xml file with name "Practice_ControllerTest.xml" and added the following content:

Practice_ControllerTest.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Practice_ControllerTest>
            <active>true</active>
            <codePool>local</codePool>
        </Practice_ControllerTest>
    </modules>
</config>
  • Then in app/code/local/Practice/ControllerTest --> added a new folder "controllers"
  • In app/code/local/Practice/ControllerTest/controllers --> added a new php file with name "IndexController.php" and added the following content to it:

IndexController.php

<?php
class Practice_ControllerTest_IndexController
extends Mage_Core_Controller_Front_Action
{
    /*
     * General report action 
     */
    public function indexAction(){
        echo "<h1>Hello World!!</h1>";
    }
}

What could I have been doing wrong here?

8
  • 1
    Try renaming indexController.php to IndexController.php and make sure your Magento caches are disabled or flushed.
    – user487772
    Sep 19, 2013 at 6:28
  • @Tim Sorry, it was typo, I updated my post. and I cleared the cache. Still same 404 issue.
    – Mr_Green
    Sep 19, 2013 at 6:33
  • I think the problem is somewhere else because before this I tried one of the alanstorm's tutorial which displayed the same error.
    – Mr_Green
    Sep 19, 2013 at 6:44
  • Just now I reinstalled magento and did the same what I explained here (didnot follow the video again) on the fresh copy. but still it is showing 404 error. I think I am missing something in this.. may be I am passing the wrong url. I even tried http://localhost/magento/index.php/requestflowtest, still same error.
    – Mr_Green
    Sep 19, 2013 at 7:06
  • 1
    anything in Magento logs (make sure they are enabled)?
    – user487772
    Sep 19, 2013 at 8:35

1 Answer 1

4

It would appear you have an extra . in your config.xml first line

<?xml version="1.0."?>

Should be

<?xml version="1.0"?>

I only noticed this when I copied your code across to one of my magento instances that has $_SERVER['MAGE_IS_DEVELOPER_MODE'] enabled. This showed me that there was an error with the xml.

1
  • Sharp eyes :D. thanks.. such a silly mistake. I was writing it manually..
    – Mr_Green
    Sep 19, 2013 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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