will help you The behavior of your browser is correct. The Location: response header has no meaning for status code 404 (compare 14.30 Location and 10.4 Client Error 4xx). Therefore the response's hypertext body is displayed in the browser - as specified by the HTTP specs for code 404 (see 10.4.5 404 Not Found).
error_page 404 = /404.php;
header("Location: http://google.com"); # PHP sets 302 status code
Windows phone background transfer service is not working with the redirect urls with status 302