4

Edit: solved

I moved my magento-installation to a new domain, copied the database, changed the app/etc/local.xml to show to new database, changed the web/unsecure/base_url and web/secure/base_url and cleared the var/cache directory. The shop itself works with the new domain. But when I want to access the admin panel I get redirect to old url.

I also checked for system -> config -> admin -> admin BaseURL if there is any user specific settings. -> Its not.

I also checked in htaccess for any redirects. -> none.

What else could cause this redirect? I am out of ideas.

6
  • Did you update the app/etc/local.xml to point to the new domain's database?
    – MW Millar
    Commented Jun 18, 2015 at 13:17
  • @kaska yes I did (forgot to mention that)
    – nbar
    Commented Jun 18, 2015 at 13:19
  • 2
    please delete all filers from you magentodir/var/cache
    – Amit Bera
    Commented Jun 18, 2015 at 13:41
  • @AmitBera I cleared the hole var/cache folder
    – nbar
    Commented Jun 18, 2015 at 13:43
  • @AmitBera I did it again and now it works. I am not sure what went wrong there and what the answer to my question is now. But thanks for encourage me do it again!
    – nbar
    Commented Jun 18, 2015 at 13:48

8 Answers 8

6

As my comment solved your problem I will post it as an answer.

According to magento takes all config data from cache folder you have to clear the magentodir/var/cache - including all subfolders - to be sure the new config is taken.

You said you allready cleared the cache, my advice is to check this point again. (Maybe you cleared the cache before you did the necessary changes?)

4

Check your core_config_data table with following filter

scope => stores
scope_id => 0
path => web/unsecure/base_url

scope => stores
scope_id => 0
path => web/secure/base_url

if the value is http://olddomain.com then change it new domain or delete the record.

2
  • I have only scope => default scope_id => 0 for both entries
    – nbar
    Commented Jun 18, 2015 at 13:22
  • And this are set to newdomain
    – nbar
    Commented Jun 18, 2015 at 13:29
1

I believe the problem come from the URL index cache. Let's do these steps to make sure you can fix it.

  • Login to Phpmyadmin or any database method to empty the table core_url_rewrite (remember back up it first to make sure you have no risk).
  • Make sure you clear all browser cache or use another browser and login to admin of magento. Now you will see it won't redirect to old domain any more.

Hope it 's useful

3
  • Good points. I actually did this (I did not empty the core_url_rewrite, but searched it for any URL that could cause the problem. I also checked it with Incognito mode to be sure I don't have any cookies. I upvote cause if someone else got the problems I think this points are good hints.
    – nbar
    Commented Jun 18, 2015 at 16:03
  • For the best, I think you should use another browser to make sure you have no cache. Browser like chrome have some crazy behavior for cache
    – Phuc
    Commented Jun 19, 2015 at 1:00
  • You shouldn't suggest to clear the core_url_rewrite table. That's a darn useful table that stores all the rewrites that magento has setup along with user created as well. You could wipe out years of work with this and can never be a solution.
    – Whip
    Commented Nov 17, 2016 at 10:13
0

As someone mentioned above, check the core_config_data table, but instead query the value field. You could have created a new record with a different scope.

I ran this query SELECT * FROM 'core_config_data' WHERE 'value' LIKE '%http%' and spotted a 2nd copy of web/unsecure/base_url under a different storefront.

0

The solution to this for me was to flush the Redis cache. A similar solution probably applies if using Memcached.

0

After all of that still you have problem Try

sudo reboot

ftom putty.

1
  • yes it solved issue. Commented Nov 11, 2019 at 9:17
0

Recently experienced the same thing on a Magento 2 install, having already updated my app/etc/env.php and all the references in core_config_data and run a cache:flush. Running setup:di:compile fixed this for me (even though the site I'd moved was in development mode).

0

If for someone all the above solutions won't work: check also the value for web/secure/base_link_url and web/secure/base_link_url in table core_config_data. Normally it uses the base url variables ({{secure_base_url}}, {{unsecure_base_url}}).

But lately I transferred a shop from a external developer and both values were linked to the old domain that triggered the redirect.

Both configs exists in Magento 1 an Magento 2.

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.