package Apache::Missing;
# File: Apache/Missing.pm
use strict;
use Apache::Constants qw(:common);
use CGI qw(:html);

sub handler {
    my $r = shift;
    $r->content_type('text/html');
    $r->send_http_header;
    return OK if $r->header_only;

    my $original_request = $r->prev;
    my $original_uri = $original_request ? $original_request->uri : '';
    my $admin = $r->server->server_admin;

    $r->print(
	      start_html(-title => 'Missing Document',
			 -bgcolor => 'white'),
	      h1(img({-src => '/icons/unknown.gif'}),
		 'Document Not Found'),
	      p(
		"I'm sorry, but the document you requested,",
		strong($original_uri),
		", is not available.  Please try the",
		a({-href => "/search.html"}, "search page"),
		"for help locating the document."
		),
	      hr,
	      address(a({-href => "mailto:$admin"}, 'webmaster')),
	      end_html
	      );

    return OK;
}

1;
__END__
