1

Our company is moving it's in-development websites over to a new server on Rackspace using Ubuntu 12.04 LTS and NGINX. The transitions went smooth except for one particular Magento site.

This Magento client's site was previously developed (not by us) with a two store front (same Magento install): first store with a Wordpress integration and the other secondary Magento store alone. The client came to us to separate and take down the first store leaving the Worpress as one website and the other as the the main Magento store (from the secondary store).

In the original development server before we migrated, I was able to successfully accomplish this and both websites functioned on their own as expected. However, after the migration of this Magento site (both database and files), the Magento site loads with the 1st original store (store 1) and not with store 2 as the main store, even though store 2 was set was default in the Manage Stores configuration settings.

  • The store two was set a 'default' in the configuration.
  • Files, folders, and databases are exactly the same
  • Subdomains and domain names are exactly the same
  • Cache was cleared

Key Differences on the servers

Original Test Server

  • OS: CentOS release 5.10 (Final) 64 bit
  • Apache: Apache/2.2.22 (Unix)

New Test Server

  • OS: Ubuntu 12.04.4 LTS 64 bit
  • NGINX: nginx/1.1.19

Why would the exact same Magento website load the correct store (store 2) but load the incorrect store (store 1) on a different server?

  • Did you manage to fix your issue? – Sander Mangel Feb 24 '14 at 21:08
  • I was able to successfully fix the issue and I'll post the resolution as an answer below. – RNickMcCandless Mar 3 '14 at 18:45
3

It's probably due to the .htaccess not being loaded when using NginX. It's a bit of a guess but the MAGE_RUN_CODE is probably set in the .htaccess which is now ignored. Another issue might be the domain setup of NginX, but for that you might need to add your NginX configuration to your question.

On a side note: if you're used to working with Apache (and htaccess) might I suggest setting up both Apache and NginX on the server and using NginX only as a proxy for media files like images and javascript and letting Apache still handle the PHP requests. The performance gain will still be significant but you will have the advantage of working with Apache.

  • Thanks for the detailed answer. This fixed my issue. Your answer should be approved. – Altaf Hussain Nov 21 '14 at 14:01
  • Small change of that ever happening but thanks ;) – Sander Mangel Nov 24 '14 at 8:15
2

With the help of Sander Mangel on giving me a direction on what to look for, the NGINX site configuration MAGE_RUN_CODE did not have the store code as store 2, the store I wanted to show. The solution was to change the MAGE_RUN_CODE to the store code set in store 2 and issue was corrected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.