Table of Contents

OIL2 Class Standard.HTTPredirect

class Standard . HTTPredirect {
        string  pageName;
        string  redirectLocation;
        oid     urlDirectory;
inherits from Object;


Most HTTP-accessible resources are accessed by names that are not considered permanent. Indeed, the World Wide Web owes its very existence to the acceptance of the possibility of invalid links. There are times, however, when a resource's name has been published, either intentionally or as a side-effect of visits by search engines, and a web site administrator needs to store it under a new name. A related situation arises when the resource's name embeds version identification and one wants to publish a generic name that should always be resolved to the most current version. Linux RPMs provide an excellent example of such resource names. On some operating systems, a hard or symbolic link in the file system could be used to enable this functionality, but the retrieved resource would be saved using the generic name rather than the correct name that included the version Id. The HTTPredirect class provides a better solution which does not require any underlying support in the host's file system. An HTTPredirect object creates a logical object in a web site's name space (which is maintained by a URLdirectory object) that redirects any HTTP requests to a new resource name.



HTTPredirect:create(string serverName, string originalURL, string newLocation)

Method Description

The serverName parameter identifies the URLdirectory associated with the web site's HTTPdaemon. The originalURL argument is the logical name for which a redirection will be performed. It should be an absolute name, such as "/index.html". The final argument, newLocation, is the URI to which an HTTP client should be redirected. As an illustration:

HTTPredirect /packages/linux/vistasdk-i386.rpm.gz /packages/linux/vistasdk-3.6-1.i386.rpm