6 my $request_uri = $ENV{'REQUEST_URI'}; # server.error-handler-404
7 my $redirect_uri= $ENV{'REDIRECT_URI'}; # server.error-handler
8 print (STDERR
"REQUEST_URI: $request_uri\n");
9 print (STDERR
"REDIRECT_URI: $redirect_uri\n");
11 if ($request_uri =~ m/^\/dynamic\
/200\// ) {
12 print header
( -status
=> 200,
13 -type
=> 'text/plain' );
14 print ("found here\n");
16 elsif ($request_uri =~ m
|^/dynamic/302/| ) {
17 print header
( -status
=>302,
18 -location
=> 'http://www.example.org/');
20 elsif ($request_uri =~ m/^\/dynamic\
/404\// ) {
21 print header
( -status
=> 404
22 -type
=> 'text/plain' );
23 print ("Not found here\n");
25 elsif ($request_uri =~ m/^\/send
404\
.pl
/ ) {
26 print header
( -status
=> 404
27 -type
=> 'text/plain' );
28 print ("Not found here (send404)\n");
30 elsif ($request_uri =~ m/^\/dynamic\
/nostatus\// ) {
31 print ("found here\n");
33 elsif ($redirect_uri =~ m/^\/dynamic\
/redirect_status\// ) {
34 print header
( -status
=> $ENV{'REDIRECT_STATUS'},
35 -type
=> 'text/plain');
36 print ("REDIRECT_STATUS\n");
39 print header
( -status
=> 500,
40 -type
=> 'text/plain');