Redirect to old url after clear the cache in Magento



Today, I have moved one website from our testing server to the client server and every thing was working fine. But the problem arises when I have cleared the cache from the Magento admin. After clearing the Cache it is redirected to the old url (testing server). After doing some research I founded the solution and have solved the problem.

If you are also facing such kind of the problem follow the steps given below and solve your problem. The steps are given below:

Step 1: Navigate to the app/etc/ and make sure, you have only one local.xml, If there is any other local.xml with the suffix or prefix,
Remove that files from there.

Step 2: Now Remove your Magento cache (var/cache) directory manually by using the FTP.

Step 3: Remove your Browser Cache as well.

Step 4: Refresh the page and check it is creating the Fresh cache directory in var folder of the Magento.

Now login to the Magento and Refresh the Magento cache and Reindex the data, I hope the problem has been resolved.

Hope it helps.

Thanks