Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 4 of 4
Admin & Frontend turned 404 Error after website change
 
BrentStevens
Jr. Member
 
Total Posts:  23
Joined:  2010-11-18
 

I’m getting a 404 on admin.

Everything was working okay before a problem with my webserver. Hosting company restored a backup copy of files, and I can access the frontend, but not the backend.

When I go to index.php/admin I get: 404 error: Page not found.

I’m at a complete loss on how to fix this. Only my admin area is affected.

I have deleted all the files from the server, and replaced them using the original ZIP file. I then did an installation using the same database, and I get exactly the same 404 error in admin.

Posted this in Technical issues, but no joy there, perhaps it’s an installation problem. Anyone able to help? I’m running the risk of losing a customer because of the length of time it’s taking to get this problem solved.

I’m running 1.4.2.0 by the way.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dichan
Jr. Member
 
Total Posts:  1
Joined:  2010-02-12
 
\"BrentStevens\" -

I\’m getting a 404 on admin.

Everything was working okay before a problem with my webserver. Hosting company restored a backup copy of files, and I can access the frontend, but not the backend.

When I go to index.php/admin I get: 404 error: Page not found.

I\’m at a complete loss on how to fix this. Only my admin area is affected.

I have deleted all the files from the server, and replaced them using the original ZIP file. I then did an installation using the same database, and I get exactly the same 404 error in admin.

Posted this in Technical issues, but no joy there, perhaps it\’s an installation problem. Anyone able to help? I\’m running the risk of losing a customer because of the length of time it\’s taking to get this problem solved.

I\’m running 1.4.2.0 by the way.

I ran into a similar issue before when setting up a development version. The fix is outlined here - http://www.learnmagento.org/magento-bug-fixes/notice-undefined-index-0-in-appcodecoremagecoremodelmysql4config-php/

Basically, when you import the database dump, MySQL changes some ids from 0 to 2, causing issues. Just go in and change the store_id/website_id/group_id/default_group_id for the Admin record in core_store and core_website to 0.

I also fixed group_id and website_id in core_store_group

 
Magento Community Magento Community
Magento Community
Magento Community
 
BrentStevens
Jr. Member
 
Total Posts:  23
Joined:  2010-11-18
 

If that’s the case, then although you’re too late to save the day (I started over fro scratch again), you may have saved another day, as I will need to migrate no less than 4 development sites off the server to another.

What a crazy problem, and many thanks for the fix, it will come in useful, I’ve bookmarked it in my projects database.

 
Magento Community Magento Community
Magento Community
Magento Community
 
kamaljoshi
Member
 
Avatar
Total Posts:  46
Joined:  2011-01-11
Ahmedabad
 

Hi,

Thx dichan, this really wokrs for me. I have changed my db server and got this problem but finally solved it, Thx guys.

REGARDS,
KAMAL

 
Magento Community Magento Community
Magento Community
Magento Community
 
ecech
Jr. Member
 
Total Posts:  4
Joined:  2010-01-09
 

Hi All,

Running 1.4.1.1 ...got 404 for admin suddenly appeared when changing store email addresses in the backend. Clicked “save config” and gone.

Tried all of the above solutions with no luck. ID’s as above are all ‘0’. Moved the database to a new server ~ it worked with some issues (could not edit products); moved the files to the same server, got the 404 again.

About to try new DB with ‘old’ files. Any more success stories, I’d love to hear them!

~ EC

 
Magento Community Magento Community
Magento Community
Magento Community
 
brunomarshall
Guru
 
Avatar
Total Posts:  367
Joined:  2009-08-04
 

Hi,
take backup of your template and
then make a clean install of your magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
guitarboi
Jr. Member
 
Total Posts:  1
Joined:  2011-03-07
 

i’ve been reading all the posts..

but it seems i’ve did something different.
i went to
System > Manage Stores > Store View Name > Default Store View
changed the name and poof.
Error on the front and back end.

Magento ver. 1.5.0.1
Help anyone?
Thanks..

 
Magento Community Magento Community
Magento Community
Magento Community
 
haijerome
Member
 
Avatar
Total Posts:  44
Joined:  2010-07-19
 

Hi I encountered this same problem \”404 Error on both Magento back end / Front end\” and fixed it now grin

Let me share what should be done to fix it by your self.

1. Go to your phpmyadmin or MySQL Server and open your Magento database

2. Open these two tables in different tabs \”core_store\" and \”core_store_group\"

3. And make sure the \”website_id\" and \”group_id\" in \”core_store\" are relevant to the \”group_id\" in \”core_store_group \"\" and \”website_id\" in \”core_website\". As well as make sure the root_category_id of your group is 2.

NOTE : Store group is none other than your \”Store Name\” and Store is none other than your store views

Thats it go to var/cache directory and delete the folders inside it and clear the sessions too in similar way at var/sessions directory.

FYI : I have attached the screen shots of the database tables.

Regards,
Jerome Dennis D
Magento over all Customization | Magento Custom Module development | Magento Add Customer Custom Attribute on Back End | Magento PDF Invoice / Shipment / credit memo Customization

