我不確定這是可能的。基本的方法是在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>
謝謝您的回答Diglin。但從我的經驗來看,這種方法仍然允許每個人通過普通的URL訪問管理員http://domainname.com/index.php/admin ???因爲我不希望他們通過此URL訪問管理員。我想改變路徑以達到安全目的。 – 2012-07-29 10:28:05
如果引用者不是/ whatevermodule/whatevercontroller/whateveraction,你可以阻止它。 同樣的想法可以通過htaccess完成。 – 2012-07-29 11:39:59