Just a day ago my staging copy of our production website was working perfectly. I see no connection with anything that happened since then that could cause this.
http://www.domain.co.uk/
http://devdomain.com/stage/site/
Both of these domains are on the same server, each a separate Magento installation with only one store. Database was dumped from live using mage-dbdump.sh of Sonassi.
At first I noticed the site completely redirects to our live site no matter what URL. After fixing a few things I noticed I can then run any PHP file other than the index.php of Magento, which always does a 302 redirect to live site according to Firebug Net tab. (First header is for stage/site 302 Found, second one is live site 200 OK)
Several more fixing attempts later and it redirects to live site no matter what without even saying in the Firebug Net tab that it redirected.
Here is the list of things I have done trying to fix it (might have forgotten some by now):
chown
on the entire devdomain to ensure everything works as it shouldchmod 755
on all directories and chmod 644
on all files and chmod 550
on the "mage" filehttp://devdomain.com/stage/magento/
and using the same .htaccess as the stage site (replacing all occurrences of "/stage/site/" with "/stage/magento/"). This worked fine.Please tell me what I could have possibly missed.
Chrome caches redirects:
https://superuser.com/questions/304589/how-can-i-make-chrome-stop-caching-redirects
(even though you said you cleared the cache.)
You can also change the base URL on fresh installation to point to the old staging URL, after moving your old staging app to another directory, and verify if the redirection still happens.