$!----------------------------------------------------------------------------- $! WELCOME.COM $! Find "welcome" PHP file (WASD 8.n) implemented as CGIplus for efficiency. $! $! Also illustrates how to create a script to provide customised mapping. $! In this case mapping rules (see below) activate this script if the path $! ends in a slash ("/", i.e. is a directory specification). Once activated $! the script checks if the specified path contained a file INDEX.PHP. If it $! does the script generates a CGI redirect to cause the server to access it. $! If it doesn't exist a redirect, using a detectable "escape" component, $! has the server continue to supply whatever it's normal behaviour would. $! $! # HTTPD$MAP entries (pre-8.2 and post-8.2) $! exec /*.php* /ht_root/*.php* $! map **/ /cgiplus-bin/welcome.com*/ [pa:1]![pi:/$welcome$/*] $! map /$welcome$/* /* $! $! # HTTPD$MAP entries (post-8.2) $! exec /*.php* /ht_root/*.php* $! if (pass:1 && !path-info:/$welcome$/*) map **/ /cgiplus-bin/welcome.com*/ $! map /$welcome$/* /* $! $! 01-JUN-2003 MGD initial $!----------------------------------------------------------------------------- $! $ on warning then $exit $ say = "write sys$output" $ open /read CgiPlusIn CGIPLUSIN $! $ RequestLoop: $! $! (block waiting for request, this initial read is always discardable) $ read CgiPlusIn /end=EndRequestLoop Line $! $ pathInfo = "ERROR" $ pathTranslated = "ERROR" $ CgiVarLoop: $ read CgiPlusIn /end=EndCgiVarLoop Line $ if Line .eqs. "" then goto EndCgiVarLoop $ e0 = f$element(0,"=",Line) $ e1 = f$element(1,"=",Line) $ if e0 .eqs. "WWW_PATH_INFO" then pathInfo = e1 $ if e0 .eqs. "WWW_PATH_TRANSLATED" then pathTranslated = e1 $ goto CgiVarLoop $ EndCgiVarLoop: $! $ if f$search("''pathTranslated'INDEX.PHP") .eqs. "" $ then say "Location: /$welcome$''pathInfo'" $ else say "Location: ''pathInfo'index.php" $ endif $ say "" $! $ say f$trnlnm("CGIPLUSEOF") $ goto RequestLoop $! $ EndRequestLoop: $! $!-----------------------------------------------------------------------------