1

I have a custom module inside my local code pool and folder structure for the same is as below:

app
  code
     local
        namespace
           module
               controllers
               etc
etc
   modules
      namespace_module.xml

namespace_module.xml:

<config>
    <modules>
        <Namespace_Module>
            <active>true</active>
            <codePool>local</codePool>
            <version>0.0.1</version>
        </Namespace_Module>
    </modules>
</config>

namespace/module/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Namespace_Module>
            <version>1.0.0</version>
        </Namespace_Module>
    </modules>
    <frontend>
        <routers>
            <module>
                <use>standard</use>
                <args>
                    <module>Namespace_Module</module>
                    <frontName>module</frontName>
                </args>
            </module>
        </routers>  
    </frontend>
</config>

controllers/UploadController.php

<?php
class Namespace_Module_UploadController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){
        echo "Hi Buddy.."; die();
    }

}

If I run the url as below,

http://myhost/project/module/upload

it access the indexAction()

But if I dont mention the controller name, it should access indexAction of the uploadCOntroller, How can I do this? I mean if I run below url

http://myhost/project/module/

it should access uploadcontroller/index action/

  • You need to know the indexAction is redirect automatically ? – MeenakshiSundaram R Jul 8 '15 at 11:02
  • I know that @MeenakshiSundaramR check my updated question, I think I am not explained clearly. Check last two lines added – Butterfly Jul 8 '15 at 11:05
  • downvoter reason please? – Butterfly Jul 8 '15 at 12:11
1

You can add new Url Rewrite Rule in admin panel.

navigate to

admin > catalog > Url Rewrite management

Click Add Url Rewrite button Then create Url Rewrite as custom

here Id path will be unique name

Requested Path : module

Target Path : module/upload/index

Redirect : No

That's it.

Refer this Link

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.