1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>mod_alias</TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
<STYLE TYPE="text/css">
<!--
.REFBODY { margin-left: 13mm }
.REFTYPES { margin-left: 8mm }
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<!-- refpage -->
<CENTER>
<A HREF="http://www.erlang.se">
<IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif">
</A>
<H1>mod_alias</H1>
</CENTER>
<H3>MODULE</H3>
<DIV CLASS=REFBODY>
mod_alias
</DIV>
<H3>MODULE SUMMARY</H3>
<DIV CLASS=REFBODY>
URL ailasing.
</DIV>
<H3>DESCRIPTION</H3>
<DIV CLASS=REFBODY>
<P>Erlang Webserver Server internal API for handling of things
such as interaction data exported by the mod_alias module.
</DIV>
<H3>EXPORTS</H3>
<P><A NAME="default_index/2"><STRONG><CODE>default_index(ConfigDB, Path) -> NewPath</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ConfigDB = config_db()</CODE></STRONG><BR>
<STRONG><CODE>Path = NewPath = string()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<A NAME="default_index"><!-- Empty --></A>
<P>If <CODE>Path</CODE> is a directory, <CODE>default_index/2</CODE>, it starts
searching for resources or files that are specified in the config
directive DirectoryIndex.
If an appropriate resource or file is found, it is appended to
the end of <CODE>Path</CODE> and then returned. <CODE>Path</CODE> is
returned unaltered, if no appropriate
file is found, or if <CODE>Path</CODE> is not a directory.
<CODE>config_db()</CODE> is the server config file in ETS table format
as described in
<A HREF="http_server.html">Inets Users Guide.</A>.
</DIV>
<P><A NAME="path/3"><STRONG><CODE>path(PathData, ConfigDB, RequestURI) -> Path</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>PathData = interaction_data()</CODE></STRONG><BR>
<STRONG><CODE>ConfigDB = config_db()</CODE></STRONG><BR>
<STRONG><CODE>RequestURI = Path = string()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<A NAME="path"><!-- Empty --></A>
<P><CODE>path/3</CODE> returns the actual file <CODE>Path</CODE> in the
<CODE>RequestURI</CODE> (See RFC 1945). If the interaction data
<CODE>{real_name,{Path,AfterPath}}</CODE> has been exported by
mod_alias;
<CODE>Path</CODE> is returned. If no interaction data has been
exported, ServerRoot is used to
generate a file <CODE>Path</CODE>. <CODE>config_db()</CODE> and
<CODE>interaction_data()</CODE> are as defined in <A HREF="http_server.html"> Inets Users Guide</A>.
</DIV>
<P><A NAME="real_name/3"><STRONG><CODE>real_name(ConfigDB, RequestURI, Aliases) -> Ret</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ConfigDB = config_db()</CODE></STRONG><BR>
<STRONG><CODE>RequestURI = string()</CODE></STRONG><BR>
<STRONG><CODE>Aliases = [{FakeName,RealName}]</CODE></STRONG><BR>
<STRONG><CODE>Ret = {ShortPath,Path,AfterPath}</CODE></STRONG><BR>
<STRONG><CODE>ShortPath = Path = AfterPath = string()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<A NAME="real_name"><!-- Empty --></A>
<P><CODE>real_name/3</CODE> traverses <CODE>Aliases</CODE>, typically
extracted from <CODE>ConfigDB</CODE>, and matches each
<CODE>FakeName</CODE> with <CODE>RequestURI</CODE>. If a match is found
<CODE>FakeName</CODE> is replaced with <CODE>RealName</CODE> in the
match. The resulting path is split into two parts, that
is <CODE>ShortPath</CODE> and <CODE>AfterPath</CODE> as defined in <A HREF="httpd_util.html#split_path">httpd_util:split_path/1</A>.
<CODE>Path</CODE> is generated from <CODE>ShortPath</CODE>, that is
the result from <A HREF="#default_index">default_index/2</A> with
<CODE>ShortPath</CODE> as an argument.
<CODE>config_db()</CODE> is the server config file in ETS table
format as described in <A HREF="http_server.html">Inets User Guide.</A>.
</DIV>
<P><A NAME="real_script_name/3"><STRONG><CODE>real_script_name(ConfigDB,RequestURI,ScriptAliases) -> Ret</CODE></STRONG></A><BR>
<DIV CLASS=REFBODY><P>Types:
<DIV CLASS=REFTYPES>
<P>
<STRONG><CODE>ConfigDB = config_db()</CODE></STRONG><BR>
<STRONG><CODE>RequestURI = string()</CODE></STRONG><BR>
<STRONG><CODE>ScriptAliases = [{FakeName,RealName}]</CODE></STRONG><BR>
<STRONG><CODE>Ret = {ShortPath,AfterPath} | not_a_script</CODE></STRONG><BR>
<STRONG><CODE>ShortPath = AfterPath = string()</CODE></STRONG><BR>
</DIV>
</DIV>
<DIV CLASS=REFBODY>
<A NAME="real_script_name"><!-- Empty --></A>
<P><CODE>real_name/3</CODE> traverses <CODE>ScriptAliases</CODE>,
typically extracted from <CODE>ConfigDB</CODE>, and matches each
<CODE>FakeName</CODE> with <CODE>RequestURI</CODE>. If a match is found
<CODE>FakeName</CODE> is replaced with <CODE>RealName</CODE> in the
match. If the resulting match is not an executable script
<CODE>not_a_script</CODE> is returned. If it is a script the
resulting script path is in two parts, that is
<CODE>ShortPath</CODE> and <CODE>AfterPath</CODE> as defined in <A HREF="httpd_util.html#split_script_path">httpd_util:split_script_path/1</A>.
<CODE>config_db()</CODE> is the server config file in ETS table
format as described in <A HREF="http_server.html">Inets
Users Guide.</A>.
</DIV>
<H3>AUTHORS</H3>
<DIV CLASS=REFBODY>
Joakim Greben
- support@erlang.ericsson.se<BR>
</DIV>
<CENTER>
<HR>
<SMALL>inets 4.7.6<BR>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|