+919846219974

 
Magento Community Magento Community
Magento Community
Magento Community
 
preethi
Jr. Member
 
Total Posts:  3
Joined:  2010-05-26
 

I am getting the same issue but just in the admin.

Its showing a 404 not found page.

Can anyone help me out?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
sprise
Jr. Member
 
Total Posts:  3
Joined:  2012-01-26
ARIZONA
 

Tried to add a store in 1.6.2, using the proper Control Panel means, and the entire site went up in 404 flames. It is amazing that this issue persists.

Opened index.php and made change to this code:

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE''default';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE''store';

Mage::run($mageRunCode$mageRunType);

In the above snipped, MAGE_RUN_CODE was formerly just a blank value ‘’ - changed to default and the whole thing came back up. Hopefully this helps someone.

 
Magento Community Magento Community
Magento Community
Magento Community
 
DayMen
Jr. Member
 
Total Posts:  4
Joined:  2012-02-29
 

Note… If you are moving magento database from dev to prod… TURN OFF CACHE in dev before you back it up.. We are pretty sure our 404s (back and front-end production) were caused by backing up the dev database with Cache ON.  This drove us nuts for a day or two. finally we saw an obscure reference to turning off cache before export and sure enough it worked for us.

 
Magento Community Magento Community
Magento Community
Magento Community
 
shaun8line
Jr. Member
 
Total Posts:  6
Joined:  2012-06-12
 

I\’ve gone through every technique mentioned on the thread and haven\’t gotten anything to work yet. I\’m only getting 404s when I try to navigate to stores that have a different store view. I\’ve tried links with an href of {{store url=\"test/?___store=default\"}} and {{store url=\"test\"}} 404 both ways. I\’ve tried navigating directly to the site from my browser with http://www.mystore.com/test Still 404. No problems with my admin pages, or pages that are under the default store view.

First I tried what looked like the simplest technique, change the code in index.php to default:

/* Store or website code */
$mageRunCode = isset($_SERVER[\'MAGE_RUN_CODE\']) ? $_SERVER[\'MAGE_RUN_CODE\'\'default\';

/* Run store or run website */
$mageRunType = isset($_SERVER[\'MAGE_RUN_TYPE\']) ? $_SERVER[\'MAGE_RUN_TYPE\'\'store\';

Flush the cache, delete the /var/cache, no effect.

Then I tried modifying the database, a couple of ways based on the two posts that mentioned it. Flush the cache, delete /var/cache, no effect.

Attached are some screenshots, hopefully somebody can notice what I\’m doing wrong. It\’s surprising no Magento administrators have commented on this thread yet, as it appears to be an ongoing problem. As you can see from the Manage Pages screenshot, the only page i\’m trying to get on a different store view is test.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandammo
Jr. Member
 
Avatar
Total Posts:  18
Joined:  2009-06-04
Surrey, UK
 

I’m getting the same issue as you shaun8line!

When trying to change to the store_view via the admin dropdown in system>config it reloads the page with a front-end 404 error. Any help on this would be really useful as we are not able to finish a project that has been going on for a while now smile

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
rachi_1977
Jr. Member
 
Total Posts:  2
Joined:  2012-04-29
 
sprise - 07 March 2012 08:47 AM

Tried to add a store in 1.6.2, using the proper Control Panel means, and the entire site went up in 404 flames. It is amazing that this issue persists.

Opened index.php and made change to this code:

/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE''default';

/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE''store';

Mage::run($mageRunCode$mageRunType);

In the above snipped, MAGE_RUN_CODE was formerly just a blank value ‘’ - changed to default and the whole thing came back up. Hopefully this helps someone.

Thank you, thank you, THANK YOU!!! I have been running on the same mousewheel all day looking at a 404 page error - now I see my site - the CSS took a beating but that is a whole other issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
terencetengker
Jr. Member
 
Total Posts:  2
Joined:  2011-01-05
 

I ran into this issue also when changing a store via the backend. Managed to solve it:

a) I did the following based on an earlier post
1. Go to your phpmyadmin or MySQL Server and open your Magento database
2. Open these two tables in different tabs:
3. table \”core_store\” -> check \”website_id\” and \”group_id\”
4. table \”core_store_group\” -> check \”group_id\” and \"default_store_id"\

I reverted the changes i made in admin backend to store and storeview.

b) I did this next based on an earlier post:
Check index.php and find the following:
--------------------------------------------
/* Store or website code */
$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘ ‘;
--------------------------------------------
I added ‘default’ to the empty tag at the end so it became
--------------------------------------------
/* Store or website code */
$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘default’;
--------------------------------------------
this had no result, so I tried the specific website number (in my case nr. 1)
--------------------------------------------
/* Store or website code */
$mageRunCode = isset($_SERVER[’MAGE_RUN_CODE’]) ? $_SERVER[’MAGE_RUN_CODE’] : ‘1’;
--------------------------------------------
this worked and site is up and running again.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 4 of 4