Magento – Multiple stores – home page ok, but category and cms pages 404

404-pagehttp-error-404magento-1.9multistore

I am adding another store to an existing Magento install: main-store.com works fine and I am adding main-store.com/nested-store. (There is currently a holding page at nested-store.com, which I will redirect to main-store.com/nested-store when it is ready to go live.)

I have created a new website, store and store view in Magento for nested-store. I have created a new root category and sub categories for nested-store. I have updated the base url for the new store to be main-store.com/nested-store. All other urls use {{unsecure_base_url}}, {{unsecure_base_url}}/skin etc.

The problem I have is that the homepage of main-store.com/nested-store looks fine, but when I click on any links, e.g. main-store.com.nested-store/shop (which is my root category for this store) or main-store.com.nested-store/about, I see the 404 page for main-store.com.

I have created the category hierarchy and added lots of cms pages, all of which I cannot access at the moment. When I try to preview the about page (main-store.com/nested-store/about/?___store=nested-store), I also see the 404.

Why is the nested store linking to only pages in the main store?

Best Answer

My first guess is, that magento can't see, that you are surfing on your new store, instead of your old store under the category nested-store/about. Therefore the first thing you have to check is, whether magento uses the right storeview here.

If this is not the case, then you should add a vhost configuration wich sets the right website/storeview, like this:

SetEnv MAGE_RUN_CODE {storecode}
SetEnvIf Host www\.domain2\.com MAGE_RUN_CODE={storecode}

or

SetEnv MAGE_RUN_CODE {websitecode}
SetEnv MAGE_RUN_TYPE website

If this is the case, the only idea I have is to dig into the routing with xdebug or any other debugger of your choice and check what happens inside.

And a side note: Having a store in a subdirectory of another store might count as "a bad idea" :-)

Related Topic