I have created the new magento site and importing the data from the old site but I have the problem with the URLs. Old site URL starts from www.sitename.com but in my new site it starts from sitename.com without www. Now I am trying to add WWW in my magento site or remove the WWW from the old site through .htaccess file

but the problem is when I change the magento site bse URL to www.sitename.com it is giving server not found error

I have also used the htacess rule to remove the WWW from the old links?

2 Answers 2


Change the URLs in your DB dump prior to import.

sed -i "s/www.old.com/www.new.com/g" db.sql

After importing the database tables update the values in the core_config_data db table for web/unsecure/base_url and mention the one without www. If your urls are not working without www ie you got error on http://yoursitename.com then upload one test file to confirm that this issue is related to server or not. Also try to delete the contents of var/cache folder. Hope it helps.

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.