Menu

Command Line Options

Ray

Command Line Options

-h
Print the short help summary of the command and exit.
-f
Keep running in the foreground. This is mostly useful for debugging and fine-tuning. See the -o and -d options, too.
-r
Relativize the redirects. When this option is specified, the client is redirected to URL that is composed from the configured location plus the "tail" of the request URI, including query strings and fragment identifiers. For example, if the www.example.com was configured to be redirected to http://apps.intranet.org/example and the request URI of the client was http://www.example.com/page?id=1, then the redirection location would be composed as http://apps.intranet.org/example/page?id=1. Without the -r option specified, the page and id part would be discarded and the redirection location would come out as http://apps.intranet.org/example only.
-v
Verbose output. This option causes the daemon to report its status changes to the log file (or syslog). The actual verbosity of the output is affected by the -d option.
-d level
Set the debug message level. The level parameter is a number in the 0..7 range corresponding to logging levels EMERGENCY, ALERT, CRITICAL, ERROR, WARNING, NOTICE, INFO and DEBUG, respectively. Messages with level higher than the parameter won't be logged. The default value is 4 (WARNING).
-c status_code
Set the response status code, defaults to 302 (Moved Temporarily). redird can help you to move web sites permanently by setting this value to 301 (Moved Permanently). Modern browsers save the permanent redirection to their caches and don't make any requests to the original location when users specify it the next time. The values can be in the range of 300 to 308.
-i interface_addr
Limit the listening for incoming connections to the interface_addr instead of listening on all interfaces. The parameter can be either an address (IPv4 or IPv6) or a hostname that resolves to one of the interfaces of the system the redird runs on. When unspecified, the daemon listens on IPADDR_ANY.
-p port
Set the TCP port on which the daemon would listen and accept client connections. The port is 80 by default and thus the daemon requires root privileges on startup in default configuration.
-s url
Send a default location url to all clients whose HTTP requests specify servers that are not contained in the location-table (see below). The url is relativized if -r option has been specified. When no location-table is specified, all client requests are redirected to url.
-l limit
Set a limit on maximum time or size of the request. The limit parameter is a key=value pair. The key can be either t for time limit, or s for size limit. Depending on the key the value specifies either seconds (for t) and can have an additional one-letter suffix to specify multiples (m for minutes, h for hours), or it specifies bytes (for s) and can have an additional one-letter suffix specifying multiples (k for KiB, m for MiB and g for GiB). The resulting value (after multiplication) must not exceed MAX_INT. By default, redird would wait 10 seconds for the client to send the complete request and would not take more than 400 KiB including request line and headers.
-o log_file|-
Set the logging output. redird sends the messages to syslog by default (when this option is unspecified). Specifying a filename as the argument of the option instructs redird to send the messages to the specified file. A single dash (-) sends the messages to stderr.
-u username
When started with root privileges, redird acquires access to the protected resources like privileged ports and log files and then drops the privileges. By default, it performs setuid() to nobody user account. When -u is specified, redird tries to switch to the user name specified as the option argument instead.
location-table
The argument specifies a file name of a location table file. The location table specifies hosts (and ports, optionally) and their locations to redirect to. When a client requests a host (and port, optionally) that is specified within the location table, redird uses the target location assigned to that particular host instead of the location specified by the -s option. As mentioned above, at least one of -s or location-table must be specified. If the location-table is used without the -s option, servers not included in the location-table are rejected with 404 Not Found status code. Using both -s and location-table ensures that servers not included in the location-table are redirected to the url argument of -s. See [Location Table]


Related

Wiki: Location Table

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.