Setting the MageBridge URLs in Magento

Often it is needed to set a hard definition of the MageBridge URLs in Magento. MageBridge is able to set the right URLs dynamically from the frontend. But when you send mails from the Magento Admin Panel, the URL is set to the default Magento URL and not the Joomla! URL. This tutorial helps you to reconfigure Magento to solve this.

Making hard definitions of MageBridge URLs

mb_magento_configuration_scopeWhen working with Magento multisite configurations, it is common to change the URLs used by Magento. By defining the exact MageBridge Root Menu-Item URL within the Magento configuration, you can tell Magento explicitely about which Joomla! URL to use.

To configure this, login to the Magento Admin Panel and navigate to System > Configuration. Choose the right Configuration Scope for your MageBridge site. If you are unsure which scope should be choosen, choose the Website Scope that is configured in your Joomla! site.

Next, navigate to Web > Unsecure.

Make sure you do not enter the MageBridge URL in the global scope (Default Config) because this will lock you out of the Magento Admin Panel.

Unsecure and Secure URLs

At the fields of Base URL and Base Link URL, enter the path to MageBridge. This is usually your Joomla! URL plus the Menu-Item alias of the MageBridge Root Menu-Item. The MageBridge Root Menu-Item is the page that serves your Magento homepage within Joomla!.


Both Joomla! URLs as Magento URLs

As you can see, you do not only need to enter the Joomla! URL, but you also need to manually set the Magento URL again. Static content like CSS, JavaScript and images is still served from Magento. But by overriding the default variable {{unsecure_base_url}}, you also override the URLs for the static content.

This needs to be corrected by manually entering the Magento URLs again. To do this, uncheck the option Use Default for the following options and enter the original Magento URL plus the prefix

  • Base Skin URL: http://MAGENTO/skin/
  • Base Media URL: http://MAGENTO/media/
  • Base JavaScript URL: http://MAGENTO/js/

Make sure to end each Magento URL with a forward slash - just like it says in the comments.

Accessing your Magento frontend anyway

With the steps in this guide, you have now blocked access to the original Magento frontend. Any access to the Magento frontend will lead back to the Joomla frontend instead. However, this will also prevent you from previewing things properly in Magento. Because we always recommend you to test things in Magento before trying to bridge it, there are 2 things you can do:

First of all - and this is not an option, it is a must - make sure you have a testing environment - an exact copy of your Joomla/Magento site, with different URLs ofcourse. This way you can always test out things, without breaking your production site.

A separate Magento-only Store View

Second, you can also setup an extra Website-scope or an extra Store View-scope, and use that to access the original Magento frontend. Just like you modified the Secure URLs and Unsecure URLs for the Website-scope, you can change the URLs in this extra scope, so that it points back to the original Magento frontend URLs. So, you have a Global scope that lists your Magento frontend URL, because otherwise you can't access your backend anymore. You have a Website scope that is listing the Joomla URLs. And 1 extra Store View scope points again to the Magento frontend. Make sure that extra Store View is set as default in the Store scope that contains it. Next in the MageBridge component in the Joomla backend, under Store Relations, set the Default rule to the Store View you actually want to have as default.

If you have more than one Store View already (perhaps because you have a multilingual shop), we advice you to add an extra Website-scope instead of an extra Store View-scope.

Mental note on other mechanisms

If you are unable to access the original Magento frontend, after having read the previous sections, make sure to double check that there is no other mechanism preventing you from accessing the Magento frontend. For instance, check upon your htaccess-files for redirect rules. Also, if you are using MageBridge Redirect, configure it properly so you are not being redirected back to Joomla. In short: If you want to access the Magento frontend, you don't want to use the MageBridge Redirect module.