Tutorials for Magento and Joomla! - Yireo

Solving 404 Not Found errors

With MageBridge, one thing that leads many times to confusion is a 404 error. When you access a certain MageBridge page within Joomla!, you may encounter a 404 error. But why is this 404 error thrown? This guide helps you to analyze this problem properly.

Separating Magento 404s from Joomla! 404s

Because MageBridge only wraps Magento into Joomla!, Magento is still responsible for Magento pages and Joomla! is still responsible for Joomla! pages. This means that the first step to troubleshoot 404 is to know which error comes from which application.

mb_troubleshooting404_1One neat feature of MageBridge is that it is able to merge a Magento 404 into a Joomla! 404. But for troubleshooting purposes it's best to disable this feature temporarily. Within the MageBridge Configuration in Joomla!, locate the setting Enable Joomla! 404 under the tab Other Settings and set it to No.

When Joomla! generates a 404 page this looks by default like a big red box, while Magento generates a 404 page which appears as a Whoops, not found message in the component-area.

Use the right settings

Also important is to use the right Joomla! and Magento settings in your configuration. Make sure you at least meet the required settings defined in the following guides:

In Magento, as soon as you have modified settings, make sure you refresh all the caches and all the indices.

Solving 404s originating from Menu-Items

When you create a Menu-Item pointing to the checkout or to the customers account, this will probably work without problems. If it does not, the bridge is not properly setup.

But most problems come from Menu-Items pointing to Magento products or categories. When creating a new Menu-Item, MageBridge stores the Magento URL in the Menu-Items properties. But if the Magento URL changes after that, the Menu-Item becomes invalid and causes a 404.

mb_troubleshooting404_2

  • Try logging in to the Magento Admin Panel and navigate to System » Index Management. Then click on the Reindex Data link next to Catalog Url Rewrites. This will renew the URL-index that Magento keeps of all catalog-items in relation to their URLs.
  • Open up the Joomla! Menu-Item, hit the Select button and click on the same product or category. This will make sure the new URL is used in Joomla! as well.

Fixing Magento URL Rewrites

If this does not solve your problem, you should take note of the URLs in the Magento frontend and the URL Keys listed in the modal box in the Joomla! backend (Lightbox popup). Take for instance an example category Furniture. This category would have a URL Key called furniture. The Magento URL will also be http://MAGENTO/furniture. But if you somehow recreate the category multiple times, Magento will need to create multiple URLs:

http://MAGENTO/furniture
http://MAGENTO/furniture-1
http://MAGENTO/furniture-2

In this case, MageBridge has no good way to guess the URL based upon the URL Key. Instead of selecting the URL Key in the modal popup in Joomla!, you should therefor select the numerical ID (click on the product or category ID listed on the right). The Menu-Item will now be linked to the ID instead.

You can see also that the Magento table of URL Rewrites (accessed through Catalog in the Magento backend) is listing numerous URLs that are bad for SEO. Alternatively, you might want to clean up the MySQL table core_url_rewrite (through phpMyAdmin) and regenerate all URLs (through Index Management in the backend). Note that for this, you will definitely need a valid backup plus a restore-procedure. Also note that all present 301-redirects will be wiped out with this. Also note that this falls not under MageBridge support - if something goes wrong, you should contact your Magento developer.

Troubleshooting the Magento request

Because there are many things that can go wrong, you will need to do the basic troubleshooting yourself. Enable debugging in MageBridge. On the Joomla! frontend the message-box should display some MageBridge debugging output. If your Joomla! template does not show the message-box, you will need to modify your template. See the MageBridge Troubleshooting Guide for more information.

mb_troubleshooting404_3

The debugbar shows you the Magento request with a link of the equivalent Magento URL. If you click on the Magento URL you should get the same 404, but now you can troubleshoot it more thoroughly.

A 404 when logging in

When you login and receive a 404 error, something else might be in play. For instance, the connection with Magento might be out of use, but the MageBridge Authentication Plugin or the MageBridge User Plugin is still activated in Joomla!.

This becomes irritating if you are trying to login to the backend. Our recommendation is to set the following values in the MageBridge Configuration under the Users tab:

  • Single Sign On: No
  • Backend Authentication: No
For more information on these configuration values, checkout the guide MageBridge - Configuration Options. Created on Sunday, 16 May 2010
Modified on Saturday, 24 September 2011

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo