|
switch Copyright 2000 - 2002, Stuart Udall
version 1.11: December 30, 2002
|
|
 
This kind of switch is like a PBX for the web. It reduces the transience of web addresses, which are notoriously dynamic. Dynamic addresses make life difficult if you are attempting to use a hyperlink in support of a written work, or a piece of software. For example, a hyperlink embedded into the help of either documentation or software will stop working as soon as the site it points to is rearranged. This is Bad. The switch fixes this by providing a pointer to the correct location of the resource. The switch address does not change, but it allows the underlying resources to move about, be renamed, etc. Just like when you move desks, your extension may change, but your company's reception number stays the same. The software or documentation need only point to the switch, which will then transparently redirect the user to the resource itself. The switch provides a standard location which points to the non-standard locations of web resources. The technology that does this routing is known as a redirector. SWITCH is a program designed to make it simple to create redirectors. It can manage the two types of redirector that the switch currently supports. Type 1 is a redirection to another page. Type 2 is a redirection to a file (used for downloads). SWITCH embeds two methods of redirection into each redirector it creates (irrespective of type). The first method uses the HTTP-EQUIV metatag to redirect the browser. However, this method is flawed in that the redirector itself goes into the browser's history. Thus, when the user presses the Back button, they are taken to the redirector... which then redirects them back where they just came from. This loop can only be escaped from by using the history. To overcome this, SWITCH also embeds a JavaScript-based method of redirection into each redirector. Fortunately, this method is executed in preference to the metatag method, by JavaScript-enabled browsers. Non-JavaScript browsers will still redirect, due to the metatag, however they will get stuck in the loop. But the users of these browsers must get that a lot! So, for most users, who have a JavaScript-enabled browser, the redirection will be transparent and when they click Back, they will return to the page they were on, not the redirector. For any of this to be of use, you must be able to provide a stable web address. This should ideally be a domainname that you control and that is not likely to ever change. If you have such a beast, SWITCH will let you give out URLs with impunity. SWITCH can be used to replace an entire directory tree of HTM files with redirectors. In this case, the visitor is either redirected to a page you specify on a server you specify, or redirected to a page of the same name in the same directory structure, on a server you specify. SWITCH can also be used to create one-off redirectors, which might be useful if you are simply moving a page around. SWITCH is configured with a text-based INI file, although all options can be redefined at runtime.
 
 
This will cause the program to start. You can then select whether you want to create a teleport redirection (to another page) or a sendfile redirection (to a file). Pressing Enter will allow you to customise the parameters of the redirector to be generated:
The next screen allows you to select a target file or directory. If you specify a directory, SWITCH enters 'site relocator' mode. In this mode, it will scan the directory, and optionally all subdirectories, for any files ending in .HTM (note: .HTML is not supported), and generate redirectors for each file. You may select whether to redirect all traffic to a single page, or to pages of the same name and in the same location in the directory structure, on the server you specified in the destination URL field. Note: When creating redirectors, if the destination file already exists, SWITCH will make a backup with a .BAK extension.
 
 
|