[英]Magento 1.9.2.1: My custom module gives 404 error, works on 1.9.1 version
我剛剛從here下載了Magento 1.9.2.1。
我跟所有的步驟按照此答案由阿蘭風暴 。
並點擊http://127.0.0.1/magentoNew/index.php/helloworld
,盡管所有文件的代碼都相同(復制粘貼),但給出404。
我也嘗試按照Inchoo的本教程制作另一個自定義模塊,但仍然得到404頁(一個人那里有同樣的問題)。
我按照Alan Storm的回答遵循了所有說明。 它在magento 1.9.1。*上運行得很好,但是在最新版本上卻有問題,有人解決了同樣的問題嗎?
注意:etc中的所有文件都相同,根據教程, local/MyCompanyName/HelloWorld
文件夾中的文件也相同。
我使用的是新電腦,因此我必須安裝Magento 1.9.2.1的所有新設置,因此我只是從筆記本電腦中復制了用於在該筆記本電腦上運行的擴展名文件(筆記本電腦已安裝magento 1.9.1.0)。
謝謝。
編輯:正如我已經寫的,所有代碼都可以在這里看到 如何在Magento中創建一個簡單的“ Hello World”模塊? ,但我還是再次寫了一些文件。
config.xml
<?xml version="1.0"?>
<config>
<modules>
<mycompanyname_helloworld>
<version>
0.1.0
</version>
</mycompanyname_helloworld>
<frontend>
<routers>
<!-- the <helloworld> tagname appears to be arbitrary, but by
convention is should match the frontName tag below-->
<helloworld>
<use>standard</use>
<args>
<module>MyCompanyName_HelloWorld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</modules>
</config>
:)緩存清除
嘗試在您的config.xml中遵循以下代碼並清除緩存,看看它是否有效?
<?xml version="1.0"?>
<config>
<modules>
<mycompanyname_helloworld>
<version>
0.1.0
</version>
</mycompanyname_helloworld>
</modules> <!-- Check this line -->
<frontend>
<routers>
<!-- the <helloworld> tagname appears to be arbitrary, but by
convention is should match the frontName tag below-->
<helloworld>
<use>standard</use>
<args>
<module>MyCompanyName_HelloWorld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.