I have moved my database and Magento files to my new domain as had problem with my old domain. I have changed the local.xml file to point to the new database and I've changed web/unsecure/base_url and web/secure/base_url in the database and I searched for any other section in the database that had my old domain name.

My problem is that if you put my domain name www.example.co.uk gets redirected to www.example.com, I have spoken to my host company and they say the domain is setup correctly and it's a problem with the Magento files. If I remove all Magento files it doesn't redirected to the old domain.

If anyone can advice what other file I need to look at to stop the redirection I will be very grateful.

I look forward in hearing back from you.

  • 2
    Did you check your .htaccess file ? Index.php ? Try looking for your old domain name in the file: run 'grep -r "yourolddomain" .' in a console – Raphael at Digital Pianism Sep 23 '15 at 15:14
1) Copy all file of site to new host
2) Database setting
    i. App/etc/local.xml
    -- Change setting here of new database in new server

3) Url Configuration:

Open phpmyadmin 
find core_config_data table 
find web/unsecure/base_url and change to new URL 
find web/secure/base_url and change to new URL 

4) Clear cache
5) Remove the php.ini file if there is any before placing original files

# Change media directory permission to 777  

Follow this solution. if didnt work then i can help your personally on phone and email as you need it on urgent basis.


I suppose it's a cache issue. Try to clean up cache directories (cache, full_page_cache) and sessions (just to avoid some errors).

And you know, I prefer replace an old domain with new one in the SQL dump file. You may use this command

$ sed -r 's/(www\.)?source\.domain\.com/target-server.domain.com/g' inputfile.sql > outputfile.sql

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.