404 – Component not found joomla page

The joomla site was loading with 404 error

You may not be able to visit this page because of:
1. an out-of-date bookmark/favourite
2. a search engine that has an out-of-date listing for this site
3. a mistyped address
4. you have no access to this page
5. The requested resource was not found.
6. An error has occurred while processing your request.
Please try one of the following pages:
* Home Page
If difficulties persist, please contact the System Administrator of this site.
Component not found

Fix :

You just need to follow any of the below solutions:

Solution One:
In Global Configuration the value “Use Apache mod_rewrite” should be set to True, and, surely, htaccess.txt should be renamed to .htaccess
Solution Two:
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.
Solution Three:
If the component name under renderComponent() function is empty it raises a 404 Component Not Found Error. Due to this Joomla seems to be calling dispatch() on a component with an empty name, which should not be done For this we can put an if statement in the code which is under /home/username/public_html/joomla/includes/application.php

At the above path locate JcomponentHelper::renderComponent() at line 124 put in this “if” statement as bellow:

if(! empty($component)) {
$contents = JComponentHelper::renderComponent($component);
$document->setBuffer( $contents, ‘component’);
}
Solution Four:
You can comment bellow line in “/index.php”
$mainframe->dispatch($option);
Make sure it looks like:
//$mainframe->dispatch($option);

Leave a comment