not when the page you're going back to says "redirect to yahoo". Obviously.
I don't know what you're trying to do exactly, but you might want to check the value of getenv("HTTP_REFERER") and use
if ( strstr( getenv('HTTP_REFERER'), "mydomain.com" ) ) {
header('Location: http://www.yahoo.com');
}
to redirect if the last page was on your site.