📄 redirect_man.html
字号:
<HTML>
<HEAD><TITLE>redirect man page</TITLE></HEAD>
<BODY BGCOLOR="#99cc99">
<IMG ALIGN=RIGHT WIDTH=111 HEIGHT=64 SRC="anvil_thttpd.gif" tppabs="http://www.acme.com/software/thttpd/anvil_thttpd.gif">
<H3>redirect man page</H3>
<P>
[<A HREF="#NAME">NAME</A>]
[<A HREF="#SYNOPSIS">SYNOPSIS</A>]
[<A HREF="#DESCRIPTION">DESCRIPTION</A>]
[<A HREF="#SEEALSO">SEE ALSO</A>]
[<A HREF="#BUGS">BUGS / DEFICIENCIES</A>]
[<A HREF="#AUTHOR">AUTHOR</A>]
<HR>
<PRE>
redirect(8) MAINTENANCE COMMANDS redirect(8)
</PRE>
<H4><A NAME="NAME">NAME</A></H4>
<P>
redirect - simple redirection CGI program
<H4><A NAME="SYNOPSIS">SYNOPSIS</A></H4>
<P>
redirect
<H4><A NAME="DESCRIPTION">DESCRIPTION</A></H4>
<P>
Three steps to set up a redirection:
<OL>
<LI>
Make sure your web server is set up to allow CGI programs.
<LI>
Make a symbolic link from the file or directory you want to redirect,
pointing at this program in the CGI bin directory.
<LI>
Add an entry to the file ".redirects" in the directory where your
http server runs CGI programs. For most servers, this is the
directory where the given CGI program lives. The format of the
file is a bunch of lines with a filename, whitespace, and the new
URL. For example:
<PRE>
/test/oldfile.html http://www.acme.com/test/newfile.html
</PRE>
</OL>
The easiest way to figure out precisely what filename to put into .redirects
is to set up the symlink and then click on it.
You'll get back a "404 Not Found" page which includes the filename
as received by the redirect program, and that's what you want to use.
<P>
Note: this is designed for <A HREF="thttpd_man.html" tppabs="http://www.acme.com/software/thttpd/thttpd_man.html">thttpd</A>
and using it with other web servers may require some hacking. A possible
gotcha is with the symbolic link from the old file pointing at this
script - servers other than thttpd may not allow that link to be run
as a CGI program, because they don't check the link to see that it
points into the allowed CGI directory.
<H4><A NAME="SEEALSO">SEE ALSO</A></H4>
<P>
<A HREF="thttpd_man.html" tppabs="http://www.acme.com/software/thttpd/thttpd_man.html">thttpd(8)</A>
<H4><A NAME="BUGS">BUGS / DEFICIENCIES</A></H4>
<P>
It would be really cool to have this program look for
the .redirects file in the same directory as the file being redirected,
instead of in the binaries directory. Unfortunately, this appears
to be impossible with the information CGI gives, plus the non-standardized
but widespread practice of running CGI programs in the directory where
the binary lives. Perhaps CGI 1.2 will address this.
<H4><A NAME="AUTHOR">AUTHOR</A></H4>
<P>
Copyright (C) 1995 by Jef Poskanzer <webmaster@acme.com>.
All rights reserved.
<HR>
Back to the <A HREF="thttpd.html" tppabs="http://www.acme.com/software/thttpd/thttpd.html">thttpd page</A>.
<P>
<ADDRESS><A HREF="mailto:webmaster@acme.com">ACME Labs Webmaster <webmaster@acme.com></A></ADDRESS>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -