.\" THE BEER-WARE LICENSE (Revision 4711): .\" wrote this file. As long as you retain this notice you .\" can do whatever you want with this stuff. If we meet some day, and .\" you think this stuff is worth it, you can buy me a beer in return. .\" .\" $Id: webredirect.1,v 1.7 2003/07/16 10:59:28 kaj Exp $ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. .Dd October 23, 2000 .Dt webredirect 1 .\" Note: Only specify the operating system when the command .\" is FreeBSD specific, otherwise use the .Os macro with no .\" arguments. .Os .Sh NAME .Nm webredirect .Nd Small web server serving .Qq 301 Moved Permanently only .Sh SYNOPSIS .Nm webredirect .Op Fl d .Op Fl q .Op Fl h .Op Fl p Ar portno .Op Fl a Ar address .Fl t Ar target .Op Fl n .Op Fl m .Sh DESCRIPTION The .Nm program is an extremely small web server that gives the .Qq 301 Moved Permanently response to all .Qq GET , .Qq HEAD and .Qq POST requests. At the moment, all other requests are unsupported and result in a .Qq 501 Not Supported response. .Pp The options are as follows: .Bl -tag -width mammaddress -compact .It Fl d Turn on verbose (debug) logging. .It Fl q Quiet, log important stuff only (by default, one line per request is logged). .It Fl h Display a brief help message listing the options and exit. .It Fl p Ar portno Listen for requests on the port .Ar portno . Default is 80. .It Fl a Ar address Listen on specific address .Ar address . Default is INADDR_ANY. This is useful if the machine has multiple interfaces and you only want to redirect on one of them. .It Fl t Ar target Redirect users to .Ar target . The entire root-relative .Pq non-host part of the request URI will be appended to this, so a trailing slash should not be included. .It Fl n No path; don't append the request path to the redirect, send all requests directly to .Ar target .It Fl m Move temporarily, send the HTTP response 302 (moved temporarily) instead of 301 (moved permanently). .El .Sh ENVIRONMENT The .Nm command ignores all environment variables. .Sh FILES The .Nm command doesn't read or write any files except through syslog. .Sh EXAMPLES The following is an example of a typical usage of the .Nm command: .Pp .Dl % webredirect -t http://new.server.org .Pp In this case, if the server runs on .Ad old.server.org , a request for .Ad http://old.server.org/foo.html will be redirected to .Ad http://new.server.org/foo.html .Sh DIAGNOSTICS Log messages are sent to syslog. The .Nm program is not supposed to exit unless you .Xr kill 1 it. .\".Sh COMPATIBILITY .\"The .\".Nm .\"command has no known compatibility issues. .\".Sh SEE ALSO .\" Todo: Mention the http specification here? .Sh STANDARDS The .Nm program is supposed to conform to the HTTP 1.0 standard .Sh HISTORY The .Nm program was first written in October 2000. Release 0.3 was released July 16 2003. .Pp http://www.Stacken.KTH.se/~kaj/hack/webredirect .Sh AUTHOR .Nm and its manual page was written by .An Rasmus Kaj Aq rasmus@kaj.se . Developed partially under sponsorship by .An Raditex AB , http://Raditex.se/ .Sh BUGS Please report any you might find to the .Sx AUTHOR .