0

After copying a Magento installation from domain.com to dev.domain.com to see if we could update safely from 1.8 to 1.9 the system automatically redirects to domain.com, even after editing the configuration through the MySQL database. Both the insecure and the secure path URLs have been changes to match the dev.domain.com server, yet the site redirects to domain.com.

The backend of dev.domain.com works in a strange way now. Once I access it, it doesn't redirect. I log in, and it redirects me to the domain.com backend login page. Yet, if I add 'dev.' in front of the URL (leaving the session key as is), it brings me to the backend albeit through what seems to be 10 redirections. When I get there, all the tabs are 'greyed out'. I cannot hover them to bring up the menu panels.

Everything seems to be correct but I am not sure what else can affect this. I have erased the cache & the session directories, yet with no avail.

NB: I have also checked if any .htaccess files were misconfigured. The only one I edited was the one in the root directory to change 'www' to 'dev'. Neither 'www' nor 'dev' makes any difference with the problem.

Bart Pelle
  • 747
  • 1
  • 5
  • 18

2 Answers2

1

Did you change chanfiguration in core_config_data table? I mean change all 'http://domain.com' values to 'http://dev.domain.com/.

Than you should clear cache/session on server. If it don't work, try to enter dev.domain.com on incognito mode in browser, because of session/cookies entries in browser.

I hope it helps.

kuba_ceg
  • 930
  • 9
  • 16
  • Yes, both the secure and insecure ones have been altered. The session/cache have been cleared aswell. Accessing it from incognito mode doens't work either :(. – Bart Pelle Nov 11 '14 at 15:33
  • 1
    Maybe try to search and edit all values with '%domain.com% in `core_config_data` table, maybe you set domain in cookie/session settings. It's weird i make it thousand times and it always works ;D – kuba_ceg Nov 11 '14 at 15:45
  • The only results that came up are the two `secure` and `insecure` URLs but those already have been changed. – Bart Pelle Nov 11 '14 at 15:47
  • Did you change directory for dev installation? Make sure that if you enter on dev.domain.com you are in right directory on server. And make sure that your dev installation uses proper database connection (I suppose you have 2 databases now, for dev and for normal installation). Last idea is to check where Magento saves cache (/tmp or var in Magento base dir). – kuba_ceg Nov 11 '14 at 17:52
0

Usual reason for this redirection is:

  1. failure to clear cache after changing the base_url settings in core_config_data so the config info will reload

  2. clearing cache fails to reload the config data due to improperly set file permissions which have forced Magento to create its cache elsewhere like in system /tmp

Ancilliary problems due to not setting RewriteBase properly in .htaccess

For how badly file/folder permissions can mess you up and other things to check, follow the next three links:

Can't change Magento base URL, stuck in cache

Magento Redirects to Old Website regardless of what changes are made!

How can we stop a Magento site clone from redirecting back to live site?

Community
  • 1
  • 1
Fiasco Labs
  • 6,457
  • 3
  • 32
  • 43
  • Is there any way to figure out where Magento stores the cache? I've read that people had it occurring that the cache was in a different directory, but I'm no PHP god so I have no idea where I'd debug this. – Bart Pelle Nov 12 '14 at 08:53
  • Look into `/tmp/magento` directory if it exist it could be problem with cache, so then delete this directory and fix permissions for `var` directory in magento installation http://www.magentocommerce.com/wiki/groups/227/resetting_file_permissions, after fixing permissions go to dev.example.com and check if `var/cache` directory is filled with some files. – kuba_ceg Nov 12 '14 at 14:07