aboutsummaryrefslogblamecommitdiffstats
path: root/lib/inets/doc/src/mod_alias.xml
blob: d073b5c5b8b81ccdab60d963003c37ea4d4b7d90 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                       




                                     
                                        


                                                        










                                                                              













                                                                  


                                                                  
                
 










                                                                                        










                                                                         

             
 










                                                                   









                                                                      

             
 












                                                                               














                                                                                   

             
 
          
                                                                               









                                                                                    
                                                                    








                                                                                                                                                    






             
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>1997</year><year>2013</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    
    </legalnotice>

    <title>mod_alias</title>
    <prepared>Joakim Greben&ouml;</prepared>
    <docno></docno>
    <date>1997-10-14</date>
    <rev>2.2</rev>
    <file>mod_alias.sgml</file>
  </header>
  <module>mod_alias</module>
  <modulesummary>URL aliasing.</modulesummary>
  <description>
    <p>Erlang Webserver Server internal API for handling of things
    such as interaction data exported by the mod_alias module.</p>

    <marker id="default_index"></marker>
  </description>

  <funcs>
    <func>
      <name>default_index(ConfigDB, Path) -> NewPath</name>
      <fsummary>Return a new path with the default resource or file appended.</fsummary>
      <type>
        <v>ConfigDB = config_db()</v>
        <v>Path = NewPath = string()</v>
      </type>
      <desc>
        <marker id="default_index"></marker>
        <p>If <c>Path</c> is a directory, <c>default_index/2</c>, 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 <c>Path</c> and then returned. <c>Path</c> is
	returned unaltered, if no appropriate
	file is found, or if <c>Path</c> is not a directory.
	<c>config_db()</c> is the server config file in ETS table format
	as described in
	<seealso marker="http_server">Inets Users Guide.</seealso>.</p>

	<marker id="path"></marker>
      </desc>
    </func>

    <func>
      <name>path(PathData, ConfigDB, RequestURI) -> Path</name>
      <fsummary>Return the actual file path to a URL.</fsummary>
      <type>
        <v>PathData = interaction_data()</v>
        <v>ConfigDB = config_db()</v>
        <v>RequestURI = Path = string()</v>
      </type>
      <desc>
        <marker id="path"></marker>
        <p><c>path/3</c> returns the actual file <c>Path</c> in the
	<c>RequestURI</c> (See RFC 1945). If the interaction data
	<c>{real_name,{Path,AfterPath}}</c> has been exported by
	mod_alias;
	<c>Path</c> is returned. If no interaction data has been
	exported, ServerRoot is used to
	generate a file <c>Path</c>. <c>config_db()</c> and
	<c>interaction_data()</c> are as defined in 
	<seealso marker="http_server">Inets Users Guide</seealso>.</p>

	<marker id="real_name"></marker>
      </desc>
    </func>

    <func>
      <name>real_name(ConfigDB, RequestURI, Aliases) -> Ret</name>
      <fsummary>Expand a request uri using  Alias config directives.</fsummary>
      <type>
        <v>ConfigDB = config_db()</v>
        <v>RequestURI = string()</v>
        <v>Aliases = [{FakeName,RealName}]</v>
        <v>Ret = {ShortPath,Path,AfterPath}</v>
        <v>ShortPath = Path = AfterPath = string()</v>
      </type>
      <desc>
        <marker id="real_name"></marker>
        <p><c>real_name/3</c> traverses <c>Aliases</c>, typically
	extracted from <c>ConfigDB</c>, and matches each
	<c>FakeName</c> with <c>RequestURI</c>. If a match is found 
	<c>FakeName</c> is replaced with <c>RealName</c> in the
	match. The resulting path is split into two parts, that
	is <c>ShortPath</c> and <c>AfterPath</c> as defined in 
	<seealso marker="httpd_util#split_path">httpd_util:split_path/1</seealso>. 
	<c>Path</c> is generated from <c>ShortPath</c>, that is
	the result from 
	<seealso marker="#default_index">default_index/2</seealso> with
	<c>ShortPath</c> as an argument.
	<c>config_db()</c> is the server config file in ETS table
	format as described in 
	<seealso marker="http_server">Inets User Guide.</seealso>. </p>

	<marker id="real_script_name"></marker>
      </desc>
    </func>

    <func>
      <name>real_script_name(ConfigDB, RequestURI, ScriptAliases) -> Ret</name>
      <fsummary>Expand a request uri using ScriptAlias config directives.</fsummary>
      <type>
        <v>ConfigDB = config_db()</v>
        <v>RequestURI = string()</v>
        <v>ScriptAliases = [{FakeName,RealName}]</v>
        <v>Ret = {ShortPath,AfterPath} | not_a_script</v>
        <v>ShortPath = AfterPath = string()</v>
      </type>
      <desc>
        <marker id="real_script_name"></marker>
        <p><c>real_script_name/3</c> traverses <c>ScriptAliases</c>,
	typically extracted from <c>ConfigDB</c>, and matches each
	<c>FakeName</c> with <c>RequestURI</c>. If a match is found
	<c>FakeName</c> is replaced with <c>RealName</c> in the
	match. If the resulting match is not an executable script
	<c>not_a_script</c> is returned. If it is a script the
	resulting script path is in two parts, that is
	<c>ShortPath</c> and <c>AfterPath</c> as defined in <seealso marker="httpd_util#split_script_path">httpd_util:split_script_path/1</seealso>.
	<c>config_db()</c> is the server config file in ETS table
	format as described in <seealso marker="http_server">Inets Users Guide.</seealso>.</p>
      </desc>
    </func>
  </funcs>
  
</erlref>