summaryrefslogtreecommitdiff
path: root/tests/docroot/www/404.pl
blob: 4260e32e72adf234d3023a1a646e1a11f3eec0e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
use CGI qw/:standard/;
my $cgi = new CGI;
my $request_uri = $ENV{'REQUEST_URI'};
print (STDERR "REQUEST_URI: $request_uri\n");
if ($request_uri =~ m/^\/dynamic\/200\// ) {
  print header ( -status => 200,
                 -type   => 'text/plain' );
  print ("found here\n");
}
elsif ($request_uri =~ m|^/dynamic/301/| ) {
  print header( -status=>302,
                -location => 'http://www.example.org/');
}
elsif ($request_uri =~ m/^\/dynamic\/404\// ) {
  print header ( -status => 404
                 -type   => 'text/plain' );
  print ("Not found here\n");
}
else {
  print header ( -status => 404,
                 -type   => 'text/plain');
  print ("huh\n");
};