Just in case someone else comes across this issue.
1) Check that the base URL is set or uncomment it in the settings.php around line 247. Mine was set to the old URL and did a www redirect.
2) Check your .htaccess file in case there are some hard coded redirects. Look for the full URL.
3) As mentioned before in the accepted answer, check permissions are correct. Some really good help here:
https://www.drupal.org/node/244924
4) If you have the global redirect module enabled turn it off.
drush pm-disable globalredirect
drush cc all
or use SQL and truncate the cache tables manually:
UPDATE system SET status=0 where name='globalredirect';
5) Apparently mobile tools can also cause the redirect.
https://www.drupal.org/node/1713462#comment-6312804
drush pm-disable mobile_tools
drush cc all
Or with SQL
UPDATE system SET status=0 where name='mobile_detect';
6) Secure pages can also cause the redirect. This is what it was in my case. You can set the base path variable to your new domain using either drush:
drush vset securepages_basepath 'http://example.com'
drush vset securepages_basepath_ssl 'http://example.com'
drush cc all
Or disable secure pages entirely via drush:
drush pm-disable securepages
And here via SQL and truncate the "cache_*" tables yourself:
UPDATE system SET status=0 where name='securepages';