📄 core.html.en
字号:
element, though the exact behavior is often dependent on the user's client configuration. A setting of <code>AddDefaultCharset Off</code> disables this functionality. <code>AddDefaultCharset On</code> enables a default charset of <code>iso-8859-1</code>. Any other value is assumed to be the <var>charset</var> to be used, which should be one of the <a href="http://www.iana.org/assignments/character-sets">IANA registered charset values</a> for use in MIME media types. For example:</p> <div class="example"><p><code> AddDefaultCharset utf-8 </code></p></div> <p><code class="directive">AddDefaultCharset</code> should only be used when all of the text resources to which it applies are known to be in that character encoding and it is too inconvenient to label their charset individually. One such example is to add the charset parameter to resources containing generated content, such as legacy CGI scripts, that might be vulnerable to cross-site scripting attacks due to user-provided data being included in the output. Note, however, that a better solution is to just fix (or delete) those scripts, since setting a default charset does not protect users that have enabled the "auto-detect character encoding" feature on their browser.</p><h3>See also</h3><ul><li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]<var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr><tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later</td></tr></table> <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the response MIME-type.</p> <p>The following example uses the <code>DEFLATE</code> filter, which is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all output (either static or dynamic) which is labeled as <code>text/html</code> or <code>text/plain</code> before it is sent to the client.</p> <div class="example"><p><code> AddOutputFilterByType DEFLATE text/html text/plain </code></p></div> <p>If you want the content to be processed by more than one filter, their names have to be separated by semicolons. It's also possible to use one <code class="directive">AddOutputFilterByType</code> directive for each of these filters.</p> <p>The configuration below causes all script output labeled as <code>text/html</code> to be processed at first by the <code>INCLUDES</code> filter and then by the <code>DEFLATE</code> filter.</p> <div class="example"><p><code> <Location /cgi-bin/><br /> <span class="indent"> Options Includes<br /> AddOutputFilterByType INCLUDES;DEFLATE text/html<br /> </span> </Location> </code></p></div> <div class="warning"><h3>Note</h3> <p>Enabling filters with <code class="directive">AddOutputFilterByType</code> may fail partially or completely in some cases. For example, no filters are applied if the MIME-type could not be determined and falls back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting, even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the same.</p> <p>However, if you want to make sure, that the filters will be applied, assign the content type to a resource explicitly, for example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the content type within a (non-nph) CGI script is also safe.</p> <p>The by-type output filters are never applied on proxy requests.</p> </div><h3>See also</h3><ul><li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li><li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li><li><a href="../filter.html">filters</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed tobe passed through</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr><tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.46 and later</td></tr></table> <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs which contain encoded path separators (<code>%2F</code> for <code>/</code> and additionally <code>%5C</code> for <code>\</code> on according systems) to be used. Normally such URLs are refused with a 404 (Not found) error.</p> <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is mostly useful when used in conjunction with <code>PATH_INFO</code>.</p> <div class="note"><h3>Note</h3> <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>. Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on according systems) will be left as such in the otherwise decoded URL string.</p> </div><h3>See also</h3><ul><li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2><table class="directive"><tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in<code>.htaccess</code> files</td></tr><tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>[<var>directive-type</var>] ...</code></td></tr><tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr><tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr><tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr><tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr></table> <p>When the server finds an <code>.htaccess</code> file (as specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>) it needs to know which directives declared in that file can override earlier configuration directives.</p> <div class="note"><h3>Only available in <Directory> sections</h3> <code class="directive">AllowOverride</code> is valid only in <code class="directive"><a href="#directory"><Directory></a></code> sections specified without regular expressions, not in <code class="directive"><a href="#location"><Location></a></code>, <code class="directive"><a href="#directorymatch"><DirectoryMatch></a></code> or <code class="directive"><a href="#files"><Files></a></code> sections. </div> <p>When this directive is set to <code>None</code>, then <a href="#accessfilename">.htaccess</a> files are completely ignored. In this case, the server will not even attempt to read <code>.htaccess</code> files in the filesystem.</p> <p>When this directive is set to <code>All</code>, then any directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in <code>.htaccess</code> files.</p> <p>The <var>directive-type</var> can be one of the following groupings of directives.</p> <dl> <dt>AuthConfig</dt> <dd> Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_auth_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>, <code class="directive"><a href="../mod/mod_auth_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>, <code class="directive"><a href="../mod/mod_auth.html#authgroupfile">AuthGroupFile</a></code>, <code class="directive"><a href="#authname">AuthName</a></code>, <code class="directive"><a href="#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_auth.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="#require">Require</a></code>, <em>etc.</em>).</dd> <dt>FileInfo</dt> <dd> Allow use of the directives controlling document types (<code class="directive"><a href="#defaulttype">DefaultType</a></code>, <code class="directive"><a href="#errordocument">ErrorDocument</a></code>, <code class="directive"><a href="#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>, <code class="directive"><a href="#sethandler">SetHandler</a></code>, <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>, <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove* directives, <em>etc.</em>).</dd> <dt>Indexes</dt> <dd> Allow use of the directives controlling directory indexing (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#addicon">AddIcon</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#addiconbyencoding">AddIconByEncoding</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#defaulticon">DefaultIcon</a></code>, <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#fancyindexing">FancyIndexing</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#headername">HeaderName</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexignore">IndexIgnore</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#indexoptions">IndexOptions</a></code>, <code class="directive"><a href="../mod/mod_autoindex.html#readmename">ReadmeName</a></code>, <em>etc.</em>).</dd> <dt>Limit</dt> <dd> Allow use of the directives controlling host access (<code class="directive"><a href="../mod/mod_access.html#allow">Allow</a></code>, <code class="directive"><a href="../mod/mod_access.html#deny">Deny</a></code> and <code class="directive"><a href="../mod/mod_access.html#order">Order</a></code>).</dd> <dt>Options</dt> <dd> Allow use of the directives controlling specific directory features (<code class="directive"><a href="#options">Options</a></code> and <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).</dd> </dl> <p>Example:</p> <div class="example"><p><code> AllowOverride AuthConfig Indexes </code></p></div> <p>In the example above all directives that are neither in the group <code>AuthConfig</code> nor <code>Indexes</code> cause an internal server error.</p><h3>See also</h3><ul><li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li><li><a href="../configuring.html">Configuration Files</a></li><li><a href="../howto/htaccess.html">.htaccess Files</a></li></ul></div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div><div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2><table class="directive">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -