001114-3 |
If a user asks for a web page at a certain URL, but that page is no longer stored at the indicated URL, the web browser can automatically download the right web page from another URL. How can this be specified using (a) HTTP commands or alternatively (b) using HTML commands. |
|
Answer |
Method 1: HTTP Redirect (2). The web server responds with the return code "301 Moved Permanently" (1) and the "Location:" (1) field indicates the new URL. Modern web browsers will then automatically get the document fromthe new URL. Example: Method 2: Include, in the <HEAD> of the HTML file, a refresh command (2), Example (1): Method 3: Use Javascript (2). Example: Method 1 is faster, since method 2 and 3 has to show the referral page before loading the new window content. |