2012-07-29 56 views

回答

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> 
+0

谢谢您的回答Diglin。但从我的经验来看,这种方法仍然允许每个人通过普通的URL访问管理员http://domainname.com/index.php/admin ???因为我不希望他们通过此URL访问管理员。我想改变路径以达到安全目的。 – 2012-07-29 10:28:05

+0

如果引用者不是/ whatevermodule/whatevercontroller/whateveraction,你可以阻止它。 同样的想法可以通过htaccess完成。 – 2012-07-29 11:39:59