switch

Copyright 2000 - 2002, Stuart Udall

overview
important bits
installation
configuration and startup
controls and methods
issues and limitations
planned improvements
revision history
download

version 1.11: December 30, 2002


 
  overview next section top of page

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.


 
  important bits next section top of page

  • requires MS-DOS 5.x or higher

  • the following points are this program's terms and conditions of use:
  1. this program is hereinafter known as "the Software"
  2. the Software comes with no warranty and is used at your own risk
  3. the Software is not (and will never be) complete and as such may behave strangely
  4. the Software is the copyrighted property of the author
  5. the Software is freely distributable
  6. there is a feedback form here
  7. the Software is shareware - if you like it, please register by sending a cheque or money order for 10 pounds sterling to the following address:
    Stuart Udall
    PO Box 2855
    London
    United Kingdom W1A 6LW
    
    Registering does two things:

    1. encourages me, and helps me buy bread, water etc
    2. lets me email you when I make a new version

    The software provided is fully functional however and nothing will happen if you never register. Except I may die, and you may miss out on an important bugfix. :)

    Thankyou in advance. If you want me to email you with updates etc., don't forget to include your email address!

    A printable form is here.


 
  installation next section top of page
  1. run the self-extracting distribution archive

 
  configuration and startup next section top of page
  1. (optional) edit SWITCH.INI and change the settings, as appropriate (they are pretty self-explanatory)

    Note: SWITCH requires SWITCH.INI in the current directory at startup.


 
  controls and methods next section top of page

  • type SWITCH from the command line

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:

  • destination URL is the URL you are redirecting to
  • title is a message which is displayed in the browser's titlebar while redirection is taking place
  • bodyHTML is HTML to embed in the BODY tag of the redirector - use this to control the background colour, text colour, and hyperlink colours
  • text1 is the first of two lines of text displayed in the body of the redirection page
  • text2 is the second of two lines of text displayed in the body of the redirection page

    The two lines of text can contain anything you like, including HTML and JavaScript. The INI file distributed with SWITCH contains a sample.

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.


 
  issues and limitations next section top of page

  • does not support longfilenames


 
  planned improvements next section top of page

  • edit/delete existing sendfile/teleport

 
  revision history next section top of page

November 14, 20001.0initial development
January 11, 20011.01improved interface; packaged as self-extracting EXE
September 8, 20021.10added site relocator mode
December 30, 20021.11added support for Windows NT4 and 2K

 
  download top of page

switch.exe  library