Here's how HTTP works.
Browser sends a request in a specified format.
Server responds with:
1) HTTP headers
and, if appropriate
2) Body (stream of bytes, which might be HTML, a jpeg, a downloadable file)
Headers might look like this
HTTP/1.1 200 OK
Date: Wed, 11 Feb 2004 21:10:14 GMT
Server: Apache/2.0.45 (Unix) mod_ssl/2.0.45 OpenSSL/0.9.6b PHP/4.3.1
Accept-Ranges: bytes
X-Powered-By: PHP/4.3.1
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Notice the first header, which means "OK." It might instead be result code 404, which means "no such document." Or 301, which means "moved permanently."
If you do this:
header('Location: http://www.yahoo.com/');
the server will emit code 301 and will include your explicit location line among the header lines. A browser will consider that a "redirect" instruction and will go get the new URL.