![Netscape ENTERPRISE SERVER 6.1 Скачать руководство пользователя страница 220](http://html1.mh-extra.com/html/netscape/enterprise-server-6-1/enterprise-server-6-1_manual_1674653220.webp)
NameTrans Example
220
Netscape Enterprise Server NSAPI Programmer’s Guide • April 2002 (Draft)
The
explicit_pathinfo
example allows URLs to explicitly include extra path
information for use by a CGI program. The extra path information is delimited
from the main URL by a specified separator, such as a comma.
For example:
http://
server-name
/cgi/marketing,/jan/releases/hardware
In this case, the URL of the requested resource (which would be a CGI program) is
http://
server-name
/cgi/marketing
and the extra path information to give to the
CGI program is
/jan/releases/hardware
.
When choosing a separator, be sure to pick a character that will never be used as
part of the real URL.
The
explicit_pathinfo
function reads the URL, strips out everything following
the comma and puts it in the
path-info
field of the
vars
field in the
request
object (
rq->vars
). CGI programs can access this information through the
PATH_INFO
environment variable.
One side effect of
explicit_pathinfo
is that the
SCRIPT_NAME
CGI environment
variable has the separator character tacked on the end.
Normally
NameTrans
directives return
REQ_PROCEED
when they change the path so
that the server does not process any more
NameTrans
directives. However, in this
case we want name translation to continue after we have extracted the path info,
since we have not yet translated the URL to a physical pathname.
Installing the Example
To install the function on the Enterprise Server, add the following
Init
directive to
magnus.conf
to load the compiled function:
Init fn=load-modules shlib=
yourlibrary
funcs=explicit-pathinfo
Inside the default object in
obj.conf
add the following
NameTrans
directive:
NameTrans fn=explicit-pathinfo separator=","
This
NameTrans
directive should appear before other
NameTrans
directives in the
default object.
Содержание ENTERPRISE SERVER 6.1
Страница 1: ...NSAPI Programmer s Guide Netscape Enterprise Server Version6 1 April 2002 Draft...
Страница 18: ...Where to Find Related Information 18 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 138: ...CGI to NSAPI Conversion 138 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 214: ...NSAPI Functions in Alphabetical Order 214 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 290: ...Miscellaneous 290 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 310: ...The Netscape LDAP Schema 310 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 318: ...cinfo 318 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 324: ...Sample MIME Types File 324 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 336: ...Buffered Streams 336 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 344: ...344 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 350: ...350 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...
Страница 356: ...356 Netscape Enterprise Server NSAPI Programmer s Guide April 2002 Draft...