今天遇到joomla传说中的404错误,关闭sef或者apache rewrite模块也没用,中文的资料基本没有解决问题。
404 – Component not found
You may not be able to visit this page because of:
an out-of-date bookmark/favourite
a search engine that has an out-of-date listing for this site
a mistyped address
you have no access to this page
The requested resource was not found.
An error has occurred while processing your request.
Please try one of the following pages:…
最后在英文论坛找到解决办法:
=======================
In developing our new site with Joomla 1.5.1 all was going fine then we started getting the 404 Component Not Found Error people are talking about. We also noticed that our FrontPage was blank/gone. We put in another piece of content for the FrontPage, but this did NOT fix it.
So, I tried turning on and off the Search Engine Friendly settings but that did NOT resolve it either.
EASY SOLUTION (from another post)
No default menu is set in the Main Menu. Go into your Admin page/control panel and go to the Menu Item Manager for the Main Menu. Click the check box next to the Home page at the top of the list. Then click on the yellow star icon in the upper-right corner.
chenke=> 简单解决方案:是因为Main menu中没有指定默认菜单引起的。进入管理后台-》菜单项管理-》Main Menu,点击列表中Home page项的前的选项框,然后点击右上方的黄色星星按钮,完毕。(不一定解决所有组件未找到问题)
ALTERNATE SOLUTION
So I set Debug Info to Maximum and examined the function call stack. After further analysis I noticed that the error was getting triggered when trying to call the dispatch() function for a component (which one I could not tell). It calls the renderComponent() function which does a check on the component name, if it is empty then it raises a 404 Component Not Found Error. For whatever reason Joomla seems to be calling dispatch() on a component with an empty name (possibly because a component is disabled or the FrontPage is broken/missing,) which it should NOT do, and generates the error. I put a very simple if statement in the code which fixed the problem!
In the “includes” directory in the root Joomla directory there is a file called “application.php” Locate the dispatch() function (at line 89). Right before the call (at line 124) to JComponentHelper::renderComponent() put in this “if” statement like below. Make sure it looks exactly like this.
if(! empty($component)) {
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer( $contents, ‘component’);
}
Upload the file to the includes directory and try refreshing your browser again.
Also, if anyone can tell if the error is caused by a disabled component (by turning on all components and seeing if the error goes away) it would be good to post any info about this as well.
又看不懂英文的朋友再qq我,不翻译了,qq: 10000838