Table of contents
A simple and secure solution is the redirection method. The browser handler does not respond with the actual web page but with the information about the location of the web page in the appropriate format. In other words: the browser handler tells the browser only the web page's URL. This means, that the browser must send another HTTP request to the same server requesting the web page in the desired format. Therefore, the browser must send two HTTP requests per web page. This is the major disadvantage of this method, if the browser communicates over a low-speed and high-delay data connection like a cellular network.
The advantage of this method is the secure handling of access protected directories and/or files. The browser handler does not read any files from disk. Therefore, it does not need to consider the same access rules as they are defined for the web server itself. The browser must always request the web pages, so that the web server checks the access rules.
An HTTP redirection response including the header looks as follows:
HTTP/1.1 302 Found Connection: close Date: Sun, 25 Feb 2001 18:42:53 GMT Location: http://webcab.de/ Server: Apache/1.3.9 (Win32) ApacheJServ/1.1.2 Content-Type: text/html Client-Date: Sun, 25 Feb 2001 18:42:54 GMT Client-Peer: 127.0.0.1:80 Title: 302 Found <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <HTML><HEAD> <TITLE>302 Found</TITLE> </HEAD><BODY> <H1>Found</H1> The document has moved <A HREF="http://webcab.de/">here</A>.<P> </BODY></HTML>
The server response code "302" in the first line of the server response tells the browser that the file can be found at another location. The HTTP header field "Location" includes the new location as a URL. If the browser supports the automatic redirection, then it takes the new URL and sends a second request using the new URL.
If the browser doesn't support automatic redirection, the response's body encompasses a rudimentary HTML page with the necessary information. A hyperlink with the new URL is provided so that the user is able to select it and to send a second request.
Copyright © 2001-2003 by Rainer Hillebrand and Thomas Wierlemann