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/

3
  • You need to know the indexAction is redirect automatically ? Commented Jul 8, 2015 at 11:02
  • I know that @MeenakshiSundaramR check my updated question, I think I am not explained clearly. Check last two lines added
    – Anto S
    Commented Jul 8, 2015 at 11:05
  • downvoter reason please?
    – Anto S
    Commented Jul 8, 2015 at 12:11

1 Answer 1

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

0

Your Answer

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

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