NAME httpd.rewrite LOCATION /sys/lib/httpd.rewrite DESCRIPTION The original role of this file is to let client know the correct URI. For example, assume the host be pegasus.com with the following line inhttpd.rewrite
: /sys/man /man/man.html; and also assume a client make a request to the host: http://pegasus.com/sys/man/1/acme then the server prompts the client to access http://pegasus.com/man/man.html;/1/acme (If host domain name is omitted inhttpd.rewrite
, the server assumes the server's host domain name.) The second example may be useful if a user have moved to other server: /~rsc http://www.eecs.harvard.edu/~rsc Pegasus configures web root of virtual host using this file. A line with http host name at the first field and asterisk followed by directory path name at the second field shows the relation between virtual host and its web root: http://pegasus */usr/pegasus/www Users web root can be configured like virtual host: /~bob */usr/arisawa/http If a user,alice
for example, have $home/web/doc then the directory becomes the web root ofalice
without configuring inhttpd.rewrite
, and can be accessed by clients with `~
' followed by the user name: http://pegasus.com/~alice/ REWRITE RULE If requested URI matches more than one URI field (first field ofhttpd.rewrite
file ), then the longest pattern is adopted. The matched portion is replaced by the string of second field. See also path matching rule