简体   繁体   English

通过管理面板访问模块设置时出现Magento 404错误

[英]Getting a Magento 404 error when accessing the module settings through admin panel

So I downloaded the Magento free blog extension but it only supports a single blog. 所以我下载了Magento免费博客扩展,但它只支持一个博客。 So I duplicated the extension as I need more than one blog in my magento store. 所以我复制了扩展,因为我在magento商店需要多个博客。 I changed all the references and calls appropriately in my extension copy and was able to install it as a separate extension. 我在扩展副本中更改了所有引用和调用,并能够将其作为单独的扩展安装。

However when I want to create a new post from the admin panel it gives me a Magento 404 error. 但是, 当我想从管理面板创建一个新帖子时,它会给我一个Magento 404错误。

I would appreciate if someone could take a look and let me know what I am missing. 如果有人可以看看,让我知道我错过了什么,我将不胜感激。

Please NOTE that I use two environments for testing: 请注意我使用两个环境进行测试:

  1. a local installation of Magento through MAMP/WAMP (prepackaged LAMP desktop environment for Mac and Windows) with PHP 5.2.6, MySQL 5 and Apache 2.0.59 使用PHP 5.2.6,MySQL 5和Apache 2.0.59通过MAMP / WAMP(用于Mac和Windows的预打包LAMP桌面环境)本地安装Magento

  2. a Webserver with PHP 5.2.10, MySQL 5.x and Apache 2.x PHP 5.2.10,MySQL 5.x和Apache 2.x的Web服务器

On my local MAMP/WAMP I am able to create a blog without a problem. 在我当地的MAMP / WAMP上,我可以创建一个没有问题的博客。 However when I test it from a live server I am no longer able to create new blog post and the redirection to the admin page of the create post page gives me a magento 404 error. 但是,当我从实时服务器测试它时,我不再能够创建新的博客帖子,并且重定向到创建帖子页面的管理页面会给我一个magento 404错误。

I have been thinking that this might have to do with some server settings but I am not sure at all and would appreciate if someone else could look into this for me. 我一直在想这可能与某些服务器设置有关,但我完全不确定,如果其他人可以为我调查,我会很感激。

Thanks. 谢谢。

Programmer 程序员

First a scold, then some help, because that's how StackOverflow rolls. 首先是骂,然后是一些帮助,因为这就是StackOverflow如何滚动。 Unless you're really conversant with Magento conventions, chances are you didn't change enough of the right things. 除非你真的熟悉Magento惯例,否则你很可能没有改变正确的事情。

  1. Read up on the controller distach process in Magento and try tracing its progress 阅读Magento中的控制器远程过程并尝试跟踪其进度

  2. So, that read, you now know your frontname here is "vblog_admin". 所以,那读起来,你现在知道你的前面名字是“vblog_admin”。 Are ANY pages with this front name loading? 是否有加载此正面名称的任何页面? If not, check your <routers> section of your customized module 如果没有,请检查自定义模块的<routers>部分

  3. Your controller name is "manage_vblog", which means in the customized module you should have a controller at the following location: ModuleName/controllers/Manage/Vblog.php . 您的控制器名称是“manage_vblog”,这意味着在自定义模块中,您应该在以下位置具有控制器: ModuleName/controllers/Manage/Vblog.php

  4. Once you've ensured that controller is in place, make sure it has a newAction method on it. 一旦确定控制器就位,请确保它上面有一个newAction方法。

If any of the above steps fail, magento will 404 on you. 如果上述任何步骤失败,magento将404给你。 Finally, in 最后,在

app/code/core/Mage/Core/Controller/Varien/Router/Standard.php

Search for the text getControllerFileName . 搜索文本getControllerFileName This is where your controller gets its name, as well as the general area of the system where Magento decides if it has a legitimate request or not. 这是您的控制器获取其名称的位置,以及Magento决定是否有合法请求的系统的一般区域。

Update: Based on the file provided below (and private communication) it looks like it's your naming conventions that are causing the problem. 更新:根据下面提供的文件(和私人通信),它看起来是导致问题的命名约定。 Magento is extrodinarly strict about its camel case naming convention Magento对其骆驼案件命名惯例非常严格

VBlog 

should be 应该

Vblog

in all instances of class and filenames. 在类和文件名的所有实例中。 While PHP itself doesn't care about case in classnames, msot linux servers DO case about case. 虽然PHP本身并不关心类名中的情况,但msot linux服务器的情况就是大概。 Magento can't find your controller class file because of this and that's why you're getting a 404. 由于这个原因,Magento无法找到您的控制器类文件,这就是您获得404的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM