I have multiple websites in a store. I want to delete two of them. Including the main website and its stores and store views. After I delete them when i try to access my site from the websites that are not deleted it displays page not found error. What could be the cause for it and how can I solve it?
Magento – Deleting website in Magento gives page not found error
404-pagemagento-1.7multistorestore-view
Best Answer
You shouldn't delete the store with id 1.
In the method
Mage_Code_Model_App::getStore
there is thisThis means that when you are installing, or running upgrade scripts, the result of
_getDefaultStore
is used as a store._getDefaultStore()
looks like this:And since the constant
DISTRO_STORE_ID
is1
, this means that for installing and running upgrade scripts the store with ID 1 is used. Deleting it can cause malfunctions.Try to change the id of a store view (the default one) to 1. The constraints on the tables should change it everywhere else. This process may take a while, so be patient. And back-up your database before trying it.