Tutorials for Magento and Joomla! - Yireo

How to use URL-suffices with MageBridge?

While MageBridge is first of all a Joomla! extension, that supports Joomla! SEF, it also brings content from Magento to Joomla!. When dealing with URL-suffixes, this complicates things. Joomla! is unaware of the logic that Magento uses and vice versa. If you want to implement URL-suffixes, please follow the steps below.

The main problem is that if Joomla! enables URL-suffixes (which is always ".html"), it will do so regardless of the actual URL. For this to work with MageBridge, you have to disable URL-suffixes in Magento. MageBridge detects the Joomla! setting and adds the URL-suffix to the Magento content if needed.

Steps to configure suffixes

  1. First of all you need to enable the URL-suffix in Joomla!. Login to Joomla!, browse to Global Configuration and within the tab Site, enable Add suffix to URLs. Note that you do not have the option to determine which suffix is used - by default it always is ".html".
  2. Next, login to Magento and browse to System » Configuration » Catalog » Search Engine Optimization. Make sure the settings Product URL Suffix and Category URL Suffix are left blank. If they contain some kind of value, remove that value.
  3. To finalize this, you need to rebuild the appropriate cache. In Magento, browse to System » Cache Management » Catalog Rewrites and click on the button Refresh. This will rebuild all the URLs of products and categories.

From now on, Joomla! is responsible for adding the right URL-suffix to all URLs.

NOTE: If a MageBridge URL ends with a forward-slash "/", it will not get an URL-suffix - this is in accordance to the Magento rules. For instance "checkout/cart/" will not get a suffix.

NOTE: Using a Magento URL suffix other than ".php" will not cause a conflict. However, if the Joomla! URL suffix is enabled, this will result into URLs ending with ".php.html".

Using Magento stand-alone with suffixes

Because the Magento configuration itself does not use URL-suffixes, browsing the store directly from Magento, will show URLs with no suffix. We recommend that visitors should never access the stand-alone Magento frontend, as soon as MageBridge is up and running - this in order to prevent duplicate content (SEO rule).

However, if you need the Magento-application for different reasons, we recommend you configure a different Website for MageBridge. Within the configuration scope for MageBridge you can disable suffixes, while in the scope for Magento you can enable them again.

Why so difficult?

The reason why using the same suffix on both sides is a bit more technical. If suffixes are enabled in Joomla!, Joomla! will append ".html" when building the URL. But this also means that Joomla! will remove the suffix when parsing the URL. This is how Joomla! deals with URL-routing.

But MageBridge only gets the end-result of the URL - meaning with the ".html" stripped. By then, there is no solid way to determine which URL should be sent to Magento (with or without suffix). We have experimented with reading the original URL (REQUEST_URI) but found that that method gave more problems than it solved.

Created on Saturday, 15 August 2009
Modified on Sunday, 06 December 2009

About Yireo

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

More about Yireo