6

As per the title, I've set up a new store on a different domain and all pages including the home page are returning 404.

I've tried pretty much everything, and I'm wondering if any of you can think of a good way to debug this.

I've tried:

  • Clearing Mage cache, reindexing
  • Clearing APC cache
  • Reloading nginx
  • Creating a new CMS page at a certain URL to see if that will load
  • Disabling web server rewrites
  • Checking store config against other stores that do work (default cms page etc)
  • Trying default URLs (e.g. /customer/account)
  • Changing the Nginx configuration a few times based on various examples (and also based on the other working Nginx configuration files that are in use)

The site is loading the correct theme, but not finding any content for some reason - it just gives me a 404 page no matter what URL is given.

At this stage, I'm not sure if it is a server config issue or a Magento config issue.

A version is EE 1.12.

Current Nginx conf file is as follows (removed any sensitive variables):

server {
    listen 000.00.000.000:80;
    listen 000.00.000.000:443 ssl;
    server_name subdomain.site.com;
    root /var/www/vhosts/companyname/staging;

#   SSL Configuration redacted

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
#        try_files $uri $uri/ /index.php?q=$uri&$args;
#        expires 30d;
    }
    location @handler {
#        rewrite / /index.php?req=$uri;
        rewrite / /index.php;
    }

    location ~ \.php/ {
        rewrite ^(.*\.php)/ $1 last;
    }

    location ~ \.php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }

#        expires        off;
#        fastcgi_pass   stagebackend;
#        fastcgi_param  HTTPS $fastcgi_https;
#        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
#        include        fastcgi_params;

#copied config below

        expires        off;
        fastcgi_pass   stagebackend;
        fastcgi_param  HTTPS $fastcgi_https;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        fastcgi_param  MAGE_RUN_CODE site_en;
        fastcgi_param  MAGE_RUN_TYPE website;
        include        fastcgi_params;

#end copied config

    }

}

Relevant settings for the view are (the cms page defined here does exist and is enabled for the storefront):

SEO:

  • Web server rewrites: No

Default Pages:

  • URL: cms
  • CMS Home Page: Home Page
  • Default No-Route URL: cms/index/noRoute

Any ideas would be much appreciated!

2 Answers 2

0
  1. Make sure the default store view of your default store of your default website is not disabled.
  2. Flush your cache's
  3. Reindex Data
  4. Set Main website as default and then set back your website as default.

If this is not helping you need to debug the issue since it may either be your .htaccess issue or issue from index.php Open the index.php in root directory of the Magento installation and comment the line

Mage::run($mageRunCode, $mageRunType);

(you will find this line near the end)

Run your website if you still find a 404 page not found error it's a .htaccess issue, try renaming the same

1
  • Thanks, I know it is running Magento ok because it is loading the theme's 404 page. Caching and reindexing have been tried already unfortunately, and the store and store view are both enabled.
    – jsims281
    Aug 10, 2016 at 15:29
0

I answered a similar question in this link here:

Need cookies help to save information

Sounds like your Magento setup is right, what I think is missing are the symlinks to the Magento folders:

Use SSH to access the root folder of your new store (e.g.: /home/example/example.com/html/store2/) and execute this:

ln -s /home/example/example.com/html/app/ app
ln -s /home/example/example.com/html/includes/ includes 
ln -s /home/example/example.com/html/js/ js 
ln -s /home/example/example.com/html/lib/ lib 
ln -s /home/example/example.com/html/media/ media 
ln -s /home/example/example.com/html/skin/ skin 
ln -s /home/example/example.com/html/var/ var

This link here has more information that can help you as well.

5
  • Thanks for the idea, in this case (I should have mentioned) that all the sites are located in the same folder, and nginx is pointing to the same folder for each one.
    – jsims281
    Aug 10, 2016 at 21:16
  • So are you using like a parameter in the URL to change the stores? Aug 10, 2016 at 22:05
  • It's using fastcgi_param MAGE_RUN_CODE site_en; and fastcgi_param MAGE_RUN_TYPE website, but I've also tried hard coding the values into the index.php depending on the url
    – jsims281
    Aug 11, 2016 at 8:28
  • But what is the final result in your URL? Do you have: www.store1.com and www.store2.com OR store1.site.com and store2.site.com OR www.site.com/store1 and www.site.com/store2 OR maybe www.site.com/?store=1...or is always the same URL? Aug 11, 2016 at 16:18
  • how can i run above commands for localhost Magento in windows os
    – zus
    Dec 16, 2017 at 12:47

Your Answer

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

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