I tried creating a non CMS page in Magento 1.9. I followed these steps :

Created a folder called 'Returns' in app/code/local and within it created another sub folder called 'Returns' with 2 folders 'controller' and 'etc'in it.

Within controller, I created a file called 'ReturnsController.php' and filled it as below -

  <?php class Returns_Returns_ReturnsController extends Mage_Core_Controller_Front_Action{
public function returnsAction()
    //Get current layout state

    $block = $this->getLayout()->createBlock(
        array('template' => 'returns/returns.phtml')



Then in 'etc', I created a file 'config.xml' with content as below

<?xml version="1.0"?>



After this, I created a file in app/etc/modules as Returns_Returns.xml with content

<?xml version="1.0" encoding="UTF-8"?>

Finally, I added a folder called 'returns' in app/design/frontend/et_oxynic/default/template. Created a file called 'returns.phtml' in it with test content

  $name = Mage::getSingleton('customer/session')->getCustomer()->getName();

<div class="box">
  <div class="box-content">
      <?php if(Mage::getSingleton('customer/session')->isLoggedIn()): echo "Welcome" . $name . "!"; ?>
      <?php else:  echo "Welcome, Guest!"; endif; ?>
    <p>We have successfully created a page using a magento module and router!</p>

I cleared the cache from cache management from admin but I still get a 404 error.

Please help me out


You also need a layout file for your returns action at app/design/frontend/et_oxynic/default/layout/

Let's call it returns.xml ;)

<?xml version="1.0"?>
    <layout version="0.1.0">
            <reference name="content">
                <block type="core/template" name="returns" template="returns/returns.phtml" />
  • Thanks Kalpesh ! But its still not working..I cleared the cache as well after adding this file. Is there anything else I might be missing ? – Rishiraj Shrawat Jun 9 '15 at 15:43
  • I just noticed you said you created controller folder, it should be controllers – Kalpesh Jun 11 '15 at 23:40

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.