Skip to content

Instantly share code, notes, and snippets.

@mwin007
Created November 8, 2015 06:10
Show Gist options
  • Save mwin007/0cccc7068f8e7943154a to your computer and use it in GitHub Desktop.
Save mwin007/0cccc7068f8e7943154a to your computer and use it in GitHub Desktop.
Error 404 - Can't access backend after moving to new server on Magento
Error 404 - Can't access backend after moving to new server
up vote
0
down vote
favorite
1
I have moved my website on a new server (domain name is the same). Frontend is working properly but admin login page gives a 404 Not Found error.
Most posts about this issue suggest the solutions mentioned on this post Transferring Magento website, admin panel URL gives 404
I've tried all of them but nothing worked. Is there something else I could do to fix this?
admin 404
shareimprove this question
asked Oct 29 '14 at 10:13
ktsixit
141311
add a comment
4 Answers
activeoldestvotes
up vote
4
down vote
The reason for this error is that store_id and website_id for admin should be set to 0 (zero). But, when you import database to new server, somehow these values are not set to 0.
Open PhpMyAdmin and run the following query in your database:-
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
Back up database before making any changes also see log file to find exact issue. Also you can refer link 404 magento admin error Hope this is helpful to you
shareimprove this answer
answered Oct 29 '14 at 10:24
Bhargav
100111
Hi, I have already done that, but didn't work. – ktsixit Oct 29 '14 at 10:28
Sorry for that ... – Bhargav Oct 29 '14 at 10:32
nude-webdesign.com/… check this – Bhargav Oct 29 '14 at 10:36
The link suggests the same solution that you mentioned and I also cleared cache. Still not fixed though – ktsixit Oct 29 '14 at 10:40
add a comment
up vote
1
down vote
I've run into a couple of things myself that could cause this
make sure the .htaccess is in place in the root directory
make sure mod_rewrite is enabled on the new server
check the Base urls in the core_config_data table
make sure caching is off or refreshed
check file owner and permissions of the files
shareimprove this answer
answered Oct 29 '14 at 11:40
Sander Mangel
23k2566
add a comment
up vote
1
down vote
You need to go your server directly and do this via SSH/ FTP
You have to delete the following file
app/etc/use_cache.ser
If you get an error after that like
Notice: Undefined index: 0 in /srv/www/vhosts/javra.com/htdocs/munchad2/app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92
Then go to your Database Management.
Open PhpMyAdmin Go to your database Click SQL Run the following SQL Query: _
SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;
Some thing strange happens with the cache when you move the databases from one server to another so it seems like you need to clear it out.
shareimprove this answer
edited Oct 29 '14 at 11:40
answered Oct 29 '14 at 11:34
Nikunj Patel
1114
hi check This solution? – Nikunj Patel Oct 29 '14 at 12:47
add a comment
up vote
1
down vote
TRY THIS..re import ur db backup your database add the line below to the top of the .sql file. This will prevent SQL from automatically assigning the id of 1 when we need it to be 0.
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
if no success check this link also after tried the above mentioned one Magento 404 on Admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment