I moved my magento installation to a new server. I copied all the files,folders and mysql dump to the new server. I configured local.xml to set the new database settings. When i tried the ipaddress in the browser it took me to the default apache page with magento favicon. So I gave to 777 permissions to all the files and folder (I know its wrong). Now When i try the IPaddress in the brower it redirects me to the old magento server link.Why is this happening?


  • Did you clear the cache? Did your change the base url in the database? Does the var folder exist?
    – Marius
    Commented Oct 10, 2013 at 13:18
  • @Marius cleared the cache folder. I didnt change the base url
    – Prem Anand
    Commented Oct 10, 2013 at 13:19
  • 1
    Well...change the base url in core_config_data. Search for the records with the value like your old url an change them
    – Marius
    Commented Oct 10, 2013 at 13:27
  • @Marius can i give ipaddress as value?
    – Prem Anand
    Commented Oct 10, 2013 at 13:43
  • @Marius I changed still it redirects to the old site
    – Prem Anand
    Commented Oct 10, 2013 at 13:49

5 Answers 5


I forgot to update the base url.

UPDATE core_config_data SET value="http://newhost.com/" WHERE path="web/unsecure/base_url";
UPDATE core_config_data SET value="https://newhost.com/" WHERE path="web/secure/base_u

replace "newhost.com" with your domain name.

And added in the httpd.conf file

Options Indexes FollowSymLinks

AllowOverride all

inside the directive that says


You can find the httpd.conf file in /etc/httpd/conf/httpd.conf or /etc/apache2/httpd.conf for linux distros.


Did you solve your issue?

If not make sure also that public_html/app/etc/local.xml is pointing at the right database Also check your .htaccess for any line concerning your old server, I say this because i had same issue and it was because on root/.htaccess file I had forgoten to edit 'SetEnv PHPRC /home/NEWUSER/public_html'


If you tried all steps still it redirects on old IP address and you are using magento than check your database. some time it creates two database one with #-prefix and other one root. Now need to update new IP address in root database

web/secure/base_urel and web/unsecure/base_url. 

Delete cache from var/cache directory.

after that run this query in core_config_data table in Magento. After that you'll not get redirect error.

This process ll work for both Magento 1.9.x and Magento 2.x

UPDATE core_config_data SET value="http://example.com/" WHERE path="web/unsecure/base_url"; UPDATE core_config_data SET value="https://example.com/" WHERE path="web/secure/base_url"

i had same problem try what i did :

Step 1:

romove cache with SSH :

rm -rf /var/tmp/magento/*

Step 2:

PS: In order to use the Magento Connect Manager you may have to reset the PEAR configuration settings. To do this, simply remove the file downloader/pearlib/pear.ini, and a new one will be created automatically.

Step 3:


To make sure that all javascript files, CSS, and images load correctly, you should reset the file permissions to the recommended settings for your new server.

Run the following commands from your Magento root directory (e.g. public_html):

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

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.