Store-View – 404 Error When Renaming Store-View Code in Magento 1.7.0.2

store-view

This error has been eating my head since 2 days! I have searched the entire internet!

Scene:
I have a Magento store (1.7.0.2) with 1 website, 1 store and 2 storeviews.

First store view code is my_uk_en

Second store view code is my_uk_ru

Everything works fine until I rename (change) the StoreView to something else.

I renamed the storeview code to my_cz_en, and frontend gives 404 error.

I have checked my index.php and .htaccess files, there is no store called explicitly.

I tried running the new store forecefully by using the following in index.php

$mageRunCode = "my_cz_en";
$mageRunType = "store";
Mage::run($mageRunCode, $mageRunType);

But still same 404!
I also ran a search on my entire database with the old storeview code (my_uk_en) and there was no matches.

The storeview is assigned to a CMS homepage as well. The setting Add Store Code to URL is disabled.

Reindex Done. Cache Disabled

Inspite of all these I don't understand why I am getting 404 error.

Best Answer

I actually had the same problem a few days ago. Make sure that:

  1. You cleared the cache (as always). :)
  2. You have no place in your entire code base which does something like Mage::app()->getStore('my_uk_en'). If you have the old store code somewhere in your code base and try to instantiate a store instance with it, it will give you a 404 page (which is a pretty weird behaviour, but that is the way it is)! To find the place where you still use it, you may use somethink like grep -Ri 'my_uk_en' from the command line.
Related Topic