Redirecting Your Home Page - *Not implemented*
The redirect feature of our web server allows you to redirect access
to your home page to another URL. This can be used to redirect
the request to another server, or for the purposes of having a
cgi-bin program run to produce your home page. You can also redirect
to different pages based on the type of browser accessing your site.
If someone accesses your web pages with a URL that does not include a
filename, such as http://art.net/~yourdir
, our server
normally searches your directory for a file named welcome.html or
index.html (and also welcome.htm and index.htm).
Redirect File Format
However, if you have a file named redirect in your directory,
the server will find that file instead. The file consists of special
redirect commands and URLs. The first match that occurs will redirect
the requesting web browser to access that URL instead. The file
contains commands, each specifying a condition to match on and a
URL to return. The URL should be a completely specified URL.
The commands are:
- default URL
- The default command should always be the last (or only) line in the
redirect file. If no previous commands in the redirect file are
matched, then the default URL listed will be used.
- agent match "pattern" URL
-
The agent command will match the
type of browser being used against
a wildcard pattern. If a match occurs then the browser will be
redirected to the listed URL. The pattern must be enclosed
in double quotes, and may contain asterisks to match zero or more
wildcard characters and/or question marks to match a single
random character.
Examples
Example: if you want to use the var program to put a
visitor counter or the time on your home page which is named index.htm,
you could create a redirect file with the following commands in it:
default http://www.art.net/cgi-bin/var/youraccount/index.htm
Example: if you want to redirect users to a different home page
depending on whether they are running Netscape, Netscape version 2.x,
or anything else, you could create a redirect file with the
following commands in it.
agent match "Mozilla/2.*" http://www.yourdomain.com/netscape2.html
agent match "Mozilla/*" http://www.yourdomain.com/netscape.html
default http://www.yourdomain.com/index.html