Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@241 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
- Loading branch information
Claes Wikstrom
committed
Nov 4, 2002
1 parent
5007942
commit 1dca7ab
Showing
5 changed files
with
79 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
%%%---------------------------------------------------------------------- | ||
%%% File : yaws_404.erl | ||
%%% Author : Claes Wikstrom <klacke@hyber.org> | ||
%%% Purpose : | ||
%%% Created : 4 Nov 2002 by Claes Wikstrom <klacke@hyber.org> | ||
%%%---------------------------------------------------------------------- | ||
|
||
-module(yaws_404). | ||
-author('klacke@hyber.org'). | ||
|
||
-compile(export_all). | ||
-include("../include/yaws.hrl"). | ||
-include("../include/yaws_api.hrl"). | ||
|
||
%% The default error 404 error delivery module | ||
|
||
out(Arg, GC, SC) -> | ||
yaws_api:set_status_code(404), | ||
Req = Arg#arg.req, | ||
{abs_path, Path} = Req#http_request.path, | ||
B = not_found_body(Path, GC, SC), | ||
io:format("In 404 \n",[]), | ||
{html, B}. | ||
|
||
|
||
|
||
not_found_body(Path, GC, SC) -> | ||
L = ["<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" | ||
"<HTML><HEAD>" | ||
"<TITLE>404 Not Found</TITLE>" | ||
"</HEAD><BODY>" | ||
"<H1>Not Found</H1>" | ||
"The requested URL ", | ||
Path, | ||
" was not found on this server.<P>" | ||
"<HR>", | ||
yaws:address(GC, SC), | ||
" </BODY></HTML>" | ||
], | ||
list_to_binary(L). | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters