I am trying to restore the current running magento 1.6.x to a new location for upgrade, however I am experiencing some issues with 404 with restored site from backup.

Old server is using Apache, new server is using Nginx, and it should ignore all .htaccess from old site, but as you can see http://www.dev.bestinnature.ca/ on both front and backend showing 404, I do not see any error other than 404 from nginx access or error log

Here are steps I've taken

  1. setup a Nginx server, by using this environment I am enable to install a new Magento 1.9 without any issue
  2. backup MySQL DB and entire old site files
  3. restore MySQL DB, change unsecure and secure URL to http://www.dev.bestinnature.ca/
  4. restore site files to new location
  5. remove var/*
  6. change local.xml to new MySQL DB
  7. checked url rewrite from core_config is 0

There must be something from old site configuration that not recognizing the environment since any new install program works on this environment other than this backup.

I don't know what else to look for at this point, anyone can point me out any direction?

  • Can you add index.php to your url and get the correct page? Is it a Magento 404 or your server 404? Jul 19, 2014 at 11:28
  • It's magento 404 because it's shows magento default page, index.php shows 404 as well, if I create a info.php it shows fine
    – Tom
    Jul 19, 2014 at 12:19
  • And you have tried reindexing and clearing all your cache ? Jul 19, 2014 at 12:21
  • Somehow I suspect this is related the Magento not knowing the template,
    – Tom
    Jul 19, 2014 at 12:22
  • Have you switched to the default theme? Jul 19, 2014 at 12:25

4 Answers 4


The following resolved the issue, thanks all for helping

 #fastcgi_param  MAGE_RUN_CODE default; 
  • i change "default" for the name of my store and works.
    – jruzafa
    Oct 26, 2015 at 11:49
  • @Tom, I'm new in Magento, Please could you tell me which file contain this parameter? Dec 2, 2015 at 9:36
  • @AbdusalamElsharif, it's in your nginx conf
    – Tom
    Feb 1, 2016 at 14:14
  • Thank you! I was working on an old site and it was driving me nuts. This worked! Nov 22, 2021 at 22:15

recently i migrated my magento setup to nginx from apache...

for 90% of my problems setting up the nginx.conf solved my problem.... here is the link !!!!


  • Thanks but my nginx works with new magento install, it's not problem for me to load magento site in general
    – Tom
    Jul 19, 2014 at 13:37
  • can you got to var/report in you magento installation directory and see the latest log if any ??? probably you didn't set the your homepage porperly !!! Jul 19, 2014 at 13:50
  • There is no var/report or var/log, anywhere can I check if homepage being configured properly?
    – Tom
    Jul 19, 2014 at 15:59
  • if you can access your admin panel then go to system->configuration->web then in default pages ta you can set your default homepage.... have you set the permissions and owner properly for you magento installation directory using chmod and chown...??? if you can give me a tmporary access then i maybe able to help you !!! Jul 20, 2014 at 17:51
  • oooppps sorry my bad.. it didn't see that you got it working but the i thought you have already followed the steps from the link i shared above... [link]magentocommerce.com/wiki/1_-_installation_and_configuration/… [/link] Jul 20, 2014 at 18:39

Setting a 404 error page via .htaccess follow this http://www.inmotionhosting.com/support/website/how-to/setting-a-404-error-page-via-htaccess

  • 1
    nginx does not use .htaccess files. Jan 20, 2015 at 12:56

I would suggest to check htaccess anyway and uncomment RewriteBase line.

I think you should set it to "/"

  • No difference made
    – Tom
    Jul 19, 2014 at 12:50
  • Nginx does not use htaccess Jul 20, 2014 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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