In the site definition, what is the URL address for the testing server?
I have seen this happen before if there was an hatches rule in effect on the server that forced the address to be different from the testing server address,
for example, if the testing server address is:
http://mydomain.com
and you had an hatches rule forcing that to the www address:
http://www.mydomain.com
that error can happen.
if you have an htaccess rule in feet on your site to force a URL, make sure that is what you use in the site definition.