AlpineWeb Home
Search: For:   ~ Advanced Search  
  Support Home     Documentation     Knowledgebase     Help Desk     Blog 
Support Home > Hosting > VPS2/3 > Webserver > CGI > Library > Sunday, July 20, 2008

VPS2 CGI Library: redirect


One simple way to allow visitors to easily jump from one section of your web site to another is by using a redirect script. A small form and simple CGI can be designed to facilitate such a task. The redirect form and CGI source are presented below.

Installation

To install the redirect CGI on your Virtual Private Server you will need to do the following:
  1. Install the Redirect Form
    You will need to download the Redirect Form HTML source and store it in the appropriate www directory. This form can be customized for your server by simply changing the URLs and Titles to the URLs and Titles that correspond to specific documents on your web site. But be sure that the variable name for each input field is not altered.

    The form can be modified to automatically redirect when a user has selected an option (assuming the user has a JavaScript capable browser). This is done by adding a little JavaScript to one line in the form. Find this line:
    <select name="url">
    Modify the line so it looks like this:
    <select name="url" onChange="submit(); return true">
  2. Copy the redirect directory
    As the root user, copy the redirect directory from the /usr/local/share/contrib/ directory on your VPS v2 to the appropriate cgi-bin for the domain that will be using the script. Make sure to change the file ownership to the correct user.
  3. Customize the Appearance of the Redirect CGI
    It is common to substitute an image for the submit button. An example of such a subsitution is included in the examples shown below.

Example

Once you have completed the installation successfully, you will have a working redirect form like the one shown below (go ahead and test it).

Example of Redirect (no auto submit)
Example of Redirect (no auto submit, submit image)
Example of Redirect (auto submit - requires JavaScript)

More Information

If you are unfamiliar with the <FORM...> HTML element, or would like to learn more about forms, the following URL is an excellent resource:


Technical Support
° Getting Started Guides
  FreeBSD
° Basic Hosting Help
° Signature Hosting Help
° VPS v1 Help
° VPS v2/3 Help
° MPS v2/3 Help
  Linux
° VPS v3 Help
° MPS v3 Help
  SaaS
° Sugar CRM
  DNS
° Domain Name Service
° Domain Registration
° Help Desk
° Knowledgebase
° Support Policies
° Disclaimer

° AlpineWeb Home
° Compare Hosting Plans
° Network Topology

° Rates & Fees
° Order Center




  Home | Site Map | Customer Backroom Copyright  ©  1997-2008  AlpineWeb Design