3

With magento, I trasnferred the site to a new server but when I try to login to admin, it keeps redirecting back to old domain. I cannot seem to get this working.

Is there a place where I could fix this issue?

5
  • Did the domain remain or did it change with the new server, too? Sep 21, 2011 at 8:25
  • it changed with the new server
    – user952543
    Sep 21, 2011 at 9:32
  • Did you change the value(s) of the web/cookie/cookie_domain paths in table core_config_data as well? Sep 21, 2011 at 12:56
  • 1
    This issue is actually solved by making var and cache directory writable!!!
    – user952543
    Sep 22, 2011 at 4:29
  • 1
    Thanks @user952543, I deleted my var/cache/* files and issue was immediately fixed! (So I guess there was some invalid cache not deletable or something like that?)
    – Ali Alwash
    Jan 23, 2016 at 19:13

5 Answers 5

8

1) Update base url and secure base url in the core config data table

2) truncate core_session table

3) Run this 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;

4) Clear /var/cache/* and /var/session/*

5) Clear your browser cache/cookies

Make sure the entire var directory in the magento root is chmodded to 777!

1
  • When I run your query it comes with this message: You have to choose at least one column to display
    – user952543
    Sep 21, 2011 at 12:11
1

You have to change your base url and secure base url from core_config_data table

2
  • I did change those two settings but it still does this. I've also cleared cache and session folders after the change but still same...
    – user952543
    Sep 21, 2011 at 7:37
  • 1
    check again then there is no other reason for that behavior
    – Anton S
    Sep 21, 2011 at 7:40
1

If you have multiple stores setup make sure you change the base url for default config and store view.

Also, make sure the base url ends in /

http://websitename.com/

not

http://websitename.com

0

============Step 1=======================

In phpmyadmin find core_config_data and on its last page deleted the entire fields not just the data in them:
admin/url/use_custom
admin/url/custom
web/secure/base_url
web/unsecure/base_url

==========Step 2=========================

In /public_html/var/cache/ delete all the files:
mage--1 through mage--f 
0

I usually performs these steps:

1) update all references to your old domain your core_config_data db table

2) delete cache files /magento_root/var/cache

3) clear browser cookies

2
  • What's the point in giving the same answer that has already been given?
    – Kenny
    Sep 21, 2011 at 8:54
  • It's not the same answer if you look at those in details. It is different from the other ones (it includes additional steps or doesn't consider necessary some of them). Please think before setting -1. Sep 21, 2011 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.