<h2><a id="acceptpathinfo"
name="adddefaultcharset">AcceptPathInfo directive</a></h2>
<a href="directive-dict.html#Syntax"
- rel="Help"><strong>Syntax:</strong></a> AcceptPathInfo On|Off<br />
+ rel="Help"><strong>Syntax:</strong></a> AcceptPathInfo On|Off|Default<br />
+ <a href="directive-dict.html#Default"
+ rel="Help"><strong>Default:</strong></a>
+ <code>AcceptPathInfo Default</code><br />
<a href="directive-dict.html#Context"
- rel="Help"><strong>Context:</strong></a> all<br />
+ rel="Help"><strong>Context:</strong></a> server config, virtual host,
+ directory, .htaccess<br />
<a href="directive-dict.html#Status"
rel="Help"><strong>Status:</strong></a> core<br />
- <a href="directive-dict.html#Default"
- rel="Help"><strong>Default:</strong></a>
- <code>Varies by handler, see below</code><br />
<a href="directive-dict.html#Compatibility"
rel="Help"><strong>Compatibility:</strong></a>
AcceptPathInfo is only available in Apache 2.0.30 and later
- <p>This directive provides the ability to accept or reject requests
- that contain PATH_INFO, or trailing pathname information that follows
- an actual filename (or non-existant file in an existing directory).
- For example, if the location /test/ points to a directory, and the
- file here.html exists, while the file nothere.html does not exist,
- the requests for <code>/test/here.html/more</code> and
- <code>/test/nothere.html/more</code> both collect <code>/more</code>
- as PATH_INFO.</p>
-
- <p>By default, the core handler for normal files rejects any
- PATH_INFO with an error 404 NOT FOUND, since the file does not
- exist (in our example above, <code>/test/here.html/more</code>
- is not a file name.) Other handlers that serve scripts, such as
- mod_cgi, mod_cgid and mod_isapi, generally accept PATH_INFO by
- default.</p>
-
- <p>You may override the default behavior of any Apache module, and
- possibly third party modules, with the AcceptPathInfo directive.
- It is up to the individual module to respect your override.</p>
-
- <p>This override is required, for example, when you use a filter,
- such as mod_includes, to generate content based on PATH_INFO. The
- core module would usually reject the request, so you could use the
- following configuration to enable such a script:</p>
+ <p>This directive controls whether requests that contain trailing
+ pathname information that follows an actual filename (or
+ non-existent file in an existing directory) will be accepted or
+ rejected. The trailing pathname information can be made
+ available to scripts in the PATH_INFO environment variable.</p>
+
+ <p>For example, assume the location <code>/test/</code> points to
+ a directory that contains only the single file
+ <code>here.html</code>. Then requests for
+ <code>/test/here.html/more</code> and
+ <code>/test/nothere.html/more</code> both collect
+ <code>/more</code> as PATH_INFO.</p>
+
+ <p>The three possible arguments for the
+ <code>AcceptPathInfo</code> directive are:</p>
+ <dl>
+ <dt><code>off</code></dt><dd>A request will only be accepted if it
+ maps to a literal path that exists. Therefore a request with
+ trailing pathname information after the true filename such as
+ <code>/test/here.html/more</code> in the above example will return
+ a 404 NOT FOUND error.</dd>
+
+ <dt><code>on</code></dt><dd>A request will be accepted if a
+ leading path component maps to a file that exists. The above
+ example <code>/test/here.html/more</code> will be accepted if
+ <code>/test/here.html</code> maps to a valid file.</dt>
+
+ <dt><code>default</code><dd>The treatment of requests with
+ trailing pathname information is determined by the <a
+ href="../handlers.html">handler</a> responsible for the request.
+ The core handler for normal files defaults to rejecting PATH_INFO.
+ Handlers that serve scripts, such as <a
+ href="mod_cgi.html">cgi-script</a> and <a
+ href="mod_isapi.html">isapi-isa</a>, generally accept PATH_INFO by
+ default.</dd>
+ </dl>
+
+ <p>The primary purpose of the <code>AcceptPathInfo</code>
+ directive is to allow you to override the handler's choice of
+ accepting or rejecting PATH_INFO. This override is required, for
+ example, when you use a <a href="../filter.html">filter</a>, such
+ as <a href="mod_include.html">INCLUDES</a>, to generate content
+ based on PATH_INFO. The core handler would usually reject the
+ request, so you can use the following configuration to enable
+ such a script:</p>
<pre>
<Files "mypaths.shtml">
Options +Includes
<li><a href="#xbithack">XBitHack</a></li>
</ul>
- <p>See also: <a href="core.html#options">Options</a> and <a
- href="core.html.html#SetOutputFilter">SetOutputFilter</a>.</p>
+ <p>See also: <a href="core.html#options">Options</a>, <a
+ href="core.html.html#SetOutputFilter">SetOutputFilter</a>,
+ and <a href="core.html#acceptpathinfo">AcceptPathInfo</a>.</p>
<h2>Enabling Server-Side Includes</h2>
There is <a href="../misc/custom_errordocs.html">a document</a>
which describes how to use the features of mod_include to offer
internationalized customized server error documents.
+
+ <h2>PATH_INFO with Server Side Includes</h2>
+
+ <p>Files processed for server-side includes no longer accept
+ requests with PATH_INFO (trailing pathname information) by
+ default. You can use the <a
+ href="core.html#AcceptPathInfo">AcceptPathInfo</a> directive to
+ configure the server to accept requests with PATH_INFO.</p>
+
<hr />
<h2><a id="xbithack" name="xbithack">XBitHack</a>