1

I created a custom module in magento ... my url is

seller/seller/sellercreate

i need to rewrite this url

like

http://example.com/seller

my config.xml is

<?xml version="1.0" encoding="UTF-8" ?>
<config>
    <!-- module configuration -->
    <modules>
        <Webcreon_Seller>
            <version>0.0.1</version>
        </Webcreon_Seller>
    </modules>
    <!-- module configuration end -->
    <frontend>
        <routers>
            <seller>
                <use>standard</use>
                <args>
                    <module>Webcreon_Seller</module>
                    <frontName>seller</frontName>  
                </args>
            </seller>
        </routers>
     <layout>
            <updates>
                <seller>
                      <file>sellerform.xml</file>
                </seller>
            </updates>
       </layout>
    </frontend>
    <admin>
     <routers>
         <seller>
            <use>admin</use>
            <args>
               <module>Webcreon_Seller</module>
               <frontName>adminseller</frontName>
            </args>
         </seller>
      </routers>
 </admin>
 <adminhtml>
   <layout>
      <updates>
          <seller>
              <file>sellerform.xml</file>
           </seller>
      </updates>
   </layout>
   <menu>
      <customer translate="title" module="adminhtml">

         <sort_order>10</sort_order>
         <children>
             <set_time>
                   <title>Seller List</title>
                   <action>adminseller/adminhtml_index</action>
              </set_time>
          </children>
       </customer>
    </menu>
</adminhtml> 

    <global>
        <blocks>
            <seller>
                <class>Webcreon_Seller_Block</class>
            </seller>
         </blocks>
         <helpers>
            <seller>
                <class>Webcreon_Seller_Helper</class>
            </seller> 
        </helpers>
              <models>
          <seller>
                <class>Webcreon_Seller_Model</class>
                 <resourceModel>seller_mysql4</resourceModel>
            </seller> 
            <seller_mysql4>
             <class>Webcreon_Seller_Model_Mysql4</class>
             <entities>
                 <seller>
                   <table>db_vendor</table>
                 </seller>
              </entities>
          </seller_mysql4>
        </models>
        <resources>
        <!-- connection to write -->
        <seller_write>
            <connection>
                <use>core_write</use>
            </connection>
        </seller_write>
        <!-- connection to read -->
       <seller_read>
          <connection>
             <use>core_read</use>
          </connection>
       </seller_read>
</resources>
    </global>


</config>

1 Answer 1

2

To avoid issues change your frontname to something different then seller, sellercreate for example. Now you can add a rewrite to your global node.

<global>
   [...]
   <rewrite>
      <sellercreate>
         <from><![CDATA[#^/seller[\/]?$#]]></from>
         <to><![CDATA[/seller/seller/sellercreate/$1]]></to>
         <complete>1</complete>
      </sellercreate>
   </rewrite>
   [...]
</global>
5
  • Mandel ,can you please tell me why use <complete>1</complete> in this rewrite code. Commented Nov 15, 2014 at 8:58
  • as far as I know how this works (never did a lot of digging) it stops processing the url, otherwise another rewrite could undo this one Commented Nov 15, 2014 at 8:59
  • Thanks @Sander Mangel ..... have any link on this regards? Commented Nov 15, 2014 at 9:01
  • hm no, found this out ages ago. after a lot of googling and looking through the core Commented Nov 15, 2014 at 9:02
  • @SanderMangel now. what will be my url.... Commented Nov 15, 2014 at 9:04

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.