You can use the HTML base tag in your webpage to make all the relative links point to somewhere.com instead of somewhere.appspot.com.
<base href="http://somewhere.com/">
You can also use the below PHP code to redirect the user to somewhere.com
$host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
if(!startsWith($host, 'somewhere.appspot.com')){
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://somewhere.com".$request_uri);
}
function startsWith($haystack,$needle,$case=true) {
if($case){return (strcmp(substr($haystack, 0, strlen($needle)),$needle)===0);}
return (strcasecmp(substr($haystack, 0, strlen($needle)),$needle)===0);
}