Question

I have a multi-store installation, and each store has its own domain set in System > Configuration > General > Web > [Un]Secure > Base URL:

[Global Scope]
  |-- http://separatenode.com/
  |
  |-- [Website Scope A]
  |     |-- http://domaina.com/
  |
  |-- [Website Scope B]
        |-- http://domainb.com/

What is the correct URL configuration on the global scope when:

  • You are running several different stores on one installation
  • Your backend is on a completely separate node

My understanding is that the default scope base URLs should point to the same domain as your backend, but in my case this value has been set to the "primary" store in the past.

Note that we also specify a custom admin URL in System > Configuration > Advanced > Admin > Admin Base URL > Custom admin URL which is the same as the base secure URL on the global scope.

And running on Apache, our VirtualHost directives are setting the store codes (so that's not an issue here).

I've seen weird issues in the past with URLs being generated on a store at the global scope level (ie: domainb.com generates a URL to separatenode.com). So I'm trying to reconcile these things in my mind, and I believe it has to do with the global scope base URL configuration.

Was it helpful?

Solution

What you mentioned already, is correct. The Global scope is the same as the Admin scope. They are not quite the same, but because all other scopes (Store View, Store, Website) are managed from within the Magento Admin Panel, the Magento Admin Panel needs to have the scope Global to work. This also means that the Base URL of your Global Scope needs to point to the Magento admin URL. However, Magento has also introduced the option "Custom Admin URL" as you mentioned - and this complicates things a little bit. As I understand it, the "Custom Admin URL" should be used if the Magento backend should be only accessed through a private URL (for instance, an internal URL for people behind a corporate firewall) - so this would then become privateseparatenode.com. However, the Magento global scope might still need contacting from the outside world. For instance, if PayPal does an IPN callback, it contacts Magento and this might be on the global scope (don't know if this is actually true or not), and for that reason you would need a public URL like publicseparatenode.com. So in short, the Custom Admin URL is normally only needed if the Admin needs to be accessed through a private method, while the global scope (Base URL in Global Scope) should be publicly accessible.

In short: Your setup seems completely correct in that the Global Scope is using the domain separatenode.com (assuming it is publicly accessible). However, I've seen third party modules in the past that did not respect the scoping at all, and simply loaded stuff from the global scope because that seemed easier. So your issue might be with a third party module (?).

The fact that your Magento backend is on a different node is not important. With Magento, it is suggested that you have one "virtual" application instance pointing to one "virtual" database, even though there could be multiple application instances on different nodes pointing to the same database, or multiple database instances because of clustering or alike. Think of it this way: There is one Magento configuration tree, which has values across multiple scopes. That same configuration tree is accessed from your Magento backend node.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top