Question

I have created a custom controller on my magento project.It worked fine since i did the development in windows environment.But now i have moved to a Linux environment.Now all of my custom modules are not working.I can't find the problem.please help

When i type this URL in my windows server it works but in Linux it redirect to 404 page. base_path/index.php/Catalogues

This is my code.

/app/etc/modules/AllOther_Catalogues.xml

<?xml version="1.0"?>
<config>
    <modules>
        <AllOther_Catalogues>
            <active>true</active>
            <codePool>local</codePool>
        </AllOther_Catalogues>
    </modules>
</config>

app\code\local\AllOther\Catalogues\etc\config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Magentoexplorer_Catalogues>
            <version>0.1.0</version>
        </Magentoexplorer_Catalogues>
    </modules>
    <frontend>
        <routers>
            <Catalogues>
                <use>standard</use>
                <args>
                    <module>AllOther_Catalogues</module>
                    <frontName>Catalogues</frontName>
                </args>
            </Catalogues>
        </routers>
    </frontend>
</config>

app\code\local\AllOther\Catalogues\controllers\indexController.php

<?php

class AllOther_Catalogues_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {

        $this->loadLayout();
        $block = $this->getLayout()->createBlock(
        'Mage_Core_Block_Template',
        'invoice_',
        array('template' => 'allother/catalogues.phtml')
        );

       $resource = Mage::getSingleton('core/resource');
       $write = $resource->getConnection('core_write');
       $select = $write->select()
      ->from(['tbl' =>"sidcms_block"], ['*'])
      ->where('identifier = ?', "catalogues");

       $results = $write->fetchAll($select);

       $block->assign(array('result'=>$results));


        $this->getLayout()->getBlock('content')->append($block);
        $this->getLayout()->getBlock('head')->setTitle($this->__('Catalogues'));
        $this->renderLayout();

  }
}
Was it helpful?

Solution

Please check if there is any space in you config.xml file between tags.
Also try to replace
<routers> <Catalogues> with
<routers> <catalogues>

OR

If you are using linux platform then give proper permission of all files and folders. I think this is occurring due to file/folder permission.Change the Linux permissions for all files in your Magento base directory to readable and writable by the owning user (you).Set permissions to 664 for files and 775 for folders. 775 for files will work too. Set 777 for media and var , only 2 folders need to be writable by everyone.

OR

Check your controller's file name it should be IndexController.php instead of indexController.php

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top