自定义菜单在服务器上提供404 magento

时间:2012-12-20 12:43:32

标签: magento magento-1.7

我在magento admin的admin标签中创建了一个自定义菜单。它在localhost上工作得很好,但是当我在服务器上部署我的代码时,它给出了404页面找不到错误。那可能是什么问题!

<?xml version="1.0"?>

<config>
    <modules>
        <Inchoo_CoffeeFreak>
            <version>0.1.0</version>
        </Inchoo_CoffeeFreak>
    </modules> 

    <global>
        <blocks>
            <coffefreakblock1>
                <class>Inchoo_CoffeeFreak_Block</class>
            </coffefreakblock1>  
            <coffefreakblock2>
                <class>Inchoo_CoffeeFreak_Block_EditSpecial</class>
            </coffefreakblock2> 
        </blocks>
        <helpers>
            <coffefreakhelper1>
                <class>Inchoo_CoffeeFreak_Helper</class>
            </coffefreakhelper1>
        </helpers>  
    </global>    






    <admin>
        <routers>
           <samplerouter1>
                <use>admin</use>
                <args>
                    <module>Inchoo_CoffeeFreak_AdminControllersHere</module>
                    <frontName>print</frontName>
                    <modules>
                        <sintax after="Inchoo_CoffeeFreak_AdminControllersHere">Mage_Adminhtml</sintax>
                    </modules>
                </args>
           </samplerouter1>           
         </routers>     
    </admin>





    <adminhtml>


        <menu>
             <mymenu1 translate="title" module="coffefreakhelper1">
                <title>PrintInfo</title>
                <sort_order>20</sort_order>
                <children>
                <!-- Note the misleading "module" attribute. 
                    It actualy refers to one of the declared helpers -->

                    <myitem1 translate="title" module="coffefreakhelper1">
                        <title>Add/Change Config</title>
                        <action>samplerouter1/settings</action>
                        <sort_order>1</sort_order>                        
                    </myitem1>    
                </children>
             </mymenu1>
        </menu>
    </adminhtml>    

</config>

4 个答案:

答案 0 :(得分:2)

您的服务器可能在区分大小写的Linux上运行,因此您需要检查模块文件和文件夹是否应符合Magento标准,如控制器应为IndexController而不是indexController等。

并且您的localhost在不区分大小写的窗口上运行。

答案 1 :(得分:1)

通常这是您登录时。注销并再次登录。然后它应该工作。

答案 2 :(得分:1)

假设缓存已关闭/清除

1)退出并重新登录

如果您仍然收到404错误

2)检查服务器错误日志,您可能错过了模块帮助文件

答案 3 :(得分:1)

登录/退出,清除缓存,应该是解决方案。

但你可以尝试以下几点(虽然它可能会发现愚蠢)。

1)检查您的xml内容。(与您的localhost xml一行一行)
2)拼写很重要(希望<sintax>拼写正确就是你的xml)
3)删除不需要的空格(如<global>标记前)和评论 4)开幕式&amp;关闭标签。
5)正确的缩进(如果有缺陷,这将有助于找到你的缺陷)
6) Atlast直接复制服务器中的同一localhost xml文件。

我真的希望这能帮助你找到错误。

相关问题