MBozic
MBozic

Reputation: 1192

Magento website copied to new server, redirects to old

I’ve copied whole magento site(application and database dump) on new server, where we use new address. But when I press the new address in the browser it redirects to the old site.

I’ve changed secure and unsecure url in core_config_data on new server to point to new address. I’ve deleted everything from the cache manually.

If I comment index.php not to run Mage::run($mageRunCode, $mageRunType); and just echo something, it is shown correctly in browser. But if I uncomment Mage::run than it redirects to the old address.

Also it doesn’t read local.xml from this new location at all, because If I just put some random data in it, I don’t get any error and it still redirects to new address.

Does anyone have an idea what might be the problem? Thanks.

Upvotes: 0

Views: 2504

Answers (2)

Aditya Mittal
Aditya Mittal

Reputation: 21

I did the core_config_data updates and refreshed the cache and index, the admin panel works fine but the main site index.php is redirecting back and forth between the old and the new.

There is now a redirect loop. It eventually gives, "This webpage has a redirect loop."

Upvotes: 2

Seth Malaki
Seth Malaki

Reputation: 4486

You can try running the following quer(ies) against your new server's MySQL db first:

UPDATE `core_config_data` SET `value`='http://new.websiteurl.com/' WHERE `value`='http://old.websiteurl.com/' LIMIT 2;

if you have an HTTPS url:

UPDATE `core_config_data` SET `value`='https://new.websiteurl.com/' WHERE `value`='https://old.websiteurl.com/' LIMIT 1;

Then reindex (System > Index Management) and flush magento cache storage (System > Cache Management).

Upvotes: 2

Related Questions