File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / lighttpd / tests / docroot / www / 404.pl
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Oct 14 10:32:47 2013 UTC (10 years, 9 months ago) by misho
Branches: lighttpd, MAIN
CVS tags: v1_4_35p0, v1_4_35, v1_4_33, HEAD
1.4.33

#!/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/302/| ) {
  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");
}
elsif ($request_uri =~ m/^\/send404\.pl/ ) {
  print header ( -status => 404
                 -type   => 'text/plain' );
  print ("Not found here (send404)\n");
}
elsif ($request_uri =~ m/^\/dynamic\/nostatus\// ) {
  print ("found here\n");
}
else {
  print header ( -status => 500,
                 -type   => 'text/plain');
  print ("huh\n");
};

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>