Site is redirecting to old domain on button submission, files are linking to old domain I have a D7 site at www.example.com, an old one, not updated since 2012 (Drupal version 7.34). I made a clone copy with separate clone database under dev.example.com

All files like CSS are still linking to www.example.com (while they are available at dev.example.com).

And most important, on /admin/ backend when under dev.example.com if you click any Submit button in any page, it redirects to the www.example.com website. So if I submitted any operation at dev.example.com/admin/* it redirects to same page at www.example.com/admin/*

I've cloned websites million times, I never had this behavior. How do I prevent redirects for files and on submissions?

update: I found in settings.php I have $base_url = www.example.com enabled, can somebody confirm this is the reason?
Yes, you have to edit it to dev.example.com. In the Drupal code, the modules use a function who returns the base URL. So if this URL is the old site... it resolves to the old site. 

It's also used to protect your website against XSS.