diff options
Diffstat (limited to '')
-rw-r--r-- | docs/manual/howto/htaccess.html | 25 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.en | 465 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.es | 464 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.fr.utf8 | 512 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.ja.utf8 | 417 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.ko.euc-kr | 363 | ||||
-rw-r--r-- | docs/manual/howto/htaccess.html.pt-br | 407 |
7 files changed, 2653 insertions, 0 deletions
diff --git a/docs/manual/howto/htaccess.html b/docs/manual/howto/htaccess.html new file mode 100644 index 0000000..ff30e47 --- /dev/null +++ b/docs/manual/howto/htaccess.html @@ -0,0 +1,25 @@ +# GENERATED FROM XML -- DO NOT EDIT + +URI: htaccess.html.en +Content-Language: en +Content-type: text/html; charset=ISO-8859-1 + +URI: htaccess.html.es +Content-Language: es +Content-type: text/html; charset=ISO-8859-1 + +URI: htaccess.html.fr.utf8 +Content-Language: fr +Content-type: text/html; charset=UTF-8 + +URI: htaccess.html.ja.utf8 +Content-Language: ja +Content-type: text/html; charset=UTF-8 + +URI: htaccess.html.ko.euc-kr +Content-Language: ko +Content-type: text/html; charset=EUC-KR + +URI: htaccess.html.pt-br +Content-Language: pt-br +Content-type: text/html; charset=ISO-8859-1 diff --git a/docs/manual/howto/htaccess.html.en b/docs/manual/howto/htaccess.html.en new file mode 100644 index 0000000..d911780 --- /dev/null +++ b/docs/manual/howto/htaccess.html.en @@ -0,0 +1,465 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head> +<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Apache HTTP Server Tutorial: .htaccess files - Apache HTTP Server Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">How-To / Tutorials</a></div><div id="page-content"><div id="preamble"><h1>Apache HTTP Server Tutorial: .htaccess files</h1> +<div class="toplang"> +<p><span>Available Languages: </span><a href="../en/howto/htaccess.html" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div> + +<p><code>.htaccess</code> files provide a way to make configuration +changes on a per-directory basis.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">.htaccess files</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">What they are/How to use them</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">When (not) to use .htaccess files</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">How directives are applied</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">Authentication example</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">Server Side Includes example</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#rewrite">Rewrite Rules in .htaccess files</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">CGI example</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">Troubleshooting</a></li> +</ul><h3>See also</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">.htaccess files</a></h2> + <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table> + + <div class="note">You should avoid using <code>.htaccess</code> files completely if you have access to + httpd main server config file. Using <code>.htaccess</code> files slows down your Apache http server. + Any directive that you can include in a <code>.htaccess</code> file is better set in a <code class="directive"><a href="../mod/core.html#directory">Directory</a></code> block, as it will have the same effect with better performance.</div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">What they are/How to use them</a></h2> + + + <p><code>.htaccess</code> files (or "distributed configuration files") + provide a way to make configuration changes on a per-directory basis. A + file, containing one or more configuration directives, is placed in a + particular document directory, and the directives apply to that + directory, and all subdirectories thereof.</p> + + <div class="note"><h3>Note:</h3> + <p>If you want to call your <code>.htaccess</code> file something + else, you can change the name of the file using the <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code> directive. For example, + if you would rather call the file <code>.config</code> then you + can put the following in your server configuration file:</p> + + <pre class="prettyprint lang-config">AccessFileName ".config"</pre> + + </div> + + <p>In general, <code>.htaccess</code> files use the same syntax as + the <a href="../configuring.html#syntax">main configuration + files</a>. What you can put in these files is determined by the + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> directive. This + directive specifies, in categories, what directives will be + honored if they are found in a <code>.htaccess</code> file. If a + directive is permitted in a <code>.htaccess</code> file, the + documentation for that directive will contain an Override section, + specifying what value must be in <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> in order for that + directive to be permitted.</p> + + <p>For example, if you look at the documentation for the <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code> + directive, you will find that it is permitted in <code>.htaccess</code> + files. (See the Context line in the directive summary.) The <a href="../mod/directive-dict.html#Context">Override</a> line reads + <code>FileInfo</code>. Thus, you must have at least + <code>AllowOverride FileInfo</code> in order for this directive to be + honored in <code>.htaccess</code> files.</p> + + <div class="example"><h3>Example:</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">Context:</a></td> + <td>server config, virtual host, directory, .htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">Override:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>If you are unsure whether a particular directive is permitted in a + <code>.htaccess</code> file, look at the documentation for that + directive, and check the Context line for ".htaccess".</p> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">When (not) to use .htaccess files</a></h2> + + <p>In general, you should only use <code>.htaccess</code> files when + you don't have access to the main server configuration file. There is, + for example, a common misconception that user authentication should + always be done in <code>.htaccess</code> files, and, in more recent years, + another misconception that <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> directives + must go in <code>.htaccess</code> files. This is simply not the + case. You can put user authentication configurations in the main server + configuration, and this is, in fact, the preferred way to do + things. Likewise, <code>mod_rewrite</code> directives work better, + in many respects, in the main server configuration.</p> + + <p><code>.htaccess</code> files should be used in a case where the + content providers need to make configuration changes to the server on a + per-directory basis, but do not have root access on the server system. + In the event that the server administrator is not willing to make + frequent configuration changes, it might be desirable to permit + individual users to make these changes in <code>.htaccess</code> files + for themselves. This is particularly true, for example, in cases where + ISPs are hosting multiple user sites on a single machine, and want + their users to be able to alter their configuration.</p> + + <p>However, in general, use of <code>.htaccess</code> files should be + avoided when possible. Any configuration that you would consider + putting in a <code>.htaccess</code> file, can just as effectively be + made in a <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> section in your main server + configuration file.</p> + + <p>There are two main reasons to avoid the use of + <code>.htaccess</code> files.</p> + + <p>The first of these is performance. When <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + is set to allow the use of <code>.htaccess</code> files, httpd will + look in every directory for <code>.htaccess</code> files. Thus, + permitting <code>.htaccess</code> files causes a performance hit, + whether or not you actually even use them! Also, the + <code>.htaccess</code> file is loaded every time a document is + requested.</p> + + <p>Further note that httpd must look for <code>.htaccess</code> files + in all higher-level directories, in order to have a full complement of + directives that it must apply. (See section on <a href="#how">how + directives are applied</a>.) Thus, if a file is requested out of a + directory <code>/www/htdocs/example</code>, httpd must look for the + following files:</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/example/.htaccess + </code></p></div> + + <p>And so, for each file access out of that directory, there are 4 + additional file-system accesses, even if none of those files are + present. (Note that this would only be the case if + <code>.htaccess</code> files were enabled for <code>/</code>, which + is not usually the case.)</p> + + <p>In the case of <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> directives, in + <code>.htaccess</code> context these regular expressions must be + re-compiled with every request to the directory, whereas in main + server configuration context they are compiled once and cached. + Additionally, the rules themselves are more complicated, as one must + work around the restrictions that come with per-directory context + and <code>mod_rewrite</code>. Consult the <a href="../rewrite/intro.html#htaccess">Rewrite Guide</a> for more + detail on this subject.</p> + + <p>The second consideration is one of security. You are permitting + users to modify server configuration, which may result in changes over + which you have no control. Carefully consider whether you want to give + your users this privilege. Note also that giving users less + privileges than they need will lead to additional technical support + requests. Make sure you clearly tell your users what level of + privileges you have given them. Specifying exactly what you have set + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> to, and pointing them + to the relevant documentation, will save yourself a lot of confusion + later.</p> + + <p>Note that it is completely equivalent to put a <code>.htaccess</code> + file in a directory <code>/www/htdocs/example</code> containing a + directive, and to put that same directive in a Directory section + <code><Directory "/www/htdocs/example"></code> in your main server + configuration:</p> + + <p><code>.htaccess</code> file in <code>/www/htdocs/example</code>:</p> + + <div class="example"><h3>Contents of .htaccess file in + <code>/www/htdocs/example</code></h3><pre class="prettyprint lang-config">AddType text/example ".exm"</pre> +</div> + + <div class="example"><h3>Section from your <code>httpd.conf</code> + file</h3><pre class="prettyprint lang-config"><Directory "/www/htdocs/example"> + AddType text/example ".exm" +</Directory></pre> +</div> + + <p>However, putting this configuration in your server configuration + file will result in less of a performance hit, as the configuration is + loaded once when httpd starts, rather than every time a file is + requested.</p> + + <p>The use of <code>.htaccess</code> files can be disabled completely + by setting the <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + directive to <code>none</code>:</p> + + <pre class="prettyprint lang-config">AllowOverride None</pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">How directives are applied</a></h2> + + <p>The configuration directives found in a <code>.htaccess</code> file + are applied to the directory in which the <code>.htaccess</code> file + is found, and to all subdirectories thereof. However, it is important + to also remember that there may have been <code>.htaccess</code> files + in directories higher up. Directives are applied in the order that they + are found. Therefore, a <code>.htaccess</code> file in a particular + directory may override directives found in <code>.htaccess</code> files + found higher up in the directory tree. And those, in turn, may have + overridden directives found yet higher up, or in the main server + configuration file itself.</p> + + <p>Example:</p> + + <p>In the directory <code>/www/htdocs/example1</code> we have a + <code>.htaccess</code> file containing the following:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI</pre> + + + <p>(Note: you must have "<code>AllowOverride Options</code>" in effect + to permit the use of the "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" directive in + <code>.htaccess</code> files.)</p> + + <p>In the directory <code>/www/htdocs/example1/example2</code> we have + a <code>.htaccess</code> file containing:</p> + + <pre class="prettyprint lang-config">Options Includes</pre> + + + <p>Because of this second <code>.htaccess</code> file, in the directory + <code>/www/htdocs/example1/example2</code>, CGI execution is not + permitted, as only <code>Options Includes</code> is in effect, which + completely overrides any earlier setting that may have been in + place.</p> + + <h3><a name="merge" id="merge">Merging of .htaccess with the main + configuration files</a></h3> + + <p>As discussed in the documentation on <a href="../sections.html">Configuration Sections</a>, + <code>.htaccess</code> files can override the <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> sections for + the corresponding directory, but will be overridden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> setting. For example, to + prevent script execution while allowing anything else to be set in + <code>.htaccess</code> you can use:</p> + + <pre class="prettyprint lang-config"><Directory "/www/htdocs"> + AllowOverride All +</Directory> + +<Location "/"> + Options +IncludesNoExec -ExecCGI +</Location></pre> + + + <div class="note">This example assumes that your <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> is <code>/www/htdocs</code>.</div> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">Authentication example</a></h2> + + <p>If you jumped directly to this part of the document to find out how + to do authentication, it is important to note one thing. There is a + common misconception that you are required to use + <code>.htaccess</code> files in order to implement password + authentication. This is not the case. Putting authentication directives + in a <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> + section, in your main server configuration file, is the preferred way + to implement this, and <code>.htaccess</code> files should be used only + if you don't have access to the main server configuration file. See <a href="#when">above</a> for a discussion of when you should and should + not use <code>.htaccess</code> files.</p> + + <p>Having said that, if you still think you need to use a + <code>.htaccess</code> file, you may find that a configuration such as + what follows may work for you.</p> + + <p><code>.htaccess</code> file contents:</p> + + <pre class="prettyprint lang-config">AuthType Basic +AuthName "Password Required" +AuthUserFile "/www/passwords/password.file" +AuthGroupFile "/www/passwords/group.file" +Require group admins</pre> + + + <p>Note that <code>AllowOverride AuthConfig</code> must be in effect + for these directives to have any effect.</p> + + <p>Please see the <a href="auth.html">authentication tutorial</a> for a + more complete discussion of authentication and authorization.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">Server Side Includes example</a></h2> + + <p>Another common use of <code>.htaccess</code> files is to enable + Server Side Includes for a particular directory. This may be done with + the following configuration directives, placed in a + <code>.htaccess</code> file in the desired directory:</p> + + <pre class="prettyprint lang-config">Options +Includes +AddType text/html shtml +AddHandler server-parsed shtml</pre> + + + <p>Note that <code>AllowOverride Options</code> and <code>AllowOverride + FileInfo</code> must both be in effect for these directives to have any + effect.</p> + + <p>Please see the <a href="ssi.html">SSI tutorial</a> for a more + complete discussion of server-side includes.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="rewrite" id="rewrite">Rewrite Rules in .htaccess files</a></h2> +<p>When using <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> in +<code>.htaccess</code> files, be aware that the per-directory context +changes things a bit. In particular, rules are taken to be relative to +the current directory, rather than being the original requested URI. +Consider the following examples:</p> + +<pre class="prettyprint lang-config"># In httpd.conf +RewriteRule "^/images/(.+)\.jpg" "/images/$1.png" + +# In .htaccess in root dir +RewriteRule "^images/(.+)\.jpg" "images/$1.png" + +# In .htaccess in images/ +RewriteRule "^(.+)\.jpg" "$1.png"</pre> + + +<p>In a <code>.htaccess</code> in your document directory, the leading +slash is removed from the value supplied to <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>, and in the +<code>images</code> subdirectory, <code>/images/</code> is removed from +it. Thus, your regular expression needs to omit that portion as +well.</p> + +<p>Consult the <a href="../rewrite/">mod_rewrite documentation</a> for +further details on using <code>mod_rewrite</code>.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">CGI example</a></h2> + + <p>Finally, you may wish to use a <code>.htaccess</code> file to permit + the execution of CGI programs in a particular directory. This may be + implemented with the following configuration:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +AddHandler cgi-script cgi pl</pre> + + + <p>Alternately, if you wish to have all files in the given directory be + considered to be CGI programs, this may be done with the following + configuration:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +SetHandler cgi-script</pre> + + + <p>Note that <code>AllowOverride Options</code> and <code>AllowOverride + FileInfo</code> must both be in effect for these directives to have any + effect.</p> + + <p>Please see the <a href="cgi.html">CGI tutorial</a> for a more + complete discussion of CGI programming and configuration.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">Troubleshooting</a></h2> + + <p>When you put configuration directives in a <code>.htaccess</code> + file, and you don't get the desired effect, there are a number of + things that may be going wrong.</p> + + <p>Most commonly, the problem is that <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> is not + set such that your configuration directives are being honored. Make + sure that you don't have a <code>AllowOverride None</code> in effect + for the file scope in question. A good test for this is to put garbage + in your <code>.htaccess</code> file and reload the page. If a server error is + not generated, then you almost certainly have <code>AllowOverride + None</code> in effect.</p> + + <p>If, on the other hand, you are getting server errors when trying to + access documents, check your httpd error log. It will likely tell you + that the directive used in your <code>.htaccess</code> file is not + permitted.</p> + + <div class="example"><p><code> + [Fri Sep 17 18:43:16 2010] [alert] [client 192.168.200.51] /var/www/html/.htaccess: DirectoryIndex not allowed here + </code></p></div> + + <p>This will indicate either that you've used a directive that is + never permitted in <code>.htaccess</code> files, or that you simply + don't have <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> set to + a level sufficient for the directive you've used. Consult the + documentation for that particular directive to determine which is + the case.</p> + + <p>Alternately, it may tell you that you had a syntax error in your + usage of the directive itself.</p> + + <div class="example"><p><code> + [Sat Aug 09 16:22:34 2008] [alert] [client 192.168.200.51] /var/www/html/.htaccess: RewriteCond: bad flag delimiters + </code></p></div> + + <p>In this case, the error message should be specific to the + particular syntax error that you have committed.</p> + +</div></div> +<div class="bottomlang"> +<p><span>Available Languages: </span><a href="../en/howto/htaccess.html" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.es b/docs/manual/howto/htaccess.html.es new file mode 100644 index 0000000..7f7a850 --- /dev/null +++ b/docs/manual/howto/htaccess.html.es @@ -0,0 +1,464 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es"><head> +<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Tutorial del Servidor Apache HTTP: Ficheros .htaccess - Servidor HTTP Apache Versión 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="http://wiki.apache.org/httpd/FAQ">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa del sitio web</a></p> +<p class="apache">Versión 2.4 del Servidor HTTP Apache</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Servidor HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentación</a> > <a href="../">Versión 2.4</a> > <a href="./">How-To / Tutoriales</a></div><div id="page-content"><div id="preamble"><h1>Tutorial del Servidor Apache HTTP: Ficheros .htaccess</h1> +<div class="toplang"> +<p><span>Idiomas disponibles: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div> + + <p>Los ficheros <code>.htaccess</code> facilitan una forma de realizar + cambios en la configuración en contexto directorio.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">Ficheros .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">Qué son/Cómo usarlos</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">Cuando (no) usar ficheros .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">How directives are applied</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">Ejemplo de Autenticación</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">Ejemplo de Server Side Includes</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#rewrite">Reglas de Rewrite en ficheros .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">Ejemplo de CGI</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">Resolución de problemas</a></li> +</ul><h3>Consulte también</h3><ul class="seealso"><li><a href="#comments_section">Comentarios</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">Ficheros .htaccess</a></h2> + <table class="related"><tr><th>Módulos Relacionados</th><th>Directivas Relacionadas</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table> + + <div class="note">Debería evitar usar ficheros <code>.htaccess</code> completamente si + tiene acceso al fichero de configuración principal de httpd. Usar ficheros + <code>.htaccess</code> ralentiza su servidor Apache http. Cualquier + directiva que pueda incluir en un fichero <code>.htaccess</code> + estará mejor configurada dentro de una sección + <code class="directive"><a href="../mod/core.html#directory">Directory</a></code>, tendrá el mismo efecto y + mejor rendimiento.</div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">Qué son/Cómo usarlos</a></h2> + + + <p>Los ficheros <code>.htaccess</code> (o "ficheros de configuración + distribuida") facilitan una forma de realizar cambios en la configuración + en contexto directorio. Un fichero, que contiene una o más directivas, se + coloca en un documento específico de un directorio, y estas directivas + aplican a ese directorio y todos sus subdirectorios.</p> + + <div class="note"><h3>Nota:</h3> + <p>Si quiere llamar a su fichero <code>.htaccess</code> de otra manera, + puede cambiar el nombre del fichero usando la directiva <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code>. Por ejemplo, si usted prefiere + llamar al fichero <code>.config</code>, entonces puede poner lo siguiente + en el fichero de configuración de su servidor:</p> + + <pre class="prettyprint lang-config">AccessFileName ".config"</pre> + + </div> + + <p>Generalmente, los ficheros <code>.htaccess</code> usan la misma sintáxis + que los <a href="../configuring.html#syntax">ficheros de la configuración + principal</a>. Lo que puede utilizar en estos ficheros lo determina la + directiva <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>. Esta directiva + especifica, en categorías, qué directivas tendrán efecto si se encuentran en + un fichero <code>.htaccess</code>. Si se permite una directiva en un fichero + <code>.htaccess</code>, la documentación para esa directiva contendrá una + sección Override, especificando qué valor debe ir en + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> para que se permita esa + directiva.</p> + + <p>Por ejemplo, si busca en la documentación la directiva <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code>, encontrará que se permite en + ficheros <code>.htaccess</code>. (Vea la línea de Contexto en el sumario de + la directiva.) La línea <a href="../mod/directive-dict.html#Context">Override</a> muestra + <code>FileInfo</code>. De este modo, debe tener al menos + <code>AllowOverride FileInfo</code> para que esta directiva se aplique en + ficheros <code>.htaccess</code>.</p> + + <div class="example"><h3>Ejemplo:</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">Context:</a></td> + <td>server config, virtual host, directory, .htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">Override:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>Si no está seguro de cuándo, una directiva en concreto, se puede usar en un + fichero <code>.htaccess</code>, consulte la documentación para esa directiva, + y compruebe la línea Context buscando ".htaccess".</p> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">Cuando (no) usar ficheros .htaccess</a></h2> + + <p>Generalmente, solo debería usar ficheros <code>.htaccess</code> cuando no + tiene acceso al fichero principal de configuración del servidor. Hay, por + ejemplo, una creencia errónea de que la autenticación de usuario debería + hacerse siempre dentro de ficheros <code>.htaccess</code>, y, más recientemente, otra creencia errónea de que las directivas de + <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> deben ir en ficheros <code>.htaccess</code>. + Esto sencillamente no es el caso. Puede poner las configuraciones de + autenticación de usuario en la configuración principal del servidor, y esto + es de hecho, el método preferido de configurar Apache. Del mismo modo, las + directivas <code>mod_rewrite</code> funcionan mejor, en muchos sentidos, en + el fichero de configuración principal del servidor.</p> + + <p>Los ficheros <code>.htaccess</code> deberían usarse cuando su proveedor + de contenidos le permite hacer modificaciones de configuración + en contexto directorio, pero usted no tiene acceso de root en el servidor. + En el caso de que el administrador no esté dispuesto a hacer cambios + frecuentes en la configuración, puede que sea necesario permitir a usuarios + individuales realizar estos cambios de configuración en ficheros + <code>.htaccess</code> por ellos mismos. Lo cual ocurre a menudo, por + ejemplo, en casos donde los ISP están albergando múltiples sitios web de + usuario en una sola máquina, y quieren que sus usuarios tengan la + posibilidad de modificar sus configuraciones.</p> + + <p>Aun así, generalmente, el uso de ficheros <code>.htaccess</code> debería + evitarse cuando sea posible. Cualquier configuración que consideraría poner + en un fichero <code>.htaccess</code>, puede usarse con la misma efectividad + en una sección <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> en el fichero de configuración + del servidor.</p> + + <p>Hay dos razones para evitar el uso de ficheros <code>.htaccess</code>.</p> + + <p>La primera es el rendimiento. Cuando <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + está configurado para permitir el uso de ficheros <code>.htaccess</code>, + httpd buscará ficheros <code>.htaccess</code> en cada directorio. Así, + permitiendo ficheros <code>.htaccess</code> provoca una pérdida de + rendimiento, ¡incluso aunque no los use! Además, los ficheros + <code>.htaccess</code> se cargan cada vez que se solicita un documento.</p> + + <p>Además tenga en cuenta que httpd debe buscar ficheros + <code>.htaccess</code> en todos los directorios de mayor jerarquía, + para poder terner la lista completa de directivas que debe aplicar. (Vea + la sección sobre <a href="#how">Cómo se aplican las directivas</a>.) Así, si + se solicita un fichero de un directorio <code>/www/htdocs/example</code>, + httpd debe buscar los siguientes ficheros:</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/example/.htaccess + </code></p></div> + + <p>De esta manera, por cada acceso a un fichero de ese directorio, hay 4 + accesos adicionales al sistema de ficheros, incluso si ninguno de esos + ficheros está presente. (Tenga en cuenta que este caso solo se daría si los + ficheros <code>.htaccess</code> están activados en <code>/</code>, que + generalmente no es el caso.).</p> + + <p>En el caso de las directivas <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>, en el contexto de + <code>.htaccess</code> estas expresiones regulares deben recompilarse con + cada solicitud a ese directorio, cuando en el contexto de configuración del + servidor solo se compilan una vez y se cachean. Adicionalmente, las reglas + en sí mismas son más complicadas, puesto que uno debe sortear las + restricciones que vienen acompañadas del contexto directorio y + <code>mod_rewrite</code>. Consulte la <a href="../rewrite/intro.html#htaccess">Guía de Rewrite</a> para un mayor + detalle sobre este tema.</p> + + <p>La segunda consideración es de seguridad. Estará permitiendo que usuarios + modifiquen la configuración del servidor, lo cual puede dar lugar a cambios sobre los que usted no tendrá ningún control. Medite profundamente si debe + dar a sus usuarios ese privilegio. Además tenga en cuenta que dar a los usuarios menos privilegios de los que necesitan dará lugar a más peticiones + de soporte. Asegúrese de que le indica a sus usuarios claramente el nivel de privilegios que les está dando. Especificando exactamente cómo ha + configurado <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>, e invíteles + a revisar la documentación relacionada, lo cual le ahorrará + bastantes confusiones más adelante.</p> + + <p>Tenga en cuenta que esto es equivalente por completo a poner un fichero + <code>.htaccess</code> en un directorio <code>/www/htdocs/example</code> + con una directiva, y poner la misma directiva en una sección + Directory <code><Directory "/www/htdocs/example"></code> en su + configuración principal del servidor:</p> + + <p>Fichero <code>.htaccess</code> en <code>/www/htdocs/example</code>:</p> + + <div class="example"><h3>Contenido de fichero .htaccess en + <code>/www/htdocs/example</code></h3><pre class="prettyprint lang-config">AddType text/example ".exm"</pre> +</div> + + <div class="example"><h3>Sección de su fichero <code>httpd.conf</code></h3><pre class="prettyprint lang-config"><Directory "/www/htdocs/example"> + AddType text/example ".exm" +</Directory></pre> +</div> + + <p>Aun así, poniendo ésta en el fichero de configuración dará como resultado + una menor pérdida de rendimiento, y como la configuración se carga una vez + cuando el httpd arranca, en lugar de cada vez que se solicita un fichero.</p> + + <p>El uso de ficheros <code>.htaccess</code> puede desactivarse por completo + configurando la directiva <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + a <code>none</code>:</p> + + <pre class="prettyprint lang-config">AllowOverride None</pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">How directives are applied</a></h2> + + <p>Las directivas de configuración que se encuentran en el fichero + <code>.htaccess</code> se aplican al directorio en el que el fichero + <code>.htaccess</code> se encuentra, y a todos sus subdirectorios. Sin + embargo, es importante recordar que puede haber otros ficheros + <code>.htaccess</code> en directorios previos. Las directivas se aplican en + el orden en el que se encuentran. Por lo tanto, un fichero + <code>.htaccess</code> puede sobrescribir directivas que se encuentran + en ficheros <code>.htaccess</code> que se encuentran en directorios previos + del árbol de directorios. Y estos, en cambio, pueden haber sobrescrito + directivas que se encontraban más arriba, o en el fichero principal de + configuración del servidor mismo.</p> + + <p>Ejemplo:</p> + + <p>En el directorio <code>/www/htdocs/example1</code> tenemos un fichero + <code>.htaccess</code> que contiene lo siguiente:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI</pre> + + + <p>(Nota: debe terner "<code>AllowOverride Options</code>" configurado para + permitir el uso de la directiva "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" en ficheros + <code>.htaccess</code> files.)</p> + + <p>En el directorio <code>/www/htdocs/example1/example2</code> tenemos un + fichero <code>.htaccess</code> que contiene:</p> + + <pre class="prettyprint lang-config">Options Includes</pre> + + + <p>Por este segundo fichero <code>.htaccess</code>, en el directorio + <code>/www/htdocs/example1/example2</code>, la ejecución de CGI execution no + está permitida, porque solo se ha definido <code>Options Includes</code>, + que sobrescribe completamente una configuración previa que se pudiera haber + definido.</p> + + <h3><a name="merge" id="merge">Incorporando el .htaccess en los ficheros de + configuración principal</a></h3> + + <p>Como se ha comentado en la documentación en las <a href="../sections.html">Secciones de Configuración</a>, los ficheros + <code>.htaccess</code> pueden sobrescribir las secciones <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> por el directorio + correspondiente, pero se sobrescribirán por otros tipos de secciones de + configuración de los ficheros de configuración principal. Este hecho se + puede usar para forzar ciertas configuraciones, incluso en presencia + de una configuración laxa de + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>. Por ejemplo, para + prevenir la ejecución de un script mientras se permite cualquier otra cosa + en <code>.htaccess</code> puede usar:</p> + + <pre class="prettyprint lang-config"><Directory "/www/htdocs"> + AllowOverride All +</Directory> + +<Location "/"> + Options +IncludesNoExec -ExecCGI +</Location></pre> + + + <div class="note">Este ejemplo asume que su <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> es <code>/www/htdocs</code>.</div> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">Ejemplo de Autenticación</a></h2> + + <p>Si saltó directamente a esta parte del documento para averiguar como + hacer la autenticación, es important que tenga en cuenta una cosa. Hay una + creencia errónea de que necesita usar ficheros <code>.htaccess</code> para + configurar autenticación con contraseña. Este no es el caso. Colocar las + directivas de autenticación en una sección + <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code>, en su fichero + de configuración principal, es el método recomendado para configurar esto, + y los ficheros <code>.htaccess</code> deberían usarse solamente si no tiene + acceso al fichero de configuración principal del servidor. Vea <a href="#when">más arriba</a> una explicación de cuando debería y cuando no + debería usar ficheros <code>.htaccess</code>.</p> + + <p>Dicho esto, si todavía cree que debe usar el fichero + <code>.htaccess</code>, podrá ver que una configuración como la que sigue + podría servirle.</p> + + <p>Contenido del fichero <code>.htaccess</code>:</p> + + <pre class="prettyprint lang-config">AuthType Basic +AuthName "Password Required" +AuthUserFile "/www/passwords/password.file" +AuthGroupFile "/www/passwords/group.file" +Require group admins</pre> + + + <p>Tenga en cuenta que <code>AllowOverride AuthConfig</code> debe estar + habilitado para que estas directivas tengan algún efecto.</p> + + <p>Por favor vea el <a href="auth.html">tutorial de autenticación</a> para + una explicación más completa de la autenticación y la autorización.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">Ejemplo de Server Side Includes</a></h2> + + <p>Otro uso común de ficheros <code>.htaccess</code> es activar Server Side + Includes para un directorio en particular. Esto puede hacerse + con las siguientes directivas de configuración, colocadas en un fichero + <code>.htaccess</code> y el directorio deseado:</p> + + <pre class="prettyprint lang-config">Options +Includes +AddType text/html "shtml" +AddHandler server-parsed shtml</pre> + + + <p>Tenga en cuenta que <code>AllowOverride Options</code> y + <code>AllowOverride FileInfo</code> deben estar activadas para que estas + directivas tengan efecto.</p> + + <p>Por favor vea el <a href="ssi.html">tutorial de SSI</a> para una + explicación más completa de server-side includes.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="rewrite" id="rewrite">Reglas de Rewrite en ficheros .htaccess</a></h2> + <p>Cuando use <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> en + ficheros <code>.htaccess</code>, tenga en cuenta que el contexto + directorio cambia las cosas un poco. En concreto, las reglas son + relativas al directorio actual, en lugar de serlo de la petición de URI + solicitada originalmente. + Considere los siguientes ejemplos:</p> + +<pre class="prettyprint lang-config"># En httpd.conf +RewriteRule "^/images/(.+)\.jpg" "/images/$1.png" + +# En .htaccess en el directorio raíz +RewriteRule "^images/(.+)\.jpg" "images/$1.png" + +# En .htaccess en images/ +RewriteRule "^(.+)\.jpg" "$1.png"</pre> + + + <p>En un <code>.htaccess</code> en cualquier directorio del DocumentRoot, la + barra ("/") inicial se elimina del valor facilitado a <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>, y en el subdirectorio + <code>images</code>, se elimina <code>/images/</code> también de este valor. + Así, su expresión regular necesita omitir también esa parte.</p> + + <p>Consulte la <a href="../rewrite/">documentación de mod_rewrite</a> para + más detalles al usar <code>mod_rewrite</code>.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">Ejemplo de CGI</a></h2> + + <p>Finalmente, puede que quiera usar un fichero <code>.htaccess</code> para + permitir la ejecución de programas CGI en un directorio en particular. Esto + se puede implementar con la siguiente configuración:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +AddHandler cgi-script "cgi" "pl"</pre> + + + <p>Alternativamente, si quiere considerar como programas CGI todos los + ficheros de un directorio concreto, esto se puede conseguir con la siguiente + configuración:</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +SetHandler cgi-script</pre> + + + <p>Tenga en cuenta que <code>AllowOverride Options</code> y + <code>AllowOverride FileInfo</code> deben estar ambas activadas para que + estas directivas tengan efecto.</p> + + <p>Por favor vea el <a href="cgi.html">tutorial CGI</a> para mayor detalle + sobre programación y configuración de CGI.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">Resolución de problemas</a></h2> + + <p>Cuando pone directivas en un fichero <code>.htaccess</code> y no obtiene + el efecto deseado hay una serie de cosas que pueden haber ido mal.</p> + + <p>El problema más común es que <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride + </a></code> no está configurada para que sus directivas puedan surtir + efecto. Asegúrese de que no tiene <code>AllowOverride None</code> + configurado para el directorio en cuestión. Una buena forma de probar esto + es poner "basura" en su fichero <code>.htaccess</code> y recargar la página. + Si no se genera un error en el servidor, casi seguro que tiene configurado + <code>AllowOverride None</code>.</p> + + <p>Si, por otro lado, obtiene errores de servidor al intentar acceder a + documentos, compruebe el log de errores de httpd. Seguramente le indiquen + que la directiva en uso en su fichero <code>.htaccess</code> no está + permitida.</p> + + <div class="example"><p><code> + [Fri Sep 17 18:43:16 2010] [alert] [client 192.168.200.51] /var/www/html/.htaccess: DirectoryIndex not allowed here + </code></p></div> + + <p>Esto indicará que o bien ha usado una directiva que no se permite nunca + en ficheros <code>.htaccess</code>, o que simplementa no tiene + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> configurado + a un nivel suficiente para la directiva que ha usado. Consulte la + documentación para esa directiva en particular para determinar cual es el + caso.</p> + + <p>Alternativamente, puede que le indique que hay un error de sintaxis en + el uso de la propia directiva.</p> + + <div class="example"><p><code> + [Sat Aug 09 16:22:34 2008] [alert] [client 192.168.200.51] /var/www/html/.htaccess: RewriteCond: bad flag delimiters + </code></p></div> + + <p>En este caso, el mensaje de error debería ser específico para el error de + sintaxis concreto que ha cometido.</p> + +</div></div> +<div class="bottomlang"> +<p><span>Idiomas disponibles: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comentarios</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licencia bajo los términos de la <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Directivas</a> | <a href="http://wiki.apache.org/httpd/FAQ">Preguntas Frecuentes</a> | <a href="../glossary.html">Glosario</a> | <a href="../sitemap.html">Mapa del sitio web</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.fr.utf8 b/docs/manual/howto/htaccess.html.fr.utf8 new file mode 100644 index 0000000..bbaffd0 --- /dev/null +++ b/docs/manual/howto/htaccess.html.fr.utf8 @@ -0,0 +1,512 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Tutoriel du serveur HTTP Apache : fichiers .htaccess - Serveur HTTP Apache Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p> +<p class="apache">Serveur HTTP Apache Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Serveur HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">Recettes / Tutoriels</a></div><div id="page-content"><div id="preamble"><h1>Tutoriel du serveur HTTP Apache : fichiers .htaccess</h1> +<div class="toplang"> +<p><span>Langues Disponibles: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div> + +<p>Les fichiers <code>.htaccess</code> fournissent une méthode pour +modifier la configuration du serveur au niveau de chaque répertoire.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">Fichiers .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">Que sont ce fichiers, comment les utiliser ?</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">Quand doit-on (ne doit-on pas) utiliser + les fichiers .htaccess ?</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">Comment sont appliquées les directives ?</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">Exemple d'authentification</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">Exemple d'Inclusion Côté Serveur (Server Side +Includes - SSI)</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#rewrite">Les règles de réécriture dans les fichiers .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">Exemple de CGI</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">Résolution des problèmes</a></li> +</ul><h3>Voir aussi</h3><ul class="seealso"><li><a href="#comments_section">Commentaires</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">Fichiers .htaccess</a></h2> + + <table class="related"><tr><th>Modules Apparentés</th><th>Directives Apparentées</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table> + <div class="note">Les fichiers <code>.htaccess</code> ne doivent être utilisés + que si vous n'avez pas accès au fichier de configuration du serveur + principal. L'utilisation des fichiers <code>.htaccess</code> + ralentit le fonctionnement de votre serveur HTTP Apache. Il est toujours + préférable de définir les directives que vous pouvez inclure dans un + fichier <code>.htaccess</code> dans une section <code class="directive"><a href="../mod/core.html#directory">Directory</a></code>, car elles produiront le + même effet avec de meilleures performances.</div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">Que sont ce fichiers, comment les utiliser ?</a></h2> + + + <p>Les fichiers <code>.htaccess</code> (ou "fichiers de + configuration distribués") fournissent une méthode pour modifier la + configuration du serveur au niveau d'un répertoire. Un fichier, + contenant une ou plusieurs directives de configuration, est placé + dans un répertoire de documents particulier, et ses directives + s'appliquent à ce répertoire et à tous ses sous-répertoires.</p> + + <div class="note"><h3>Note :</h3> + <p>Si vous voulez donner un autre nom à votre fichier + <code>.htaccess</code>, vous pouvez le faire en utilisant la + directive <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code>. Par + exemple, si vous préférez nommer votre fichier + <code>.config</code>, vous pouvez mettre ceci dans le fichier de + configuration de votre serveur :</p> + + <pre class="prettyprint lang-config">AccessFileName ".config"</pre> + + </div> + + <p>En général, les fichiers <code>.htaccess</code> utilisent la même + syntaxe que les <a href="../configuring.html#syntax">fichiers de + configuration principaux</a>. Ce que vous pouvez mettre dans ces + fichier est déterminé par la directive <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>. Cette directive spécifie, + sous forme de catégories, quelles directives seront traitées si + elles se trouvent dans un fichier <code>.htaccess</code>. Si une + directive est permise dans un fichier <code>.htaccess</code> file, + la documentation de cette directive contiendra une section Override, + spécifiant quelle valeur doit prendre <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> pour que cette directive + soit traitée.</p> + + <p>Par exemple, si vous regardez la documentation de la directive + <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code>, vous verrez + que cette dernière est permise dans les fichiers + <code>.htaccess</code> (Voir la ligne de contexte dans le résumé de + la directive). La ligne <a href="../mod/directive-dict.html#Context">Override</a> indique + <code>FileInfo</code>. Vous devez donc avoir au moins + <code>AllowOverride FileInfo</code> pour que cette directive soit + traitée dans les fichiers <code>.htaccess</code>.</p> + + <div class="example"><h3>Exemple :</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">Contexte :</a></td> + <td>configuration du serveur, serveur virtuel, directory, .htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">Override:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>Si vous n'êtes pas sûr qu'une directive particulière soit permise + dans un fichier <code>.htaccess</code>, lisez la documentation de + cette directive, et consultez la ligne de contexte pour + ".htaccess".</p> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">Quand doit-on (ne doit-on pas) utiliser + les fichiers .htaccess ?</a></h2> + + <p>En principe, vous ne devriez utiliser les fichiers + <code>.htaccess</code> que lorsque vous n'avez pas accès au fichier de + configuration du serveur principal. Par exemple, la fausse + idée + selon laquelle l'authentification de l'utilisateur devrait toujours + être faite dans les fichiers <code>.htaccess</code> est très + répandue. Il est aussi souvent avancé, ces dernières + années, que les directives de <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code> doivent + être définies dans les fichiers <code>.htaccess</code>. Ceci est + tout simplement faux. Vous pouvez configurer + l'authentification des utilisateurs au niveau de la configuration du + serveur principal, et c'est en fait cette méthode qui doit être + privilégiée. De même, les directives de + <code>mod_rewrite</code> fonctionneront mieux, à de nombreux égards, + dans le contexte du serveur principal.</p> + + <p>Les fichiers <code>.htaccess</code> ne devraient être utilisés + que dans le cas où les fournisseurs de contenu ont besoin de + modifier la configuration du serveur au niveau d'un répertoire, mais + ne possèdent pas l'accès root sur le système du serveur. Si + l'administrateur du serveur ne souhaite pas effectuer des + modifications de configuration incessantes, il peut être intéressant + de permettre aux utilisateurs isolés d'effectuer eux-mêmes ces + modifications par le biais de fichiers <code>.htaccess</code>. Ceci + est particulièrement vrai dans le cas où le fournisseur d'accès à + Internet héberge de nombreux sites d'utilisateurs sur un seul + serveur, et souhaite que ces utilisateurs puissent modifier + eux-mêmes leurs configurations.</p> + + <p>Cependant et d'une manière générale, il vaut mieux éviter + d'utiliser les fichiers <code>.htaccess</code>. Tout élément de + configuration que vous pourriez vouloir mettre dans un fichier + <code>.htaccess</code>, peut aussi être mis, et avec la même + efficacité, dans une section <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> du fichier de configuration de + votre serveur principal.</p> + + <p>Il y a deux raisons principales d'éviter l'utilisation des + fichiers <code>.htaccess</code>.</p> + + <p>La première est liée aux performances. Lorsque la directive + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> est définie de + façon à autoriser l'utilisation des fichiers <code>.htaccess</code>, + httpd va rechercher leur présence dans chaque répertoire. Ainsi, + permettre l'utilisation des fichiers <code>.htaccess</code> est déjà + en soi une cause de dégradation des performances, que vous utilisiez + effectivement ces fichiers ou non ! De plus, le fichier + <code>.htaccess</code> est chargé en mémoire chaque fois qu'un + document fait l'objet d'une requête.</p> + + <p>Notez aussi que httpd doit rechercher les fichiers + <code>.htaccess</code> dans tous les répertoires de niveau + supérieur, afin de rassembler toutes les directives qui s'appliquent + au répertoire courant (Voir la section <a href="#how">comment sont + appliquées les directives</a>). Ainsi, si un fichier fait l'objet + d'une requête à partir d'un répertoire + <code>/www/htdocs/exemple</code>, httpd doit rechercher les + fichiers suivants :</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/exemple/.htaccess + </code></p></div> + + <p>En conséquence, chaque accès à un fichier de ce répertoire + nécessite 4 accès au système de fichiers supplémentaires pour + rechercher des fichiers <code>.htaccess</code>, même si + aucun de ces fichiers n'est présent. Notez que cet exemple ne peut + se produire que si les fichiers <code>.htaccess</code> ont été + autorisés pour le répertoire <code>/</code>, ce qui est rarement le + cas.</p> + + <p>La seconde raison d'éviter l'utilisation des fichiers + <code>.htaccess</code> est liée à la sécurité. Si vous permettez aux + utilisateurs de modifier la configuration du serveur, il peut en + résulter des conséquences sur lesquelles vous n'aurez aucun + contrôle. Réfléchissez bien avant de donner ce privilège à vos + utilisateurs. Notez aussi que ne pas donner aux utilisateurs les + privilèges dont ils ont besoin va entraîner une augmentation des + demandes de support technique. Assurez-vous d'avoir informé + clairement vos utilisateurs du niveau de privilèges que vous leur + avez attribué. Indiquer exactement comment vous avez défini la + directive <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> et + diriger les utilisateurs vers la documentation correspondante vous + évitera bien des confusions ultérieures.</p> + + <p>Notez que mettre un fichier <code>.htaccess</code> contenant une + directive dans un répertoire <code>/www/htdocs/exemple</code> + revient exactement au même que mettre la même directive dans une + section Directory <code><Directory "/www/htdocs/exemple"></code> + du fichier de configuration de votre serveur principal :</p> + + <p>Fichier <code>.htaccess</code> dans + <code>/www/htdocs/exemple</code> :</p> + + <div class="example"><h3>Contenu du fichier .htaccess dans + <code>/www/htdocs/exemple</code></h3><pre class="prettyprint lang-config">AddType text/example ".exm"</pre> +</div> + + <div class="example"><h3>Section de votre fichier + <code>httpd.conf</code></h3><pre class="prettyprint lang-config"><Directory "/www/htdocs/example"> + AddType text/example .exm +</Directory></pre> +</div> + + <p>Cependant, la perte de performances sera moindre si vous + définissez cette directive dans la configuration de + votre serveur principal, car cette dernière ne sera chargée qu'une + seule fois au moment du démarrage du serveur, alors qu'elle le sera + à chaque accès dans le cas d'un fichier <code>.htaccess</code>.</p> + + <p>L'utilisation des fichiers <code>.htaccess</code> peut être + entièrement désactivée en définissant la directive <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> à <code>none</code> :</p> + + <pre class="prettyprint lang-config">AllowOverride None</pre> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">Comment sont appliquées les directives ?</a></h2> + + <p>Les directives de configuration situées dans un fichier + <code>.htaccess</code> s'appliquent au répertoire dans lequel ce + fichier <code>.htaccess</code> se trouve, ainsi qu'à tous ses + sous-répertoires. Cependant, il est important de garder à l'esprit + qu'il peut y avoir des fichiers <code>.htaccess</code> dans les + répertoires de niveau supérieur. Les directives sont appliquées + selon l'ordre dans lequel elles sont rencontrées. Ainsi, les + directives d'un fichier <code>.htaccess</code> situé dans un + répertoire particulier peuvent écraser les directives se trouvant + dans des fichiers <code>.htaccess</code> situés à un niveau + supérieur dans l'arborescence des répertoires. Et ces dernières + peuvent elles-mêmes avoir écrasé des directives d'un fichier + <code>.htaccess</code> situé à un niveau encore plus haut, ou dans + le fichier de configuration du serveur principal.</p> + + <p>Exemple :</p> + + <p>Dans le répertoire <code>/www/htdocs/exemple1</code> se trouve un + fichier <code>.htaccess</code> contenant ce qui suit :</p> + + <pre class="prettyprint lang-config">Options +ExecCGI</pre> + + + <p>Note : "<code>AllowOverride Options</code>" doit être présent + pour permettre l'utilisation de la directive "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" dans les fichiers + <code>.htaccess</code>.</p> + + <p>Dans le répertoire <code>/www/htdocs/exemple1/exemple2</code> se + trouve un fichier <code>.htaccess</code> contenant ce qui suit + :</p> + + <pre class="prettyprint lang-config">Options Includes</pre> + + + <p>Ainsi, à cause de ce second fichier <code>.htaccess</code> du + répertoire <code>/www/htdocs/exemple1/exemple2</code>, l'exécution + des CGI est interdite, car la dernière définition d'options + <code>Options Includes</code> écrase toute autre définition + d'options d'un fichier <code>.htaccess</code> situé dans un + répertoire de niveau supérieur.</p> + + <h3><a name="merge" id="merge">Interactions entre les fichiers .htaccess + et les fichiers de configuration du serveur principal</a></h3> + + <p>Comme indiqué dans la documentation sur les <a href="../sections.html">Sections de configuration</a>, les fichiers + <code>.htaccess</code> peuvent écraser les directives des sections + <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> pour + le répertoire correspondant, mais peuvent eux-mêmes être écrasés + par d'autres types de sections des fichiers de la + configuration principale. Cette possibilité peut s'avérer utile pour + forcer certaines configurations, même en cas de présence de l'option + libérale <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>. Par + exemple, pour interdire l'exécution de scripts en autorisant la + définition de toute autre option dans les fichiers + <code>.htaccess</code>, vous pouvez utiliser :</p> + + <pre class="prettyprint lang-config"><Directory "/www/htdocs"> + AllowOverride All +</Directory> + +<Location "/"> + Options +IncludesNoExec -ExecCGI +</Location></pre> + + + <div class="note">Dans cet exemple, on considère que le chemin défini par la + directive <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> est + <code>/www/htdocs</code>.</div> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">Exemple d'authentification</a></h2> + + <p>Si vous accédez directement à ce point du document pour apprendre + à effectuer une authentification, il est important de noter ceci. Il + existe une fausse idée selon laquelle il serait nécessaire + d'utiliser les fichiers <code>.htaccess</code> pour implémenter + l'authentification par mot de passe. Ceci est tout simplement faux. + Pour y parvenir, il est préférable de mettre les directives + d'authentification dans une section <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> du fichier de configuration de + votre serveur principal, et les fichiers <code>.htaccess</code> ne + devraient être utilisés que dans le cas où vous n'avez pas accès au + fichier de configuration du serveur principal. Voir <a href="#when">ci-dessus</a> pour savoir dans quels cas vous devez ou + ne devez pas utiliser les fichiers <code>.htaccess</code>.</p> + + <p>Ceci étant dit, si vous pensez que vous devez quand-même utiliser + un fichier <code>.htaccess</code>, vous pouvez utiliser la + configuration suivante :</p> + + <p>Contenu du fichier <code>.htaccess</code> :</p> + + <pre class="prettyprint lang-config">AuthType Basic +AuthName "Password Required" +AuthUserFile "/www/passwords/password.file" +AuthGroupFile "/www/passwords/group.file" +Require group admins</pre> + + + <p>Notez que <code>AllowOverride AuthConfig</code> doit être présent + pour que ces directives produisent leur effet.</p> + + <p>Vous pouvez vous référer au <a href="auth.html">tutoriel sur + l'authentification</a> pour une description plus détaillée de + l'authentification et de l'autorisation.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">Exemple d'Inclusion Côté Serveur (Server Side +Includes - SSI)</a></h2> + + <p>Les fichiers <code>.htaccess</code> sont aussi couramment + utilisés pour activer les SSI pour un répertoire particulier. Pour y + parvenir, on utilise les directives de configuration suivantes, + placées dans un fichier <code>.htaccess</code> enregistré dans le + répertoire considéré :</p> + + <pre class="prettyprint lang-config">Options +Includes +AddType text/html shtml +AddHandler server-parsed shtml</pre> + + + <p>Notez que <code>AllowOverride Options</code> et <code>AllowOverride + FileInfo</code> doivent être tous les deux présents pour que ces + directives puissent produire leur effet.</p> + + <p>Vous pouvez vous référer au <a href="ssi.html">tutoriel SSI</a> + pour une description plus détaillée des SSI.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="rewrite" id="rewrite">Les règles de réécriture dans les fichiers .htaccess</a></h2> +<p>Sivous utilisez des directives <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code> dans un fichier +<code>.htaccess</code>, gardez à l'esprit que les choses sont légèrement +différentes dans un contexte de répertoire. En particulier, les règles +sont relatives au répertoire courant, et non à l'URI original. Considérez +les exemples suivants :</p> + +<pre class="prettyprint lang-config"># Dans httpd.conf +RewriteRule "^/images/(.+)\.jpg" "/images/$1.png" + +# Dans un fichier .htaccess situé dans le répertoire racine de vos +# documents +RewriteRule "^images/(.+)\.jpg" "images/$1.png" + +# Dans un fichier .htaccess situé dans le répertoire images/ +RewriteRule "^(.+)\.jpg" "$1.png"</pre> + + +<p>On voit que si le fichier <code>.htaccess</code> se situe à la racine +de vos documents, le slash de tête est supprimé de la valeur de +remplacement spécifiée pour la règle <code class="directive"><a href="../mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>, et que si le fichier +<code>.htaccess</code> se situe dans le répertoire <code>images</code>, +la chaîne <code>/images/</code> disparaît de cette même valeur de +remplacement. Il doit donc en être de même dans votre expression +rationnelle.</p> + +<p>Veuillez vous référer à cette <a href="../rewrite/">documentation</a> +pour une étude détaillée de l'utilisation du module +<code>mod_rewrite</code>.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">Exemple de CGI</a></h2> + + <p>En fin de compte, vous avez décidé d'utiliser un fichier + <code>.htaccess</code> pour permettre l'exécution des programmes CGI + dans un répertoire particulier. Pour y parvenir, vous pouvez + utiliser la configuration suivante :</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +AddHandler cgi-script cgi pl</pre> + + + <p>Alternativement, si vous souhaitez que tous les fichiers d'un + répertoire donné soient considérés comme des programmes CGI, vous + pouvez utiliser la configuration suivante :</p> + + <pre class="prettyprint lang-config">Options +ExecCGI +SetHandler cgi-script</pre> + + + <p>Notez que <code>AllowOverride Options</code> et <code>AllowOverride + FileInfo</code> doivent être tous les deux présents pour que ces + directives puissent produire leur effet.</p> + + <p>Vous pouvez vous référer au <a href="cgi.html">tutoriel CGI</a> + pour une description plus détaillée de la configuration et de la + proprammation CGI.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">Résolution des problèmes</a></h2> + + <p>De nombreuses raisons peuvent être à l'origine du fait que + les directives que vous avez mises dans un fichier + <code>.htaccess</code> ne produisent pas l'effet désiré.</p> + + <p>Le plus souvent, le problème vient du fait que la définition de + la directive <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + ne permet pas l'activation des directives de votre fichier + <code>.htaccess</code>. Vérifiez si une directive + <code>AllowOverride None</code> n'affecte pas le répertoire où se + trouve votre fichier. Un bon test consiste à mettre des directives + dont la syntaxe est erronée dans votre ficher <code>.htaccess</code> + et de recharger la page. Si aucune erreur n'est générée par le + serveur, il est pratiquement certain qu'une directive + <code>AllowOverride None</code> affecte votre répertoire.</p> + + <p>Par contre, si vous obtenez des erreurs de serveur lorsque vous + tentez d'accéder à des documents, consultez votre journal des + erreurs de httpd. Il vous indiquera probablement que la directive + utilisée dans votre fichier <code>.htaccess</code> n'est pas + permise.</p> + +<div class="example"><p><code> + [Fri Sep 17 18:43:16 2010] [alert] [client 192.168.200.51] /var/www/html/.htaccess: DirectoryIndex not allowed here +</code></p></div> + <p>Cela signifie soit que vous utilisez une directive qui n'est + jamais permise dans les fichiers <code>.htaccess</code>, soit + que vous n'avez tout simplement pas défini la directive + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> à un niveau + suffisant pour la directive que vous utilisez. Consultez la + documentation de cette directive pour déterminer quel cas + s'applique.</p> + + <p>Le journal des erreurs peut aussi vous signaler une erreur de + syntaxe dans l'usage de la directive elle-même.</p> + + <div class="example"><p><code> + [Sat Aug 09 16:22:34 2008] [alert] [client 192.168.200.51] /var/www/html/.htaccess: RewriteCond: bad flag delimiters + </code></p></div> + + <p>Dans ce cas, le message d'erreur sera spécifique à l'erreur + de syntaxe que vous avez commise.</p> +</div></div> +<div class="bottomlang"> +<p><span>Langues Disponibles: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Commentaires</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Autorisé sous <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossaire</a> | <a href="../sitemap.html">Plan du site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.ja.utf8 b/docs/manual/howto/htaccess.html.ja.utf8 new file mode 100644 index 0000000..2d50ee0 --- /dev/null +++ b/docs/manual/howto/htaccess.html.ja.utf8 @@ -0,0 +1,417 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja"><head> +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Apache ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«: .htaccess ファイル - Apache HTTP サームãƒãƒ¼ã‚¸ãƒ§ãƒ³ 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p> +<p class="apache">Apache HTTP サームãƒãƒ¼ã‚¸ãƒ§ãƒ³ 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP サーãƒ</a> > <a href="http://httpd.apache.org/docs/">ドã‚ュメンテーション</a> > <a href="../">ãƒãƒ¼ã‚¸ãƒ§ãƒ³ 2.4</a> > <a href="./">How-To / ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«</a></div><div id="page-content"><div id="preamble"><h1>Apache ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«: .htaccess ファイル</h1> +<div class="toplang"> +<p><span>翻訳済ã¿è¨€èªž: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div> +<div class="outofdate">ã“ã®æ—¥æœ¬èªžè¨³ã¯ã™ã§ã«å¤ããªã£ã¦ã„ã‚‹ + å¯èƒ½æ€§ãŒã‚ã‚Šã¾ã™ã€‚ + 最近更新ã•ã‚ŒãŸå†…容を見るã«ã¯è‹±èªžç‰ˆã‚’ã”覧下ã•ã„。 + </div> + +<p><code>.htaccess</code> ファイルã¯ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªæ¯Žã«è¨å®šã‚’変更ã™ã‚‹æ–¹æ³•ã‚’ +æä¾›ã—ã¾ã™ã€‚</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">.htaccess ファイル</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">.htaccess ファイルã¨ã¯ä½•ã‹/ãã®ä½¿ã„æ–¹</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">ã„㤠.htaccess ファイルを使ã†(使ã‚ãªã„)ã‹ã€‚</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">ディレクティブã®é©ç”¨ã®ã•ã‚Œæ–¹</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">èªè¨¼ã®ä¾‹</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">SSI ã®ä¾‹</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">CGI ã®ä¾‹</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">å•é¡Œè§£æ±º</a></li> +</ul><h3>å‚ç…§</h3><ul class="seealso"><li><a href="#comments_section">コメント</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">.htaccess ファイル</a></h2> + <table class="related"><tr><th>関連モジュール</th><th>関連ディレクティブ</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">.htaccess ファイルã¨ã¯ä½•ã‹/ãã®ä½¿ã„æ–¹</a></h2> + + + <p><code>.htaccess</code> ファイル (「分散è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã€) 㯠+ ディレクトリ毎ã«è¨å®šã‚’変更ã™ã‚‹æ–¹æ³•ã‚’æä¾›ã—ã¾ã™ã€‚ディレクティブ㮠+ 書ã‹ã‚ŒãŸãƒ•ã‚¡ã‚¤ãƒ«ã‚’ディレクトリã«ç½®ãã“ã¨ã§ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã¨ãã® + サブディレクトリã™ã¹ã¦ã«ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã‚’é©ç”¨ã•ã›ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚</p> + + <div class="note"><h3>注:</h3> + <p><code>.htaccess</code> ファイルを別ã®åå‰ã«ã—ãŸã„å ´åˆã¯ã€ + <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code> ディレクティブを + 使ã£ã¦å¤‰æ›´ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚例ãˆã°ã€ãã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’ <code>.config</code> + ã¨ã„ã†åå‰ã«ã—ãŸã„å ´åˆã¯ã€ä»¥ä¸‹ã®è¨å®šã‚’サーãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã«å…¥ã‚Œã‚‹ã“ã¨ãŒ + ã§ãã¾ã™:</p> + + <div class="example"><p><code> + AccessFileName .config + </code></p></div> + </div> + + <p>一般ã«ã€<code>.htaccess</code> ファイルã®æ§‹æ–‡ã¯ + <a href="../configuring.html#syntax">主è¨å®šãƒ•ã‚¡ã‚¤ãƒ«</a> + ã¨åŒã˜ã§ã™ã€‚ã“れらã®ãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ãã“ã¨ã®ã§ãるディレクティブ㯠<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ディレクティブã«ã‚ˆã‚Šæ±ºã¾ã‚Šã¾ã™ã€‚ + ã“ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã¯ã€<code>.htaccess</code> ファイル㫠+ 書ã‹ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã®ä¸ã§ã€ã€ + ã©ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒé©ç”¨ã•ã‚Œã‚‹ã‹ã‚’カテゴリーå˜ä½ã§æŒ‡å®šã—ã¾ã™ã€‚ + <code>.htaccess</code> ã«æ›¸ãã“ã¨ã®ã§ãるディレクティブã§ã‚ã‚Œã°ã€ + 説明文書ã«ã¯ã€Œä¸Šæ›¸ãã€ã¨ã„ã†é …ç›®ãŒã‚ã‚Šã€.htaccess ã«æ›¸ãã“ã¨ãŒã§ãるよã†ã« + ãªã‚‹ãŸã‚ã® <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ã®å€¤ãŒæŒ‡å®šã•ã‚Œã¦ã„ã¾ã™ã€‚</p> + + <p>例ãˆã°ã€<code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code> ディレクティブã®èª¬æ˜Žã‚’ + 見るã¨ã€<code>.htaccess</code> ファイルã§ã®ä½¿ç”¨ãŒè¨±å¯ã•ã‚Œã¦ã„ã‚‹ã“ã¨ãŒ + ã‚ã‹ã‚Šã¾ã™ã€‚ (ディレクティブã®æ¦‚è¦ã®æ‰€ã«ã‚る「コンテã‚ストã€ã¨æ›¸ã‹ã‚Œã¦ã„ã‚‹ + 行を見ã¦ãã ã•ã„。) <a href="../mod/directive-dict.html#Context">上書ã</a>ã¨æ›¸ã‹ã‚Œã¦ã„ã‚‹è¡Œã«ã¯ + <code>FileInfo</code> ã¨ã‚ã‚Šã¾ã™ã€‚ã§ã™ã‹ã‚‰ã€<code>.htaccess</code> ä¸ã® + ã“ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒæœ‰åŠ¹ã«ãªã‚‹ãŸã‚ã«ã¯ã€å°‘ãªãã¨ã‚‚ + <code>AllowOverride FileInfo</code> ãŒè¨å®šã•ã‚Œã¦ã„ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚</p> + + <div class="example"><h3>例:</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">コンテã‚スト:</a></td> + <td>サーãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ«,ãƒãƒ¼ãƒãƒ£ãƒ«ãƒ›ã‚¹ãƒˆ,ディレクトリ,.htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">上書ã:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>ã‚るディレクティブを <code>.htaccess</code> ファイルã«æ›¸ãã“ã¨ãŒã§ãã‚‹ã‹ + ã©ã†ã‹ã‚ã‹ã‚‰ãªã„ã¨ãã¯ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã®èª¬æ˜Žã‚’探ã—ã¦ã€".htaccess" + ã®ãŸã‚ã®ã€Œã‚³ãƒ³ãƒ†ã‚ストã€ã®è¡Œã‚’調ã¹ã¦ãã ã•ã„。</p> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">ã„㤠.htaccess ファイルを使ã†(使ã‚ãªã„)ã‹ã€‚</a></h2> + + <p>一般的ã«ã€ã‚µãƒ¼ãƒã®ä¸»è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã«ã‚¢ã‚¯ã‚»ã‚¹ã§ããªã„å ´åˆã‚’除ã„ã¦ã€ + <code>.htaccess</code> ファイルã®ä½¿ç”¨ã¯æ¥µåŠ›é¿ã‘ã¦ãã ã•ã„。 + 世ã®ä¸ã«ã¯ã€ä¾‹ãˆã°ã€ãƒ¦ãƒ¼ã‚¶èªè¨¼ã¯å¸¸ã« <code>.htaccess</code> ファイル㧠+ è¡Œãªã‚ãªã‘ã‚Œã°ãªã‚‰ãªã„ã€ã¨ã„ã†èª¤è§£ãŒåºƒã¾ã£ã¦ã„ã¾ã™ãŒã€ã¾ã£ãŸããã‚“ãªã“ã¨ã¯ + ã‚ã‚Šã¾ã›ã‚“。ユーザèªè¨¼ã®è¨å®šã¯ã‚µãƒ¼ãƒä¸»è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ãã“ã¨ãŒã§ã〠+ 実際ã€ãã®æ–¹ãŒã‚ˆã‚Šè‰¯ã„è¨å®šæ–¹æ³•ã§ã™ã€‚</p> + + <p><code>.htaccess</code> ファイルã¯ã‚³ãƒ³ãƒ†ãƒ³ãƒ„æ供者ãŒãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªæ¯Žã® + è¨å®šã‚’è¡Œãªã„ãŸã„ã‘ã‚Œã©ã€ã‚µãƒ¼ãƒã‚·ã‚¹ãƒ†ãƒ ã® root アクセス権é™ã‚’æŒã£ã¦ã„ãªã„ + ã¨ã„ã†å ´åˆã«ã®ã¿ä½¿ã†ã¹ãã‚‚ã®ã§ã™ã€‚サーãƒç®¡ç†è€…ãŒé »ç¹ã«è¨å®šå¤‰æ›´ã‚’è¡Œãªã„ãŸã㯠+ ãªã„ã€ã¨ã„ã†ã¨ãã«ã¯å€‹ã€…ã®ãƒ¦ãƒ¼ã‚¶ãŒ <code>.htaccess</code> ファイルを使ã£ã¦ + 自分ã§è¨å®šã®å¤‰æ›´ã‚’è¡Œãªã†ã“ã¨ã‚’許å¯ã—ãŸæ–¹ãŒè‰¯ã„ã¨ãã‚‚ã‚ã‚‹ã§ã—ょã†ã€‚ + ã“ã‚Œã¯ç‰¹ã«ã€ISP ãŒè¤‡æ•°ã®ãƒ¦ãƒ¼ã‚¶ã®ã‚µã‚¤ãƒˆã‚’一ã¤ã®ãƒžã‚·ãƒ³ã§ãƒ›ã‚¹ãƒˆã—ã¦ã„ã¦ã€ + å„ユーザãŒè¨å®šã®å¤‰æ›´ã‚’ã§ãるよã†ã«ã—ãŸã„よã†ãªã¨ãã«ã‚ã¦ã¯ã¾ã‚Šã¾ã™ã€‚</p> + + <p>ã—ã‹ã—ã€æ™®é€šã¯å¯èƒ½ã§ã‚れ㰠<code>.htaccess</code> ファイルã®ä½¿ç”¨ã¯ + é¿ã‘ã¦ãã ã•ã„。<code>.htaccess</code> ファイルã«æ›¸ã“ã†ã¨è€ƒãˆã‚‹ã‚ˆã†ãª + ã™ã¹ã¦ã®è¨å®šã¯ã€ã‚µãƒ¼ãƒã®ä¸»è¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã® <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> セクションã§åŒã˜ã‚ˆã†ã«è¡Œãªã†ã“ã¨ãŒ + ã§ãã¾ã™ã€‚</p> + + <p><code>.htaccess</code> ファイルã®ä½¿ç”¨ã‚’é¿ã‘ã‚‹ç†ç”±ã¯ä¸»ã«äºŒã¤ã‚ã‚Šã¾ã™ã€‚</p> + + <p>一ã¤ç›®ã¯ã‚µãƒ¼ãƒã®æ€§èƒ½ã®å•é¡Œã§ã™ã€‚<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ディレクティブ㌠+ <code>.htaccess</code> ファイルã®è¨å®šã‚’許å¯ã—ã¦ã„ã‚‹å ´åˆã¯ã€Apache 㯠+ å„ディレクトリ㧠<code>.htaccess</code> ファイルを探ã—ã¾ã™ã€‚ + ã§ã™ã‹ã‚‰ã€<code>.htaccess</code> ファイルを許å¯ã™ã‚‹ã¨ã€å®Ÿéš›ã«ä½¿ç”¨ã—ã¦ã„ã‚‹ã‹ + ã©ã†ã‹ã«é–¢ã‚らãšã€æ€§èƒ½ã®ä½Žä¸‹ã‚’æ‹›ãã“ã¨ã«ãªã‚Šã¾ã™! ã¾ãŸã€<code>.htaccess</code> + ファイルã¯æ–‡æ›¸ãŒãƒªã‚¯ã‚¨ã‚¹ãƒˆã•ã‚Œã‚‹åº¦ã«èªã¿è¾¼ã¾ã‚Œã¾ã™ã€‚</p> + + <p>ã•ã‚‰ã«ã€Apache ã¯é©ç”¨ã™ã¹ãディレクティブを集ã‚ã‚‹ãŸã‚ã«ã€ã™ã¹ã¦ã® + 上ä½ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã® <code>.htaccess</code> ファイルを探ã™å¿…è¦ãŒã‚ã‚‹ã“ã¨ã«ã‚‚ + 注æ„ã—ã¦ãã ã•ã„。(<a href="#how">ディレクティブãŒé©ç”¨ã•ã‚Œã‚‹æ–¹æ³•</a>ã‚’ + å‚ç…§ã—ã¦ãã ã•ã„。)ã§ã™ã‹ã‚‰ã€<code>/www/htdocs/example</code> ã«ã‚ã‚‹ + ファイルãŒãƒªã‚¯ã‚¨ã‚¹ãƒˆã•ã‚ŒãŸã¨ãã¯ã€Apache ã¯ä»¥ä¸‹ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚’調ã¹ã¾ã™ã€‚</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/example/.htaccess + </code></p></div> + + <p>ã§ã™ã‹ã‚‰ã€ãã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã®ãã‚Œãžã‚Œã®ãƒ•ã‚¡ã‚¤ãƒ«ã¸ã®ã‚¢ã‚¯ã‚»ã‚¹ã«å¯¾ã—ã¦ã€ + 上ã®ä¾‹ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒã¾ã£ãŸãå˜åœ¨ã—ãªã„ã¨ãã§ã‚‚ã€è¿½åŠ ã®ãƒ•ã‚¡ã‚¤ãƒ«ã‚·ã‚¹ãƒ†ãƒ ã® + アクセスãŒè¡Œãªã‚れるã“ã¨ã«ãªã‚Šã¾ã™ã€‚(ã“ã‚Œã¯ã€<code>.htaccess</code> ㌠+ <code>/</code> ã«å¯¾ã—ã¦æœ‰åŠ¹ã«ãªã£ã¦ã„ã‚‹ã¨ãã®å ´åˆã§ã€æ™®é€šã¯ãã†ãªã£ã¦ + ã„ãªã„ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。)</p> + + <p>二ã¤ç›®ã¯ã‚»ã‚ュリティã§ã™ã€‚ユーザã«ã‚µãƒ¼ãƒã®è¨å®šã‚’変更ã™ã‚‹ã“ã¨ã‚’ + 許å¯ã™ã‚‹ã“ã¨ã«ãªã‚Šã¾ã™ã®ã§ã€ã‚ãªãŸè‡ªèº«ãŒç®¡ç†ã§ããªã„変更をã•ã‚Œã‚‹ + æã‚ŒãŒã‚ã‚Šã¾ã™ã€‚ユーザã«ã“ã®ç‰¹æ¨©ã‚’与ãˆã‚‹ã®ãŒè‰¯ã„ã®ã‹ã©ã†ã‹ã€å分 + 検討ã—ã¦ãã ã•ã„。ã¾ãŸã€ãƒ¦ãƒ¼ã‚¶ã«ä¸Žãˆã‚‹æ¨©é™ãŒå¿…è¦ãªã‚‚ã®ã‚ˆã‚Šã‚‚å°‘ãªã™ãŽã‚‹ã¨ã€ + 余分ãªæŠ€è¡“サãƒãƒ¼ãƒˆå ±å‘Šã‚’å—ã‘å–るよã†ã«ãªã‚‹å¯èƒ½æ€§ãŒé«˜ã„ã“ã¨ã«ã‚‚ + 注æ„ã—ã¦ãã ã•ã„。確実ã«ã€ãƒ¦ãƒ¼ã‚¶ã«ã©ã®ç¨‹åº¦ã®æ¨©é™ã‚’与ãˆãŸã‹æ˜Žç¢ºã«å‘Šã’るよã†ã« + ã—ã¦ãã ã•ã„。<code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ã« + 何をè¨å®šã—ãŸã‹ã¨ã„ã†ã“ã¨ã¨ã€é–¢é€£ã™ã‚‹æ–‡æ›¸ã‚’示ã™ã“ã¨ã§ã€ + 後々ã®æ··ä¹±ã‚’ãã£ã¨æ¸›ã‚‰ã™ã“ã¨ãŒ + ã§ãã¾ã™ã€‚</p> + + <p>ã¨ã“ã‚ã§ã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã®æ›¸ã‹ã‚ŒãŸ <code>.htaccess</code> ã‚’ + <code>/www/htdocs/example</code> ã«ç½®ãã“ã¨ã¨ã€åŒã˜ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã‚’ + 主サーãƒè¨å®šã® Directory セクション + <code><Directory /www/htdocs/example></code> ã«æ›¸ãã“ã¨ã¯ + 完全ã«ç‰ä¾¡ã§ã™:</p> + + <p><code>/www/htdocs/example</code> ã® <code>.htaccess</code> ファイル:</p> + + <div class="example"><h3><code>/www/htdocs/example</code> ã® .htaccess ファイル㮠+ 内容</h3><p><code> + AddType text/example .exm + </code></p></div> + + <div class="example"><h3><code>httpd.conf ã®ã‚»ã‚¯ã‚·ãƒ§ãƒ³</code> + file</h3><p><code> + <Directory /www/htdocs/example><br /> + <span class="indent"> + AddType text/example .exm<br /> + </span> + </Directory> + </code></p></div> + + <p>ã—ã‹ã—ã€ã“ã®è¨å®šã¯ã‚µãƒ¼ãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã«æ›¸ã„ãŸæ–¹ãŒãƒ‘フォーマンス㮠+ 低下ãŒå°‘ãªããªã‚Šã¾ã™ã€‚ファイルãŒãƒªã‚¯ã‚¨ã‚¹ãƒˆã•ã‚Œã‚‹åº¦ã« + èªã¿è¾¼ã¾ã‚Œã‚‹ä»£ã‚ã‚Šã«ã€Apache ã®èµ·å‹•æ™‚ã« 1 回ã ã‘èªã¿è¾¼ã‚ã° + よããªã‚‹ã‹ã‚‰ã§ã™ã€‚</p> + + <p><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ディレクティブ㮠+ 値を <code>none</code> ã«è¨å®šã™ã‚‹ã“ã¨ã§ <code>.htaccess</code> ファイル + ã®ä½¿ç”¨ã‚’完全ã«ç„¡åŠ¹ã«ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚</p> + + <div class="example"><p><code> + AllowOverride None + </code></p></div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">ディレクティブã®é©ç”¨ã®ã•ã‚Œæ–¹</a></h2> + + <p><code>.htaccess</code> ファイルã®è¨å®šãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–㯠<code>.htaccess</code> + ファイルã®å˜åœ¨ã™ã‚‹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã¨ã€ãã®ã‚µãƒ–ディレクトリã™ã¹ã¦ã«é©ç”¨ã•ã‚Œã¾ã™ã€‚ + ã—ã‹ã—ã€ä¸Šã®éšŽå±¤ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚‚ <code>.htaccess</code> ファイル㌠+ å˜åœ¨ã™ã‚‹ã‹ã‚‚ã—ã‚Œãªã„ã“ã¨ã‚’覚ãˆã¦ãŠãã“ã¨ã¯å¤§åˆ‡ã§ã™ã€‚ディレクティブã¯ç¾ã‚Œã‚‹ + é †ç•ªã«é©ç”¨ã•ã‚Œã¾ã™ã€‚ã§ã™ã‹ã‚‰ã€ã‚るディレクトリ㮠<code>.htaccess</code> 㯠+ ディレクトリツリーã®ã‚ˆã‚Šä¸Šã®éšŽå±¤ã® <code>.htaccess</code> ファイル㮠+ è¨å®šã‚’上書ãã™ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。ãã—ã¦ã€ãã® <code>.htaccess</code> ã‚‚ + より上ã®éšŽå±¤ã§æ›¸ã‹ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–を上書ãã—ãŸã‚Šã€ä¸»ã‚µãƒ¼ãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ« + ãã®ã‚‚ã®ã®è¨å®šã‚’上書ãã—ãŸã‚Šã—ã¦ã„ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。</p> + + <p>例:</p> + + <p>ディレクトリ <code>/www/htdocs/example1</code> ã«ä»¥ä¸‹ã®å†…容㮠+ <code>.htaccess</code> ファイルãŒã‚ã‚Šã¾ã™:</p> + + <div class="example"><p><code> + Options +ExecCGI + </code></p></div> + + <p>(注: <code>.htaccess</code> + ファイル㧠"<code class="directive"><a href="../mod/core.html#options">Options</a></code>" ディレクティブãŒæœ‰åŠ¹ã«ãªã‚‹ãŸã‚ã«ã¯ã€ + "<code>AllowOverride Options</code>" を有効ã«ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚)</p> + + <p>ディレクトリ <code>/www/htdocs/example1/example2</code> ã«ã¯ + 以下ã®ã‚ˆã†ãª <code>.htaccess</code> ファイルãŒã‚ã‚Šã¾ã™:</p> + + <div class="example"><p><code> + Options Includes + </code></p></div> + + <p>二ã¤ã‚ã® <code>.htaccess</code> ã«ã‚ˆã‚Šã€ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª + <code>/www/htdocs/example1/example2</code> ã§ã¯ CGI ã®å®Ÿè¡Œã¯ + 許å¯ã•ã‚Œã¾ã›ã‚“。ã“ã‚Œã¯ã€<code>Options Includes</code> ã®ã¿ãŒ + 効力をæŒã¡ã€ãã‚ŒãŒã™ã¹ã¦ã®ä»¥å‰ã®è¨å®šã‚’上書ãã™ã‚‹ã‹ã‚‰ã§ã™ã€‚</p> + + <h3><a name="merge" id="merge">メインè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã«å¯¾ã™ã‚‹ + .htaccess ã®ãƒžãƒ¼ã‚¸</a></h3> + + <p>As discussed in the documentation on <a href="../sections.html">Configuration Sections</a>, + <code>.htaccess</code> files can override the <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> sections for + the corresponding directory, but will be overriden by other types + of configuration sections from the main configuration files. This + fact can be used to enforce certain configurations, even in the + presence of a liberal <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> setting. For example, to + prevent script execution while allowing anything else to be set in + <code>.htaccess</code> you can use:</p> + <p><a href="../sections.html">セクションã®è¨å®š</a> + ã«è¨˜è¼‰ã•ã‚Œã¦ã„るよã†ã«ã€<code>.htaccess</code> ファイルを使ã£ã¦ + <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> + セクションã®è¨å®šã‚’ディレクトリ毎ã«ä¸Šæ›¸ãã§ãã¾ã™ãŒã€ + メインè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ä¸ã«ã‚ã‚‹ã€ä»–ã®ç¨®é¡žã®è¨å®šã‚»ã‚¯ã‚·ãƒ§ãƒ³ã«ã‚ˆã£ã¦ + ã•ã‚‰ã«ä¸Šæ›¸ãã•ã‚Œã‚‹ã“ã¨ã‚‚ã‚ã‚Šã¾ã™ã€‚ + ã“ã®ç‰¹å¾´ã‚’使ã£ã¦ã€ + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + ã§è‡ªç”±åº¦ã®é«˜ã„è¨å®šãŒã‚ã£ãŸã¨ã—ã¦ã‚‚ã€ã‚る特定ã®è¨å®šãŒç¢ºå®Ÿã« + åæ˜ ã•ã‚Œã‚‹ã‚ˆã†ã«ã§ãã¾ã™ã€‚例ãˆã°ã€CGI スクリプトã®å®Ÿè¡Œã¯ + ä¸è¨±å¯ã«ã€ã‹ã¤ã€<code>.htaccess</code> ã§ãã®ä»–ã®é …目㯠+ è¨å®šã§ãるよã†ã«ã€ã¨ã„ã†å ´åˆã¯æ¬¡ã®ã‚ˆã†ã«ã§ãã¾ã™ :</p> + + <div class="example"><p><code> +<Directory /><br /> +<span class="indent"> +Allowoverride All<br /> +</span> +</Directory><br /> +<br /> +<Location /><br /> +<span class="indent"> +Options +IncludesNoExec -ExecCGI<br /> +</span> +</Location> + </code></p></div> + + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">èªè¨¼ã®ä¾‹</a></h2> + + <p>ã‚‚ã—èªè¨¼ã®æ–¹æ³•ã‚’知るãŸã‚ã«ã“ã®éƒ¨åˆ†ã«ç›´æŽ¥æ¥ãŸã®ã§ã‚ã‚Œã°ã€æ¬¡ã®ã“ã¨ã‚’ + 知ã£ã¦ãŠãã“ã¨ãŒé‡è¦ã§ã™ã€‚よãã‚る誤解ã«ã€ãƒ‘スワードèªè¨¼ã‚’è¡Œãªã†ãŸã‚ã«ã¯ + <code>.htaccess</code> ファイルを使ã†å¿…è¦ãŒã‚ã‚‹ã€ã¨ã„ã†ã‚‚ã®ãŒã‚ã‚Šã¾ã™ã€‚ + ã“ã‚Œã¯æ£ã—ãã‚ã‚Šã¾ã›ã‚“。主サーãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã® <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> セクション㫠+ èªè¨¼ç”¨ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–を書ãæ–¹ãŒæŽ¨å¥¨ã•ã‚Œã‚‹æ–¹æ³•ã§ã€<code>.htaccess</code> + ファイルã¯ä¸»ã‚µãƒ¼ãƒè¨å®šãƒ•ã‚¡ã‚¤ãƒ«ã‚’変更ã§ããªã„ã¨ãã«ã®ã¿ä½¿ç”¨ã™ã¹ãã§ã™ã€‚ + ã„㤠<code>.htaccess</code> ファイルを使ã†ã¹ãã§ã€ã„ã¤ä½¿ã†ã¹ãã§ã¯ãªã„ã‹ã« + ã¤ã„ã¦ã¯ <a href="#when">上</a>ã‚’å‚ç…§ã—ã¦ãã ã•ã„。</p> + + <p>以上ã®ã“ã¨ã‚’ãµã¾ãˆãŸä¸Šã§ã€ã‚‚ã— <code>.htaccess</code> ã®ä½¿ç”¨ãŒ + ã¾ã å¿…è¦ã ã¨æ€ã†å ´åˆã¯ã€æ¬¡ã®ã‚ˆã†ãªã‚‚ã®ãŒæœ›ã¿ã®ã“ã¨ã‚’ã—ã¦ãれるã‹ã‚‚ + ã—ã‚Œã¾ã›ã‚“。</p> + + <p><code>.htaccess</code> ファイルã®å†…容:</p> + + <div class="example"><p><code> + AuthType Basic<br /> + AuthName "Password Required"<br /> + AuthUserFile /www/passwords/password.file<br /> + AuthGroupFile /www/passwords/group.file<br /> + Require Group admins + </code></p></div> + + <p>ã“れらã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒæœ‰åŠ¹ã«ãªã‚‹ãŸã‚ã«ã¯ã€ + <code>AllowOverride AuthConfig</code> ãŒæœ‰åŠ¹ã§ãªãã¦ã¯ãªã‚‰ãªã„ã“ã¨ã« + 注æ„ã—ã¦ãã ã•ã„。</p> + + <p>èªè¨¼ã¨æ‰¿èªã«ã¤ã„ã¦ã¯ <a href="auth.html">èªè¨¼ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«</a>ã‚’ + å‚ç…§ã—ã¦ãã ã•ã„。</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">SSI ã®ä¾‹</a></h2> + + <p>ã‚‚ã†ä¸€ã¤ã® <code>.htaccess</code> ファイルã®ã‚ˆãã‚る利用法㯠+ 特定ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ SSI を有効ã«ã™ã‚‹ã“ã¨ã§ã™ã€‚ã“ã‚Œã¯ã€æœ›ã¿ã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã® + <code>.htaccess</code> ファイルã«ä»¥ä¸‹ã®è¨å®šãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–を書ãã“ã¨ã§ + é”æˆã§ãã¾ã™:</p> + + <div class="example"><p><code> + Options +Includes<br /> + AddType text/html shtml<br /> + AddHandler server-parsed shtml + </code></p></div> + + <p>ã“れらã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒæœ‰åŠ¹ã«ãªã‚‹ãŸã‚ã«ã¯ã€ + <code>AllowOverride Options</code> 㨠<code>AllowOverride + FileInfo</code> ãŒæœ‰åŠ¹ã«ãªã£ã¦ã„ã‚‹å¿…è¦ãŒã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。</p> + + <p>よりã¾ã¨ã¾ã£ãŸ SSI ã®èª¬æ˜Žã¯ <a href="ssi.html">SSI ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«</a>ã‚’ + å‚ç…§ã—ã¦ãã ã•ã„。</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">CGI ã®ä¾‹</a></h2> + + <p>最後ã«ã€ç‰¹å®šã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã§ CGI プãƒã‚°ãƒ©ãƒ ã®å®Ÿè¡Œã‚’許å¯ã—ãŸã„ã“ã¨ãŒ + ã‚ã‚‹ã§ã—ょã†ã€‚ã“ã‚Œã¯ä»¥ä¸‹ã®è¨å®šã§è¡Œãªã†ã“ã¨ãŒã§ãã¾ã™:</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + AddHandler cgi-script cgi pl + </code></p></div> + + <p>ã‚‚ã—ãã¯ã€ã‚るディレクトリã®ã™ã¹ã¦ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒ CGI プãƒã‚°ãƒ©ãƒ 㨠+ ã¿ãªã•ã‚Œã‚‹ã‚ˆã†ã«ã—ãŸã„ãªã‚‰ã€ä»¥ä¸‹ã®è¨å®šã§å®Ÿç¾ã™ã‚‹ã“ã¨ãŒã§ãã¾ã™:</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + SetHandler cgi-script + </code></p></div> + + <p>ã“れらã®ãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒæœ‰åŠ¹ã«ãªã‚‹ãŸã‚ã«ã¯ã€ + <code>AllowOverride Options</code> 㨠<code>AllowOverride + FileInfo</code> ãŒæœ‰åŠ¹ã§ã‚ã‚‹å¿…è¦ãŒã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。</p> + + <p>CGI プãƒã‚°ãƒ©ãƒ ã¨è¨å®šã®ã‚ˆã‚Šã¾ã¨ã¾ã£ãŸèª¬æ˜Žã¯ <a href="cgi.html">CGI ãƒãƒ¥ãƒ¼ãƒˆãƒªã‚¢ãƒ«</a>ã‚’å‚ç…§ã—ã¦ãã ã•ã„。</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">å•é¡Œè§£æ±º</a></h2> + + <p>è¨å®šãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ã‚’ <code>.htaccess</code> ファイルã«æ›¸ã„ãŸã‘ã‚Œã©ã‚‚〠+ 期待ã—ãŸåŠ¹æžœãŒå¾—られãªã„ã¨ãã«ã¯ã€ã„ãã¤ã‹ã®åŽŸå› ãŒè€ƒãˆã‚‰ã‚Œã¾ã™ã€‚</p> + + <p>一番よãã‚ã‚‹ã“ã¨ã¯ã€è¨å®šãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒè€ƒæ…®ã•ã‚Œã‚‹ã‚ˆã†ã«ã¯ + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> ãŒè¨å®šã•ã‚Œã¦ã„ãªã„ + ã¨ã„ã†ã‚‚ã®ã§ã™ã€‚該当ã®ãƒ•ã‚¡ã‚¤ãƒ«ã®ã‚¹ã‚³ãƒ¼ãƒ—ã« <code>AllowOverride None</code> + ãŒè¨å®šã•ã‚Œã¦ã„ãªã„ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。ã“れを調ã¹ã‚‹ãŸã‚ã®è‰¯ã„方法ã¯ã€ + <code>.htaccess</code> ファイルã«ã”ã¿ã‚’書ã„ã¦ã€ãƒªãƒãƒ¼ãƒ‰ã™ã‚‹ã“ã¨ã§ã™ã€‚ + サーãƒã®ã‚¨ãƒ©ãƒ¼ãŒç”Ÿæˆã•ã‚Œãªã„ã¨ãã¯ã€ã»ã¼ç¢ºå®Ÿã« <code>AllowOverride + None</code> ãŒè¨å®šã•ã‚Œã¦ã„る状態ã«ãªã£ã¦ã„ã¾ã™ã€‚</p> + + <p>ãã†ã§ã¯ãªãã€æ–‡æ›¸ã‚’アクセスã—よã†ã¨ã—ãŸã¨ãã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¦ã„ã‚‹ + ã¨ãã¯ã€Apache ã®ã‚¨ãƒ©ãƒ¼ãƒã‚°ã‚’調ã¹ã¦ãã ã•ã„。<code>.htaccess</code> ファイル㧠+ 使用ã•ã‚ŒãŸãƒ‡ã‚£ãƒ¬ã‚¯ãƒ†ã‚£ãƒ–ãŒè¨±å¯ã•ã‚Œã¦ã„ãªã„ã€ã¨ã„ã†ã“ã¨ã‚’知らã›ã¦ã„ã‚‹ + å¯èƒ½æ€§ãŒé«˜ã„ã§ã™ã€‚ã¾ãŸã¯ã€æ§‹æ–‡ã®é–“é•ã„ãŒã‚ã‚‹ã“ã¨ã‚’è¿°ã¹ã¦ã„ã‚‹ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。 + ãã®å ´åˆã«ã¯ã¾ãšãれを修æ£ã™ã‚‹å¿…è¦ãŒã‚ã‚Šã¾ã™ã€‚</p> + +</div></div> +<div class="bottomlang"> +<p><span>翻訳済ã¿è¨€èªž: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">コメント</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />ã“ã®æ–‡æ›¸ã¯ <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> ã®ãƒ©ã‚¤ã‚»ãƒ³ã‚¹ã§æä¾›ã•ã‚Œã¦ã„ã¾ã™ã€‚.</p> +<p class="menu"><a href="../mod/">モジュール</a> | <a href="../mod/directives.html">ディレクティブ</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">用語</a> | <a href="../sitemap.html">サイトマップ</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.ko.euc-kr b/docs/manual/howto/htaccess.html.ko.euc-kr new file mode 100644 index 0000000..6db1e30 --- /dev/null +++ b/docs/manual/howto/htaccess.html.ko.euc-kr @@ -0,0 +1,363 @@ +<?xml version="1.0" encoding="EUC-KR"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko"><head> +<meta content="text/html; charset=EUC-KR" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>¾ÆÆÄÄ¡ ÅõÅ丮¾ó: .htaccess ÆÄÀÏ - Apache HTTP Server Version 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">¸ðµâ</a> | <a href="../mod/directives.html">Áö½Ã¾îµé</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">¿ë¾î</a> | <a href="../sitemap.html">»çÀÌÆ®¸Ê</a></p> +<p class="apache">Apache HTTP Server Version 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.4</a> > <a href="./">How-To / Tutorials</a></div><div id="page-content"><div id="preamble"><h1>¾ÆÆÄÄ¡ ÅõÅ丮¾ó: .htaccess ÆÄÀÏ</h1> +<div class="toplang"> +<p><span>°¡´ÉÇÑ ¾ð¾î: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div> +<div class="outofdate">ÀÌ ¹®¼´Â ÃÖ½ÅÆÇ ¹ø¿ªÀÌ ¾Æ´Õ´Ï´Ù. + ÃÖ±Ù¿¡ º¯°æµÈ ³»¿ëÀº ¿µ¾î ¹®¼¸¦ Âü°íÇϼ¼¿ä.</div> + +<p><code>.htaccess</code> ÆÄÀÏÀ» »ç¿ëÇÏ¿© µð·ºÅ丮º°·Î ¼³Á¤À» +º¯°æÇÒ ¼ö ÀÖ´Ù.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">.htaccess ÆÄÀÏ</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">¹«¾ùÀ̸ç/¾î¶»°Ô »ç¿ëÇϴ°¡</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">¾ðÁ¦ .htaccess ÆÄÀÏÀ» »ç¿ëÇϳª + (ȤÀº »ç¿ëÇÏÁö ¾Ê³ª)</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">¾î¶»°Ô Áö½Ã¾î¸¦ Àû¿ëÇϳª</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">ÀÎÁõ ¿¹Á¦</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">Server Side Includes ¿¹Á¦</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">CGI ¿¹Á¦</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">¹®Á¦ÇØ°á</a></li> +</ul><h3>Âü°í</h3><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">.htaccess ÆÄÀÏ</a></h2> + <table class="related"><tr><th>°ü·ÃµÈ ¸ðµâ</th><th>°ü·ÃµÈ Áö½Ã¾î</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/core.html#require">Require</a></code></li></ul></td></tr></table> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">¹«¾ùÀ̸ç/¾î¶»°Ô »ç¿ëÇϴ°¡</a></h2> + + + <p><code>.htaccess</code> ÆÄÀÏ(ȤÀº "ºÐ»ê ¼³Á¤ÆÄÀÏ")À» + »ç¿ëÇÏ¸é µð·ºÅ丮º°·Î ¼³Á¤À» º¯°æÇÒ ¼ö ÀÖ´Ù. ¿©·¯ ¼³Á¤ Áö½Ã¾î°¡ + ÀÖ´Â ÆÄÀÏÀ» ƯÁ¤ ¹®¼ µð·ºÅ丮¿¡ µÎ¸é, ±× µð·ºÅ丮¿Í ¸ðµç + ÇÏÀ§µð·ºÅ丮¿¡ Áö½Ã¾î¸¦ Àû¿ëÇÑ´Ù.</p> + + <div class="note"><h3>ÁÖÀÇ:</h3> + <p><code>.htaccess</code> ÆÄÀϸíÀ» ´Ù¸£°Ô »ç¿ëÇÏ°í ½Í´Ù¸é, + <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code> Áö½Ã¾î¸¦ + »ç¿ëÇÏ¿© º¯°æÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î, <code>.config</code> + ÆÄÀϸíÀ» »ç¿ëÇÏ·Á¸é ¼¹ö ¼³Á¤ÆÄÀÏ¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÑ´Ù.</p> + + <div class="example"><p><code> + AccessFileName .config + </code></p></div> + </div> + + <p>ÀϹÝÀûÀ¸·Î <code>.htaccess</code> ÆÄÀÏÀº <a href="../configuring.html#syntax">ÁÖ¼³Á¤ÆÄÀÏ</a>°ú ¹®¹ýÀÌ + °°´Ù. <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> + Áö½Ã¾î°¡ ÀÌ ÆÄÀÏ¿¡ ³ª¿Ã ¼ö ÀÖ´Â ³»¿ëÀ» °áÁ¤ÇÑ´Ù. ÀÌ Áö½Ã¾î´Â + <code>.htaccess</code> ÆÄÀÏ¿¡¼ Çã¿ëÇÏ´Â Áö½Ã¾î ºÐ·ù¸¦ ÁöÁ¤ÇÑ´Ù. + Áö½Ã¾î¸¦ <code>.htaccess</code> ÆÄÀÏ¿¡¼ »ç¿ëÇÒ ¼ö ÀÖ´Ù¸é, + ÇØ´ç Áö½Ã¾î ¹®¼ÀÇ Override Ç׸ñÀº Áö½Ã¾î¸¦ Çã¿ëÇϱâÀ§ÇØ + <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>¿¡ »ç¿ëÇÒ + °ªÀ» ¾Ë·ÁÁØ´Ù.</p> + + <p>¿¹¸¦ µé¾î, <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code> + Áö½Ã¾î ¹®¼¸¦ º¸¸é ÀÌ Áö½Ã¾î¸¦ <code>.htaccess</code> ÆÄÀÏ¿¡¼ + »ç¿ëÇÒ ¼ö ÀÖ´Ù. (Áö½Ã¾î ¿ä¾à¿¡¼ »ç¿ëÀå¼Ò Ç׸ñÀ» º¸¶ó.) + <a href="../mod/directive-dict.html#Context">Override</a> + ÁÙ¿¡ <code>FileInfo</code>°¡ ÀÖ´Ù. ±×·¡¼ ÀÌ Áö½Ã¾î¸¦ + <code>.htaccess</code> ÆÄÀÏ¿¡¼ »ç¿ëÇϱâÀ§Çؼ´Â ÃÖ¼ÒÇÑ + <code>AllowOverride FileInfo</code>°¡ ÇÊ¿äÇÏ´Ù.</p> + + <div class="example"><h3>¿¹Á¦:</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">»ç¿ëÀå¼Ò:</a></td> + <td>ÁÖ¼¹ö¼³Á¤, °¡»óÈ£½ºÆ®, directory, .htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">Override:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>ƯÁ¤ Áö½Ã¾î¸¦ <code>.htaccess</code> ÆÄÀÏ¿¡¼ »ç¿ëÇÒ + ¼ö ÀÖ´ÂÁö ±Ã±ÝÇϸé Áö½Ã¾î ¹®¼ÀÇ »ç¿ëÀå¼Ò Ç׸ñ¿¡ ".htaccess"°¡ + ÀÖ´ÂÁö È®ÀÎÇÑ´Ù.</p> + </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">¾ðÁ¦ .htaccess ÆÄÀÏÀ» »ç¿ëÇϳª + (ȤÀº »ç¿ëÇÏÁö ¾Ê³ª)</a></h2> + + <p>ÀϹÝÀûÀ¸·Î ÁÖ¼¹öÆÄÀÏ¿¡ Á¢±ÙÇÒ ¼ö ¾ø´Â °æ¿ì°¡ ¾Æ´Ï¶ó¸é + <code>.htaccess</code> ÆÄÀÏÀ» »ç¿ëÇÏ¸é ¾ÈµÈ´Ù. ¿¹¸¦ µé¾î, + »ç¿ëÀÚ ÀÎÁõÀÌ Ç×»ó <code>.htaccess</code> ÆÄÀÏ¿¡ ÀÖ¾î¾ß + ÇÑ´Ù´Â °ÍÀº À߸ø ¾Ë·ÁÁø ¿ÀÇØ´Ù. ÀÌ´Â »ç½ÇÀÌ ¾Æ´Ï´Ù. ÁÖ¼¹ö¼³Á¤¿¡ + »ç¿ëÀÚ ÀÎÁõ ¼³Á¤À» ÀûÀ» ¼ö ÀÖ°í, »ç½Ç ÀÌ·¯±æ ±ÇÇÑ´Ù.</p> + + <p><code>.htaccess</code> ÆÄÀÏÀº ÄÁÅÙÃ÷ Á¦°øÀÚ°¡ µð·ºÅ丮º°·Î + ¼¹ö ¼³Á¤À» ´Ù¸£°ÔÇÏ°í ½ÍÁö¸¸ ¼¹ö ½Ã½ºÅÛ¿¡ root ±ÇÇÑÀÌ + ¾ø´Â °æ¿ì¿¡ »ç¿ëÇÑ´Ù. ¼¹ö °ü¸®ÀÚ°¡ ¼³Á¤À» ÀÚÁÖ º¯°æÇÏ°í + ½ÍÁö ¾ÊÀº °æ¿ì ÀÏ¹Ý »ç¿ëÀÚ°¡ Á÷Á¢ <code>.htaccess</code> + ÆÄÀÏÀ» ¼öÁ¤Çϵµ·Ï Çã¿ëÇÏ´Â °ÍÀÌ ¹Ù¶÷Á÷ÇÏ´Ù. ¿¹¸¦ µé¾î, ÇÑ + ÄÄÇ»ÅÍ¿¡ ¿©·¯ »ç¿ëÀÚ »çÀÌÆ®¸¦ ¼ºñ½ºÇÏ´Â ISP¿¡¼ »ç¿ëÀÚ°¡ + ÀÚ½ÅÀÇ ¼³Á¤À» º¯°æÇÏ°í ½ÍÀº °æ¿ì°¡ ±×·¯ÇÏ´Ù.</p> + + <p>±×·¯³ª ÀϹÝÀûÀ¸·Î <code>.htaccess</code> ÆÄÀÏÀº °¡±ÞÀû + ÇÇÇØ¾ß ÇÑ´Ù. <code>.htaccess</code> ÆÄÀÏ¿¡¼ Çã¿ëÇÏ´Â Áö½Ã¾î´Â + ÁÖ¼³Á¤ÆÄÀÏÀÇ <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> ¼½¼Ç°ú °°Àº È¿°ú°¡ + ÀÖ´Ù.</p> + + <p>´ÙÀ½ µÎ°¡Áö Å« ÀÌÀ¯¶§¹®¿¡ <code>.htaccess</code> ÆÄÀÏ + »ç¿ëÀ» ÇÇÇØ¾ß ÇÑ´Ù.</p> + + <p>ù¹ø°´Â ¼º´ÉÀÌ´Ù. <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>°¡ <code>.htaccess</code> + ÆÄÀÏÀ» »ç¿ëÇϵµ·Ï Çã¿ëÇϸé, ¾ÆÆÄÄ¡´Â µð·ºÅ丮¸¶´Ù + <code>.htaccess</code> ÆÄÀÏÀ» ã´Â´Ù. ±×·¡¼ + <code>.htaccess</code> ÆÄÀÏÀ» Çã¿ëÇÏ¸é ½ÇÁ¦·Î ÆÄÀÏÀ» »ç¿ëÇÏÁö + ¾Ê´Â °æ¿ì¿¡µµ ¼º´ÉÀÌ ¶³¾îÁø´Ù! ¶Ç, <code>.htaccess</code> + ÆÄÀÏÀº ¹®¼¸¦ ¿äûÇÒ¶§¸¶´Ù ÀоîµéÀδÙ.</p> + + <p>°Ô´Ù°¡ Àû¿ëÇØ¾ß ÇÏ´Â Àüü Áö½Ã¾î¸¦ ¸ðÀ¸±âÀ§ÇØ ¾ÆÆÄÄ¡´Â + ¸ðµç »óÀ§ µð·ºÅ丮¿¡¼ <code>.htaccess</code> ÆÄÀÏÀ» ã´Â´Ù. + (<a href="#how">¾î¶»°Ô Áö½Ã¾î¸¦ Àû¿ëÇϳª</a> ÀýÀ» Âü°í.) + ±×·¡¼ <code>/www/htdocs/example</code> µð·ºÅ丮¿¡ ÀÖ´Â + ÆÄÀÏÀ» ¿äûÇϸé, ¾ÆÆÄÄ¡´Â ´ÙÀ½ ÆÄÀϵéÀ» ã¾Æ¾ß ÇÑ´Ù.</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/example/.htaccess + </code></p></div> + + <p>±×·¡¼ ±× µð·ºÅ丮¿¡ ÀÖ´Â ÆÄÀÏÀ» Á¢±ÙÇÒ ¶§¸¶´Ù ¼³Á¤ÆÄÀÏÀÌ + ÀüÇô ¾ø¾îµµ ÆÄÀϽýºÅÛÀ» 4¹ø ´õ Á¢±ÙÇØ¾ß ÇÑ´Ù. + (<code>/</code>¿¡¼µµ <code>.htaccess</code> ÆÄÀÏÀ» Çã¿ëÇÑ + °æ¿ì¸¦ ¸»ÇÑ´Ù. º¸ÅëÀº Çã¿ëÇÏÁö ¾Ê´Â´Ù.)</p> + + <p>µÎ¹ø° ÀÌÀ¯´Â º¸¾ÈÀÌ´Ù. »ç¿ëÀÚ¿¡°Ô ¼¹ö¼³Á¤ º¯°æ ±ÇÇÑÀ» + ÁÖ¸é ´ç½ÅÀÌ °¨´çÇÒ ¼ö ¾ø´Â º¯È°¡ ÀϾ ¼ö ÀÖ´Ù. »ç¿ëÀÚ¿¡°Ô + ÀÌ·± ±ÇÇÑÀ» ÁÙÁö °õ°õÀÌ »ý°¢Ç϶ó. ¶Ç, »ç¿ëÀÚ°¡ ¿øÇÏ´Â °Íº¸´Ù + ÀûÀº ±ÇÇÑÀ» ÁÖ¸é ±â¼úÁö¿ø¿äûÀÌ µé¾î¿Â´Ù. »ç¿ëÀÚ¿¡°Ô °¡´ÉÇÑ + ±ÇÇÑ ¼öÁØÀ» ¸íÈ®È÷ ¾Ë·Á¶ó. »ç¿ëÀÚ¿¡°Ô <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>¸¦ ¾î¶»°Ô ¼³Á¤ÇÏ¿´´ÂÁö + Á¤È®È÷ ¾Ë¸®°í °ü·Ã ¹®¼¸¦ Á¦°øÇÏ¸é ¾ÕÀ¸·Î È¥¶õÀ» ÇÇÇÒ ¼ö + ÀÖ´Ù.</p> + + <p>Áö½Ã¾î¸¦ <code>/www/htdocs/example</code> µð·ºÅ丮ÀÇ + <code>.htaccess</code> ÆÄÀÏÀ» µÎ´Â °Í°ú ÁÖ¼¹ö¼³Á¤ÀÇ + <code><Directory /www/htdocs/example></code> Directory + ¼³Á¤¿¡ µÎ´Â °ÍÀº ¿ÏÀüÈ÷ °°´Ù.</p> + + <p><code>/www/htdocs/example</code>¿¡ ÀÖ´Â + <code>.htaccess</code> ¼½¼Ç:</p> + + <div class="example"><h3><code>/www/htdocs/example</code>¿¡ ÀÖ´Â + .htaccess ÆÄÀÏ ³»¿ë</h3><p><code> + AddType text/example .exm + </code></p></div> + + <div class="example"><h3><code>httpd.conf</code> ÆÄÀÏ¿¡ ÀÖ´Â ¼½¼Ç</h3><p><code> + <Directory /www/htdocs/example><br /> + <span class="indent"> + AddType text/example .exm<br /> + </span> + </Directory> + </code></p></div> + + <p>±×·¯³ª ÆÄÀÏÀ» ¿äûÇÒ ¶§¸¶´Ù ¼³Á¤À» ÀÐÁö¾Ê°í ¾ÆÆÄÄ¡°¡ + ½ÃÀÛÇÒ¶§ Çѹø¸¸ ¼³Á¤À» Àб⶧¹®¿¡ °°Àº ¼³Á¤À» ¼¹ö¼³Á¤ÆÄÀÏ¿¡ + »ç¿ëÇÏ¸é ¼º´ÉÀÌ ´õ ºü¸£´Ù.</p> + + <p><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> Áö½Ã¾î¸¦ + <code>none</code>À¸·Î ¼³Á¤Çϸé <code>.htaccess</code> ÆÄÀÏÀ» + ¿ÏÀüÈ÷ »ç¿ëÇÒ ¼ö ¾ø´Ù.</p> + + <div class="example"><p><code> + AllowOverride None + </code></p></div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">¾î¶»°Ô Áö½Ã¾î¸¦ Àû¿ëÇϳª</a></h2> + + <p><code>.htaccess</code> ÆÄÀÏÀ» ¹ß°ßÇÑ µð·ºÅ丮¿Í ±× µð·ºÅ丮ÀÇ + ¸ðµç ÇÏÀ§µð·ºÅ丮¿¡ <code>.htaccess</code> ÆÄÀÏ¿¡ ÀÖ´Â ¼³Á¤ + Áö½Ã¾î¸¦ Àû¿ëÇÑ´Ù. ±×·¡¼ »óÀ§µð·ºÅ丮ÀÇ <code>.htaccess</code> + ÆÄÀÏÀ» ÁÖÀÇÇØ¾ß ÇÑ´Ù. ¹ß°ßÇÑ ¼ø¼·Î Áö½Ã¾î¸¦ Àû¿ëÇÑ´Ù. ƯÁ¤ + µð·ºÅ丮¿¡ ÀÖ´Â <code>.htaccess</code> ÆÄÀÏÀº »óÀ§µð·ºÅ丮¿¡ + ÀÖ´Â <code>.htaccess</code> ÆÄÀÏÀÇ Áö½Ã¾î¸¦ ¹«È¿·Î ¸¸µé + ¼ö ÀÖ°í, »óÀ§µð·ºÅ丮¿¡ ÀÖ´Â Áö½Ã¾î´Â ´õ »óÀ§µð·ºÅ丮 ȤÀº + ÁÖ¼³Á¤ÆÄÀÏ¿¡ ÀÖ´Â Áö½Ã¾î¸¦ ¹«È¿·Î ¸¸µé ¼ö ÀÖ´Ù.</p> + + <p>¿¹Á¦:</p> + + <p><code>/www/htdocs/example1</code> µð·ºÅ丮¿¡ ´ÙÀ½°ú °°Àº + <code>.htaccess</code> ÆÄÀÏÀÌ ÀÖ´Ù.</p> + + <div class="example"><p><code> + Options +ExecCGI + </code></p></div> + + <p>(ÁÖÀÇ: <code>.htaccess</code> ÆÄÀÏ¿¡ "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" Áö½Ã¾î¸¦ »ç¿ëÇÏ·Á¸é + "<code>AllowOverride Options</code>"°¡ ÇÊ¿äÇÏ´Ù.)</p> + + <p><code>/www/htdocs/example1/example2</code> µð·ºÅ丮¿¡´Â + ´ÙÀ½°ú °°Àº <code>.htaccess</code> ÆÄÀÏÀÌ ÀÖ´Ù.</p> + + <div class="example"><p><code> + Options Includes + </code></p></div> + + <p>ÀÌ µÎ¹ø° <code>.htaccess</code> ÆÄÀÏÀÇ + <code>Options Includes</code>°¡ ÀÌÀü ¼³Á¤À» ¿ÏÀüÈ÷ ¹«È¿·Î + ¸¸µé±â¶§¹®¿¡ <code>/www/htdocs/example1/example2</code> + µð·ºÅ丮´Â CGI ½ÇÇàÀ» Çã¿ëÇÏÁö ¾Ê´Â´Ù.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">ÀÎÁõ ¿¹Á¦</a></h2> + + <p>ÀÎÁõ ¹æ¹ýÀ» ¾Ë±âÀ§ÇØ ¹Ù·Î ÀÌ°÷ºÎÅÍ Àд´ٸé ÁÖÀÇÇÒ °ÍÀÌ + ÀÖ´Ù. ¾ÏÈ£ ÀÎÁõÀ» ÇÏ·Á¸é <code>.htaccess</code> ÆÄÀÏÀÌ + ÇÊ¿äÇÏ´Ù´Â ¿ÀÇØ°¡ ³Î¸® ÆÛÁ®ÀÖ´Ù. ÀÌ´Â »ç½ÇÀÌ ¾Æ´Ï´Ù. + ÁÖ¼³Á¤ÆÄÀÏÀÇ <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> ¼½¼Ç¿¡ ÀÎÁõ Áö½Ã¾î¸¦ + µÎ´Â °ÍÀÌ ´õ ±ÇÀåÇÏ´Â ¹æ¹ýÀÌ°í, ¼¹öÀÇ ÁÖ¼³Á¤ÆÄÀÏÀ» ¼öÁ¤ÇÒ + ¼ö ¾ø´Â °æ¿ì¿¡¸¸ <code>.htaccess</code> ÆÄÀÏÀ» »ç¿ëÇØ¾ß + ÇÑ´Ù. ¾ðÁ¦ <code>.htaccess</code> ÆÄÀÏÀ» »ç¿ëÇØ¾ß ÇÏ´ÂÁö¿Í + »ç¿ëÇÏÁö ¸»¾Æ¾ß ÇÏ´ÂÁö´Â <a href="#when">À§¿¡¼</a> + ¼³¸íÇÏ¿´´Ù.</p> + + <p>¾Õ¿¡¼ ¸»ÇßÁö¸¸ ¾ÆÁ÷µµ <code>.htaccess</code> ÆÄÀÏÀÌ + ÇÊ¿äÇÏ´Ù°í »ý°¢µÇ¸é ¾Æ·¡ ¼³Á¤ÀÌ µµ¿òÀÌ µÉ °ÍÀÌ´Ù.</p> + + <p><code>.htaccess</code> ÆÄÀÏ ³»¿ë.</p> + + <div class="example"><p><code> + AuthType Basic<br /> + AuthName "Password Required"<br /> + AuthUserFile /www/passwords/password.file<br /> + AuthGroupFile /www/passwords/group.file<br /> + Require Group admins + </code></p></div> + + <p>ÀÌ Áö½Ã¾î°¡ µ¿ÀÛÇϱâÀ§Çؼ´Â + <code>AllowOverride AuthConfig</code> Áö½Ã¾î°¡ ÇÊ¿äÇÔÀ» + ¸í½ÉÇ϶ó.</p> + + <p>ÀÎÁõ°ú ±ÇÇѺο©¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº <a href="auth.html">ÀÎÁõ + ÅõÅ丮¾ó</a>À» º¸±æ ¹Ù¶õ´Ù.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">Server Side Includes ¿¹Á¦</a></h2> + + <p>¶Ç´Ù¸¥ ÀϹÝÀûÀÎ <code>.htaccess</code> ÆÄÀÏÀÇ ¿ëµµ´Â + ƯÁ¤ µð·ºÅ丮¿¡¼ Server Side Includes¸¦ °¡´ÉÇÏ°Ô ¸¸µå´Â + °ÍÀÌ´Ù. ¿øÇÏ´Â µð·ºÅ丮ÀÇ <code>.htaccess</code> ÆÄÀÏ¿¡ + ´ÙÀ½°ú °°Àº ¼³Á¤ Áö½Ã¾î¸¦ »ç¿ëÇÏ¸é µÈ´Ù.</p> + + <div class="example"><p><code> + Options +Includes<br /> + AddType text/html shtml<br /> + AddHandler server-parsed shtml + </code></p></div> + + <p>ÀÌ Áö½Ã¾î°¡ µ¿ÀÛÇÏ·Á¸é <code>AllowOverride Options</code>¿Í + <code>AllowOverride FileInfo</code>°¡ ¸ðµÎ ÇÊ¿äÇÔÀ» ¸í½ÉÇ϶ó.</p> + + <p>server-side includes¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº <a href="ssi.html">SSI ÅõÅ丮¾ó</a>À» º¸±æ ¹Ù¶õ´Ù.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">CGI ¿¹Á¦</a></h2> + + <p>¸¶Áö¸·À¸·Î <code>.htaccess</code> ÆÄÀÏÀ» »ç¿ëÇÏ¿© ƯÁ¤ + µð·ºÅ丮¿¡¼ CGI ÇÁ·Î±×·¥ ½ÇÇàÀ» Çã¿ëÇÏ°í ½Í´Ù¸é, ´ÙÀ½°ú + °°Àº ¼³Á¤À» »ç¿ëÇÑ´Ù.</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + AddHandler cgi-script cgi pl + </code></p></div> + + <p>ȤÀº ÀÌ µð·ºÅ丮¿¡ ÀÖ´Â ¸ðµç ÆÄÀÏÀ» CGI ÇÁ·Î±×·¥À¸·Î + ó¸®ÇÏ°í ½Í´Ù¸é ´ÙÀ½°ú °°Àº ¼³Á¤µµ °¡´ÉÇÏ´Ù.</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + SetHandler cgi-script + </code></p></div> + + <p>ÀÌ Áö½Ã¾î°¡ µ¿ÀÛÇÏ·Á¸é <code>AllowOverride Options</code>¿Í + <code>AllowOverride FileInfo</code>°¡ ¸ðµÎ ÇÊ¿äÇÔÀ» ¸í½ÉÇ϶ó.</p> + + <p>CGI ÇÁ·Î±×·¡¹Ö°ú ¼³Á¤¿¡ ´ëÇÑ ÀÚ¼¼ÇÑ ¼³¸íÀº <a href="cgi.html">CGI ÅõÅ丮¾ó</a>À» º¸±æ ¹Ù¶õ´Ù.</p> + +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">¹®Á¦ÇØ°á</a></h2> + + <p><code>.htaccess</code> ÆÄÀÏ¿¡ µÐ ¼³Á¤ Áö½Ã¾î°¡ ¿øÇÏ´Â + ±â´ÉÀ» ÇÏÁö ¾Ê´Â °æ¿ì ¿©·¯°¡Áö ÀÌÀ¯°¡ ÀÖÀ» ¼ö ÀÖ´Ù.</p> + + <p>°¡Àå ÀϹÝÀûÀÎ ¹®Á¦´Â ¼³Á¤ Áö½Ã¾î¸¦ °¡´ÉÇÏ°Ô ¸¸µå´Â <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>¸¦ ¼³Á¤ÇÏÁö ¾ÊÀº + °æ¿ì´Ù. ¹®Á¦°¡ µÇ´Â ÆÄÀÏ ¿µ¿ª¿¡ <code>AllowOverride None</code>ÀÌ + ¾ø´ÂÁö È®ÀÎÇÑ´Ù. <code>.htaccess</code> ÆÄÀÏÀ» ¾Æ¹«·¸°Ô³ª + ÀûÀº ´ÙÀ½ ÆäÀÌÁö¸¦ ´Ù½Ã Á¢±ÙÇÏ¿© ½±°Ô °Ë»çÇغ¼ ¼ö ÀÖ´Ù. + ¼¹ö ¿À·ù°¡ ³ª¿ÀÁö ¾ÊÀ¸¸é °ÅÀÇ È®½ÇÈ÷ + <code>AllowOverride None</code>À» »ç¿ëÇÑ °æ¿ì´Ù.</p> + + <p>¹Ý´ë·Î ¹®¼¿¡ Á¢±ÙÇÒ¶§ ¼¹ö ¿À·ù°¡ ¹ß»ýÇÏ¸é ¾ÆÆÄÄ¡ ¿À·ù·Î±×¸¦ + »ìÆìºÁ¶ó. ¾Æ¸¶µµ <code>.htaccess</code> ÆÄÀÏ¿¡ ÀÖ´Â Áö½Ã¾î¸¦ + Çã¿ëÇÏÁö ¾Ê´Â´Ù°í ÇÒ °ÍÀÌ´Ù. ¾Æ´Ï°í ¹®¹ý ¿À·ù°¡ ÀÖ´Ù¸é ¿À·ù¸¦ + °íÄ£´Ù.</p> + +</div></div> +<div class="bottomlang"> +<p><span>°¡´ÉÇÑ ¾ð¾î: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" hreflang="pt-br" rel="alternate" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">¸ðµâ</a> | <a href="../mod/directives.html">Áö½Ã¾îµé</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">¿ë¾î</a> | <a href="../sitemap.html">»çÀÌÆ®¸Ê</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file diff --git a/docs/manual/howto/htaccess.html.pt-br b/docs/manual/howto/htaccess.html.pt-br new file mode 100644 index 0000000..873becd --- /dev/null +++ b/docs/manual/howto/htaccess.html.pt-br @@ -0,0 +1,407 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-br" xml:lang="pt-br"><head> +<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" /> +<!-- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + This file is generated from xml source: DO NOT EDIT + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + --> +<title>Tutorial do Apache: arquivos .htaccess - Servidor HTTP Apache Versão 2.4</title> +<link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> +<link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> +<link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> +</script> + +<link href="../images/favicon.ico" rel="shortcut icon" /></head> +<body id="manual-page"><div id="page-header"> +<p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Diretrizes</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossário</a> | <a href="../sitemap.html">Mapa do site</a></p> +<p class="apache">Servidor HTTP Apache Versão 2.4</p> +<img alt="" src="../images/feather.png" /></div> +<div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div> +<div id="path"> +<a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">Servidor HTTP</a> > <a href="http://httpd.apache.org/docs/">Documentação</a> > <a href="../">Versão 2.4</a> > <a href="./">How-To / Tutoriais</a></div><div id="page-content"><div id="preamble"><h1>Tutorial do Apache: arquivos .htaccess</h1> +<div class="toplang"> +<p><span>Línguas Disponíveis: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" title="Português (Brasil)"> pt-br </a></p> +</div> +<div class="outofdate">Esta tradução pode estar desatualizada. + Confira a versão em Inglês para mudanças recentes.</div> + +<p>Arquivos <code>.htaccess</code> oferecem um meio de fazer mudanças + nas configurações por-diretório.</p> +</div> +<div id="quickview"><a href="https://www.apache.org/foundation/contributing.html" class="badge"><img src="https://www.apache.org/images/SupportApache-small.png" alt="Support Apache!" /></a><ul id="toc"><li><img alt="" src="../images/down.gif" /> <a href="#related">Arquivos .htaccess </a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#what">O que eles são/Como usá-los</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#when">Quando (não) usar arquivos .htaccess</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#how">Como as diretrizes são aplicadas</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#auth">Exemplo de Autenticação</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#ssi">Exemplo de Server Side Includes</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#cgi">Exemplo de CGI</a></li> +<li><img alt="" src="../images/down.gif" /> <a href="#troubleshoot">Resolvendo Problemas</a></li> +</ul><h3>Veja também</h3><ul class="seealso"><li><a href="#comments_section">Comentários</a></li></ul></div> +<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="related" id="related">Arquivos .htaccess </a></h2> + <table class="related"><tr><th>Módulos Relacionados</th><th>Diretrizes Relacionadas</th></tr><tr><td><ul><li><code class="module"><a href="../mod/core.html">core</a></code></li><li><code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code></li><li><code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code></li><li><code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code></li><li><code class="module"><a href="../mod/mod_include.html">mod_include</a></code></li><li><code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code></li></ul></td><td><ul><li><code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code></li><li><code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code></li><li><code class="directive"><a href="../mod/core.html#options">Options</a></code></li><li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li><li><code class="directive"><a href="../mod/core.html#sethandler">SetHandler</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authtype">AuthType</a></code></li><li><code class="directive"><a href="../mod/mod_authn_core.html#authname">AuthName</a></code></li><li><code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code></li><li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li></ul></td></tr></table> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="what" id="what">O que eles são/Como usá-los</a></h2> + + + <p>Os arquivos <code>.htaccess</code> (ou "arquivos de + configuração distribuída") oferecem um meio de fazer mudanças nas + configurações por-diretório. Um arquivo, contendo uma ou mais + diretrizes de configurações, é colocado em um diretório + em particular, e as diretrizes se aplicam para aquele diretório e todos + os seu subdiretórios subseqüentes.</p> + + <div class="note"><h3>Nota:</h3> + <p>Se você quiser renomear o seu arquivo <code>.htaccess</code> + para outro nome, você deve usar a diretriz <code class="directive"><a href="../mod/core.html#accessfilename">AccessFileName</a></code>. Por exemplo, se você + prefere que o arquivo se chame <code>.config</code>, então você + pode adicionar a seguinte linha ao seu arquivo de configuração + do servidor:</p> + + <div class="example"><p><code> + AccessFileName .config + </code></p></div> + </div> + + <p>No geral, arquivos <code>.htaccess</code> usam a mesma sintaxe + que os <a href="../configuring.html#syntax">arquivos de + configuração principal</a>. O que você pode colocar nesses + arquivos é determinado pele diretriz <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>. Essa diretriz especifica, + em categorias, quais diretrizes serão aceitas caso sejam + encontradas em um arquivo <code>.htaccess</code>. Se uma diretriz + for permitida em um arquivo <code>.htaccess</code>, a documentação + para essa diretriz irá conter uma seção <em>Override</em>, + especificando que valor precisa estar em <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> para que esta diretriz + seja permitida.</p> + + <p>Por exemplo, se você procurar na documentação pela diretriz + <code class="directive"><a href="../mod/core.html#adddefaultcharset">AddDefaultCharset</a></code>, você + achará que ela é permitida nos arquivos <code>.htaccess</code>. + (Veja a linha Contexto no sumário das diretivas.) A + linha <a href="../mod/directive-dict.html#Context">Override</a> lê + <code>FileInfo</code>. Então, você deve ao menos ter + <code>AllowOverride FileInfo</code> para que essa diretriz seja + aceita nos arquivos <code>.htaccess</code>.</p> + + <div class="example"><h3>Exemplo:</h3><table> + <tr> + <td><a href="../mod/directive-dict.html#Context">Contexto:</a></td> + <td>configuração do servidor, hospedeiros virtuais, diretório, .htaccess</td> + </tr> + + <tr> + <td><a href="../mod/directive-dict.html#Override">Override:</a></td> + <td>FileInfo</td> + </tr> + </table></div> + + <p>Se você estiver incerto se uma diretriz em particular é + aceita em um arquivo <code>.htaccess</code>, procure na + documentação por essa diretriz, e verifique a linha de + Contexto por ".htaccess".</p> </div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="when" id="when">Quando (não) usar arquivos .htaccess</a></h2> + + <p>No geral, você nunca deve usar arquivos <code>.htaccess</code> + a não ser que você não tenha acesso ao arquivo de configuração + principal do servidor. Existe, por exemplo, um erro de concepção + que dita que a autenticação de usuários sempre deve + ser feita usando os arquivos <code>.htaccess</code>. Esse + simplesmente não é o caso. Você pode usar as configurações de + autenticação de usuário no arquivo de configuração principal do + servidor, e isso é, de fato, a maneira mais adequada de se fazer + as coisas.</p> + + <p>Arquivos <code>.htaccess</code> devem ser usados em casos onde + os provedores de conteúdo do site precisem fazer mudanças na + configuração do servidor por-diretório, mas não tem + acesso <em>root</em> ao sistema do servidor. Caso o administrador do + servidor não esteja disposto a fazer mudanças freqüentes nas + configurações do servidor, é desejável permitir que os + usuários possam fazer essas mudanças através de arquivos + <code>.htaccess</code> eles mesmos. Isso é particularmente + verdade, por exemplo, em casos onde provedores estão fornecendo + múltiplos sites para usuários em apenas uma máquina, e querem que + seus usuários possam alterar suas configurações.</p> + + <p>No entanto, de modo geral, o uso de arquivos <code>.htaccess</code> + deve ser evitado quando possível. Quaisquer configurações + que você considerar acrescentar em um arquivo <code>.htaccess</code>, podem + ser efetivamente colocadas em uma seção <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code> no arquivo principal de + configuração de seu servidor.</p> + + <p>Existem duas razões principais para evitar o uso de arquivos + <code>.htaccess</code>.</p> + + <p>A primeira delas é a performance. Quando <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> é configurado para + permitir o uso de arquivos <code>.htaccess</code>, o Apache procura + em todos diretórios por arquivos <code>.htaccess</code>. + Logo, permitir arquivos <code>.htaccess</code> causa um impacto na + performance, mesmo sem você usá-los de fato! Além disso, + o arquivo <code>.htaccess</code> é carregado toda vez que um documento + é requerido.</p> + + <p>Além disso, note que o Apache precisa procurar pelos arquivos + <code>.htaccess</code> em todos os diretórios superiores, para ter + o complemento total de todas as diretivas que devem ser + aplicadas. (Veja a seção <a href="#how">como as diretrizes são + aplicadas</a>.) Então, se um arquivo de um diretório + <code>/www/htdocs/example</code> é requerido, o Apache precisa + procurar pelos seguintes arquivos:</p> + + <div class="example"><p><code> + /.htaccess<br /> + /www/.htaccess<br /> + /www/htdocs/.htaccess<br /> + /www/htdocs/example/.htaccess + </code></p></div> + + <p>Assim, para cada acesso de arquivo fora desse diretório, + existem 4 acessos ao sistema de arquivos adicionais, mesmo + que nenhum desses arquivos estejam presentes. (Note que esse + só será o caso se os arquivos <code>.htaccess</code> + estiverem habilitados para <code>/</code>, o que + normalmente não é o verdade.)</p> + + <p>A segunda consideração é relativa à segurança. + Você está permitindo que os usuários modifiquem as + configurações do servidor, o que pode resultar em mudanças + que podem fugir ao seu controle. Considere com cuidado se você quer + ou não dar aos seus usuários esses privilégios. Note também + que dar aos usuários menos privilégios que eles precisam, acarreta em + pedidos de suporte técnico adicionais. Tenha certeza que você comunicou + aos usuários que nível de privilégios você os deu. + Especificar exatamente o que você configurou na diretriz <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code>, e direcioná-los para a + documentação relevante, irá poupá-lo de muita confusão + depois.</p> + + <p>Perceba que é exatamente equivalente colocar o arquivo + <code>.htaccess</code> em um diretório + <code>/www/htdocs/example</code> contendo uma diretriz, e + adicionar a mesma diretriz em uma seção <em>Directory</em> + <code><Directory /www/htdocs/example></code> na configuração + principal do seu servidor:</p> + + <p>Arquivo <code>.htaccess</code> em <code>/www/htdocs/example</code>:</p> + + <div class="example"><h3>Conteúdo de um arquivo .htaccess em + <code>/www/htdocs/example</code></h3><p><code> + AddType text/example .exm + </code></p></div> + + <div class="example"><h3>Seção do seu arquivo <code>httpd.conf</code></h3><p><code> + <Directory /www/htdocs/example><br /> + <span class="indent"> + AddType text/example .exm<br /> + </span> + </Directory> + </code></p></div> + + <p>No entanto, adicionando isso ao seu arquivo de configuração do + servidor resultará em uma menor perda de performance, na medida que + a configuração é carregada no momento da inicialização do + servidor, ao invés de toda que que um arquivo é requerido.</p> + + <p>O uso de arquivos <code>.htaccess</code> pode ser totalmente + desabilitado, ajustando a diretriz <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> para <code>none</code>:</p> + + <div class="example"><p><code> + AllowOverride None + </code></p></div> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="how" id="how">Como as diretrizes são aplicadas</a></h2> + + <p>As diretrizes de configuração que se encontram em um arquivo + <code>.htaccess</code> são aplicadas para o diretório no qual o + arquivo <code>.htaccess</code> se encontra, e para todos os + subdiretórios ali presentes. Mas, é importante lembrar também que + podem existir arquivos <code>.htaccess</code> no diretórios + superiores. As diretrizes são aplicadas na ordem que são + achadas. Logo, um arquivo <code>.htaccess</code> em um diretório + em particular, pode sobrescrever as diretrizes encontradas em um + diretório acima deste em sua respectiva árvore. Estes, por sua vez, + podem ter suas diretrizes sobrescritas por diretrizes ainda mais + acima, ou no próprio arquivo de configuração principal do + servidor.</p> + + <p>Exemplo:</p> + + <p>No diretório <code>/www/htdocs/example1</code> nós temos + um arquivo <code>.htaccess</code> contendo o seguinte:</p> + + <div class="example"><p><code> + Options +ExecCGI + </code></p></div> + + <p>(Nota: você deve ter "<code>AllowOverride Options</code>" para + permitir o uso da diretriz "<code class="directive"><a href="../mod/core.html#options">Options</a></code>" nos arquivos + <code>.htaccess</code> .)</p> + + <p>No diretório <code>/www/htdocs/example1/example2</code> nós temos + um arquivo <code>.htaccess</code> contendo:</p> + + <div class="example"><p><code> + Options Includes + </code></p></div> + + <p>Devido a esse segundo arquivo <code>.htaccess</code>, no + diretório <code>/www/htdocs/example1/example2</code>, a execução + de scripts CGI não é permitida, pois somente <code>Options + Includes</code> está em efeito, o que sobrescreve completamente + quaisquer outros ajustes previamente configurados.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="auth" id="auth">Exemplo de Autenticação</a></h2> + + <p>Se você veio diretamente à esta parte do documento para + aprender como fazer autenticação, é importante notar uma + coisa. Existe uma concepção errada, mas muito comum, de que é + necessário o uso de arquivos <code>.htaccess</code> para implementar + a autenticação por senha. Este não é o caso. Colocar + diretrizes de senha em uma seção <code class="directive"><a href="../mod/core.html#directory"><Directory></a></code>, no seu arquivo principal de + configuração do servidor, é a melhor maneira de se implementar + isto, e os arquivos <code>.htaccess</code> devem ser usados apenas + se você não tem acesso ao arquivo principal de configuração do + servidor. Veja <a href="#when">acima</a> a discussão sobre quando + você deve e quando não deve usar os arquivos + <code>.htaccess</code>.</p> + + <p>Dito isso, se você ainda acredita que precisa usar um arquivo + <code>.htaccess</code>, a configuração a seguir provavelmente + funcionará para você.</p> + + <p>Conteúdo de um arquivo <code>.htaccess</code>:</p> + + <div class="example"><p><code> + AuthType Basic<br /> + AuthName "Password Required"<br /> + AuthUserFile /www/passwords/password.file<br /> + AuthGroupFile /www/passwords/group.file<br /> + Require Group admins + </code></p></div> + + <p>Note que <code>AllowOverride AuthConfig</code> precisa estar + habilitado para que estas diretrizes tenham efeito.</p> + + <p>Por favor veja o <a href="auth.html">tutorial de + autenticação</a> para uma discussão mais completa sobre + autenticação e autorização.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="ssi" id="ssi">Exemplo de Server Side Includes</a></h2> + + <p>Outro uso comum de arquivos <code>.htaccess</code> é ativar o + Server Side Includes para um diretório em particular. Isto pode + ser feito com as seguintes diretrizes de configuração, colocadas em + um arquivo <code>.htaccess</code> no diretório desejado:</p> + + <div class="example"><p><code> + Options +Includes<br /> + AddType text/html shtml<br /> + AddHandler server-parsed shtml + </code></p></div> + + <p>Note que ambos <code>AllowOverride Options</code> e + <code>AllowOverride FileInfo</code> precisam estar habilitados + para essas diretrizes terem efeito.</p> + + <p>Por favor veja o <a href="ssi.html">tutorial de SSI</a> para + uma discussão mais completa sobre server-side includes.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="cgi" id="cgi">Exemplo de CGI</a></h2> + + <p>Finalmente, você pode querer que um arquivo + <code>.htaccess</code> permita a execução de programas CGI em um + diretório em particular. Isto pode ser implementado com as + seguintes configurações:</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + AddHandler cgi-script cgi pl + </code></p></div> + + <p>Alternativamente, se você desejar que todos os arquivos de um + dado diretório, sejam considerados programas CGI, isso pode ser + feito com a seguinte configuração:</p> + + <div class="example"><p><code> + Options +ExecCGI<br /> + SetHandler cgi-script + </code></p></div> + + <p>Note que ambos <code>AllowOverride Options</code> e + <code>AllowOverride FileInfo</code> precisam estar habilitados + para que essas diretrizes tenham quaisquer efeito.</p> + + <p>Por favor veja o <a href="cgi.html">tutorial de CGI + tutorial</a> para uma discussão mais completa sobre programação + e configuração CGI.</p> +</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div> +<div class="section"> +<h2><a name="troubleshoot" id="troubleshoot">Resolvendo Problemas</a></h2> + + <p>Quando você adiciona diretrizes de configuração em um arquivo + <code>.htaccess</code>, e não obtém o efeito desejado, existe uma + série de pontos que podem estar errados.</p> + + <p>Mais comumente, o problema é que a diretriz <code class="directive"><a href="../mod/core.html#allowoverride">AllowOverride</a></code> não está habilitada + corretamente para que as suas diretrizes de configurações sejam + honradas. Verifique se você não possui <code>AllowOverride + None</code> ajustado para o escopo do arquivo em questão. Um bom + meio de testar isso é colocar "lixo" em seu arquivo + <code>.htaccess</code> e recarregá-lo. Se não for gerado nenhum + erro do servidor, certamente você tem <code>AllowOverride + None</code> habilitado.</p> + + <p>Se, por outro lado, você está obtendo erros do servidor ao + tentar acessar documentos, verifique o registro de erros do + Apache. Ele provavelmente irá indicar que a diretriz usada em + seu arquivo <code>.htaccess</code> não é permitida. + Alternativamente, ele pode acusar erros de sintaxe que você terá + que corrigir.</p> + +</div></div> +<div class="bottomlang"> +<p><span>Línguas Disponíveis: </span><a href="../en/howto/htaccess.html" hreflang="en" rel="alternate" title="English"> en </a> | +<a href="../es/howto/htaccess.html" hreflang="es" rel="alternate" title="Español"> es </a> | +<a href="../fr/howto/htaccess.html" hreflang="fr" rel="alternate" title="Français"> fr </a> | +<a href="../ja/howto/htaccess.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a> | +<a href="../ko/howto/htaccess.html" hreflang="ko" rel="alternate" title="Korean"> ko </a> | +<a href="../pt-br/howto/htaccess.html" title="Português (Brasil)"> pt-br </a></p> +</div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comentários</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div> +<script type="text/javascript"><!--//--><![CDATA[//><!-- +var comments_shortname = 'httpd'; +var comments_identifier = 'http://httpd.apache.org/docs/2.4/howto/htaccess.html'; +(function(w, d) { + if (w.location.hostname.toLowerCase() == "httpd.apache.org") { + d.write('<div id="comments_thread"><\/div>'); + var s = d.createElement('script'); + s.type = 'text/javascript'; + s.async = true; + s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier; + (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); + } + else { + d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>'); + } +})(window, document); +//--><!]]></script></div><div id="footer"> +<p class="apache">Copyright 2019 The Apache Software Foundation.<br />Licenciado sob a <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="menu"><a href="../mod/">Módulos</a> | <a href="../mod/directives.html">Diretrizes</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossário</a> | <a href="../sitemap.html">Mapa do site</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- +if (typeof(prettyPrint) !== 'undefined') { + prettyPrint(); +} +//--><!]]></script> +</body></html>
\ No newline at end of file |