如何将Magento管理员URL更改为domainname.com/index.php/customname1/customname2

时间:2012-07-29 09:41:03

标签: magento

有很多文章在谈论如何将Magento Admin Url更改为一个不同的名称,例如domainname.com/index.php/myadmin,但没有一篇文章告诉我如何将管理网址更改为多路径网址比如domainname.com/index.php/name1/name2/name3

我尝试在local.xml中更改名称,但它仅适用于单个名称。请帮忙?先谢谢你了!

1 个答案:

答案 0 :(得分:0)

我不确定这是可能的。基本方法是将local.xml中的前端名称“admin”更改为“whatever”以访问后端。基于它,您可以通过重写来对路由器的行为进行一些更改。

一种适用于模块的可行方法是重写,但我没有在后端模块(adminhtml)上测试,它可能不适用于其他后端模块或遇到麻烦。这是在local.xml中做的一个示例,进行一些测试。 “from”标签中的正则表达式也可以起作用:

<config>
...
    <rewrite>
        <mage_adminhtml>
            <from><![CDATA[#^/whatevermodule/whatevercontroller/whateveraction#]]></from>
            <!--
                - whatevermodule matches the router frontname below
                - whatevercontroller matches the path to your controller Considering the router below,
                "/whatevermodule/whatevercontroller/" will be "translated" to
                "/Mage/Adminhtml/controllers/Catalog/ProductController.php" (?)
            -->
            <to>/admin/catalog_product/index</to>
        </mage_adminhtml>
相关问题