]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Translations for all languages, all files in the rewrite/ docs tree.
authorRich Bowen <rbowen@apache.org>
Tue, 28 Apr 2026 17:43:35 +0000 (17:43 +0000)
committerRich Bowen <rbowen@apache.org>
Tue, 28 Apr 2026 17:43:35 +0000 (17:43 +0000)
This translation was facilitated by AI tools.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933442 13f79535-47bb-0310-9956-ffa450edef68

88 files changed:
docs/manual/rewrite/access.xml.de [new file with mode: 0644]
docs/manual/rewrite/access.xml.es [new file with mode: 0644]
docs/manual/rewrite/access.xml.ja [new file with mode: 0644]
docs/manual/rewrite/access.xml.ko [new file with mode: 0644]
docs/manual/rewrite/access.xml.meta
docs/manual/rewrite/access.xml.tr [new file with mode: 0644]
docs/manual/rewrite/access.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.de [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.es [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.ja [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.ko [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.meta
docs/manual/rewrite/advanced.xml.tr [new file with mode: 0644]
docs/manual/rewrite/advanced.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.de [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.es [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.fr
docs/manual/rewrite/avoid.xml.ja [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.ko [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.meta
docs/manual/rewrite/avoid.xml.tr [new file with mode: 0644]
docs/manual/rewrite/avoid.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/flags.xml.de [new file with mode: 0644]
docs/manual/rewrite/flags.xml.es [new file with mode: 0644]
docs/manual/rewrite/flags.xml.ja [new file with mode: 0644]
docs/manual/rewrite/flags.xml.ko [new file with mode: 0644]
docs/manual/rewrite/flags.xml.meta
docs/manual/rewrite/flags.xml.tr [new file with mode: 0644]
docs/manual/rewrite/flags.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.de [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.es [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.ja [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.ko [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.meta
docs/manual/rewrite/htaccess.xml.tr [new file with mode: 0644]
docs/manual/rewrite/htaccess.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/index.xml.de [new file with mode: 0644]
docs/manual/rewrite/index.xml.es [new file with mode: 0644]
docs/manual/rewrite/index.xml.fr
docs/manual/rewrite/index.xml.ja [new file with mode: 0644]
docs/manual/rewrite/index.xml.ko [new file with mode: 0644]
docs/manual/rewrite/index.xml.meta
docs/manual/rewrite/index.xml.tr
docs/manual/rewrite/index.xml.zh-cn
docs/manual/rewrite/intro.xml.de [new file with mode: 0644]
docs/manual/rewrite/intro.xml.es [new file with mode: 0644]
docs/manual/rewrite/intro.xml.fr
docs/manual/rewrite/intro.xml.ja [new file with mode: 0644]
docs/manual/rewrite/intro.xml.ko [new file with mode: 0644]
docs/manual/rewrite/intro.xml.meta
docs/manual/rewrite/intro.xml.tr [new file with mode: 0644]
docs/manual/rewrite/intro.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.de [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.es [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.ja [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.ko [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.meta
docs/manual/rewrite/proxy.xml.tr [new file with mode: 0644]
docs/manual/rewrite/proxy.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.de [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.es [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.ja [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.ko [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.meta
docs/manual/rewrite/remapping.xml.tr [new file with mode: 0644]
docs/manual/rewrite/remapping.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.de [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.es [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.ja [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.ko [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.meta
docs/manual/rewrite/rewritemap.xml.tr [new file with mode: 0644]
docs/manual/rewrite/rewritemap.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/tech.xml.de [new file with mode: 0644]
docs/manual/rewrite/tech.xml.es [new file with mode: 0644]
docs/manual/rewrite/tech.xml.fr
docs/manual/rewrite/tech.xml.ja [new file with mode: 0644]
docs/manual/rewrite/tech.xml.ko [new file with mode: 0644]
docs/manual/rewrite/tech.xml.meta
docs/manual/rewrite/tech.xml.tr [new file with mode: 0644]
docs/manual/rewrite/tech.xml.zh-cn [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.de [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.es [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.ja [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.ko [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.meta
docs/manual/rewrite/vhosts.xml.tr [new file with mode: 0644]
docs/manual/rewrite/vhosts.xml.zh-cn [new file with mode: 0644]

diff --git a/docs/manual/rewrite/access.xml.de b/docs/manual/rewrite/access.xml.de
new file mode 100644 (file)
index 0000000..691589f
--- /dev/null
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Zugriffskontrolle mit mod_rewrite</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt,
+wie Sie <module>mod_rewrite</module> zur Zugriffskontrolle auf
+verschiedene Ressourcen verwenden können, sowie weitere verwandte Techniken.
+Dies beinhaltet viele Beispiele für gängige Verwendungen von <module>mod_rewrite</module>,
+einschließlich detaillierter Beschreibungen, wie jedes einzelne funktioniert.</p>
+
+<note type="warning">Beachten Sie, dass viele dieser Beispiele nicht unverändert in Ihrer
+speziellen Serverkonfiguration funktionieren werden. Es ist daher wichtig, dass Sie
+sie verstehen, anstatt die Beispiele einfach auszuschneiden und in Ihre
+Konfiguration einzufügen.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<!-- <seealso><a href="access.html">Zugriffskontrolle</a></seealso> -->
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>Verhindern von Bild-&quot;Hotlinking&quot;</title>
+
+      <dl>
+        <dt>Beschreibung:</dt>
+
+        <dd>
+          <p>Die folgende Technik verhindert die Praxis, dass andere Websites
+          Ihre Bilder direkt in ihre Seiten einbinden. Diese Praxis wird
+          oft als &quot;Hotlinking&quot; bezeichnet und führt dazu,
+          dass Ihre Bandbreite verwendet wird, um Inhalte für die Website
+          einer anderen Person bereitzustellen.</p>
+        </dd>
+
+        <dt>Lösung:</dt>
+
+        <dd>
+          <p>Diese Technik beruht auf dem Wert der
+          <code>HTTP_REFERER</code>-Variable, die optional ist. Daher
+          ist es möglich, dass einige Personen diese Einschränkung
+          umgehen. Die meisten Benutzer werden jedoch die fehlgeschlagene
+          Anfrage bemerken, was im Laufe der Zeit dazu führen sollte,
+          dass das Bild von der anderen Website entfernt wird.</p>
+          <p>Es gibt mehrere Möglichkeiten, mit dieser Situation
+          umzugehen.</p>
+
+    <p>Im ersten Beispiel verweigern wir die Anfrage einfach, wenn sie nicht
+    von einer Seite unserer Website stammt. Für dieses Beispiel nehmen wir
+    an, dass unsere Website <code>www.example.com</code> ist.</p>
+
+<!-- TODO: Diskussion hinzufügen, warum wir !^$ dort haben. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>Im zweiten Beispiel zeigen wir statt einer fehlgeschlagenen Anfrage
+    ein alternatives Bild an.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>Im dritten Beispiel leiten wir die Anfrage auf ein Bild auf einer
+    anderen Website um.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>Von diesen Techniken sind die letzten beiden am effektivsten,
+    um Personen davon abzuhalten, Ihre Bilder per Hotlink einzubinden,
+    da sie einfach nicht das Bild sehen werden, das sie erwartet haben.</p>
+
+        </dd>
+
+        <dt>Diskussion:</dt>
+
+        <dd>
+        <p>Wenn Sie lediglich den Zugriff auf die Ressource verweigern möchten,
+        anstatt die Anfrage woanders umzuleiten, kann dies ohne die
+        Verwendung von <module>mod_rewrite</module> erreicht werden:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>Blockieren von Robots</title>
+
+      <dl>
+        <dt>Beschreibung:</dt>
+
+        <dd>
+        <p>
+        In diesem Rezept besprechen wir, wie man hartnäckige Anfragen von
+        einem bestimmten Robot oder User-Agent blockiert.</p>
+
+        <p>Der Standard für den Ausschluss von Robots definiert eine Datei,
+        <code>/robots.txt</code>, die die Bereiche Ihrer Website festlegt,
+        von denen Sie Robots ausschließen möchten. Einige Robots halten sich
+        jedoch nicht an diese Dateien.
+        </p>
+
+        <p>Beachten Sie, dass es Methoden gibt, dies ohne die Verwendung
+        von <module>mod_rewrite</module> zu erreichen. Beachten Sie auch, dass jede Technik, die auf
+        dem <code>USER_AGENT</code>-String des Clients basiert, sehr leicht
+        umgangen werden kann, da dieser String geändert werden kann.</p>
+        </dd>
+
+        <dt>Lösung:</dt>
+
+        <dd>
+        <p>Wir verwenden einen Regelsatz, der das zu schützende Verzeichnis
+        und den Client-<code>USER_AGENT</code> angibt, der den bösartigen
+        oder hartnäckigen Robot identifiziert.</p>
+
+        <p>In diesem Beispiel blockieren wir einen Robot namens
+        <code>NameOfBadRobot</code> vom Standort
+        <code>/secret/files</code>. Sie können auch einen IP-Adressbereich
+        angeben, wenn Sie den User-Agent nur von einer bestimmten Quelle
+        blockieren möchten.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>Diskussion:</dt>
+
+      <dd>
+      <p>
+        Anstatt <module>mod_rewrite</module> hierfür zu verwenden, können Sie dasselbe
+        Ziel mit alternativen Mitteln erreichen, wie hier gezeigt:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      Wie oben erwähnt, ist diese Technik trivial zu umgehen, indem man
+      einfach den <code>USER_AGENT</code>-Anfrage-Header ändert. Wenn Sie
+      einen anhaltenden Angriff erleben, sollten Sie erwägen, diesen
+      auf einer höheren Ebene zu blockieren, beispielsweise an Ihrer Firewall.
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>Ablehnung von Hosts in einer Sperrliste</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wir möchten eine Liste von Hosts pflegen, ähnlich wie
+      <code>hosts.deny</code>, und diesen Hosts den Zugriff auf
+      unseren Server verweigern.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  ACHTUNG! Dies ist eine Map, keine Liste, auch wenn wir sie als solche behandeln.<br />
+##             mod_rewrite parst sie nach Schlüssel/Wert-Paaren, daher muss mindestens<br />
+##             ein Dummy-Wert "-" für jeden Eintrag vorhanden sein.<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>Diskussion:</dt>
+    <dd>
+    <p>
+    Die zweite RewriteCond setzt voraus, dass HostNameLookups aktiviert ist,
+    damit Client-IP-Adressen aufgelöst werden. Wenn dies nicht der Fall ist,
+    sollten Sie die zweite RewriteCond weglassen und das <code>[OR]</code>-Flag
+    von der ersten RewriteCond entfernen.
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>Referer-basierter Umleiter</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Anfragen basierend auf dem Referer umleiten, von dem die Anfrage
+      kam, mit unterschiedlichen Zielen pro Referer.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+  <p>Der folgende Regelsatz verwendet eine Map-Datei, um jeden Referer
+  mit einem Umleitungsziel zu verknüpfen.</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>Die Map-Datei listet Umleitungsziele für jeden Referer auf, oder,
+      wenn wir nur zurück dorthin umleiten möchten, woher sie kamen, wird ein
+      "-" in die Map eingetragen:</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/access.xml.es b/docs/manual/rewrite/access.xml.es
new file mode 100644 (file)
index 0000000..48fc05a
--- /dev/null
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Uso de mod_rewrite para control de acceso</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+cómo puede usar <module>mod_rewrite</module> para controlar el acceso a
+varios recursos, y otras técnicas relacionadas.
+Esto incluye muchos ejemplos de usos comunes de <module>mod_rewrite</module>,
+incluyendo descripciones detalladas de cómo funciona cada uno.</p>
+
+<note type="warning">Tenga en cuenta que muchos de estos ejemplos no funcionarán sin cambios en su
+configuración particular del servidor, por lo que es importante que los
+entienda, en lugar de simplemente copiar y pegar los ejemplos en su
+configuración.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<!-- <seealso><a href="access.html">Control de acceso</a></seealso> -->
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>Prohibir el &quot;Hotlinking&quot; de imágenes</title>
+
+      <dl>
+        <dt>Descripción:</dt>
+
+        <dd>
+          <p>La siguiente técnica prohíbe la práctica de que otros sitios
+          incluyan sus imágenes en línea en sus páginas. Esta práctica se
+          conoce a menudo como &quot;hotlinking&quot;, y resulta en que
+          su ancho de banda se use para servir contenido del sitio de
+          otra persona.</p>
+        </dd>
+
+        <dt>Solución:</dt>
+
+        <dd>
+          <p>Esta técnica se basa en el valor de la
+          variable <code>HTTP_REFERER</code>, que es opcional. Como
+          tal, es posible que algunas personas eviten esta
+          limitación. Sin embargo, la mayoría de los usuarios experimentarán la
+          solicitud fallida, lo que debería, con el tiempo, resultar en que la
+          imagen sea eliminada del otro sitio.</p>
+          <p>Hay varias formas en las que puede manejar esta
+          situación.</p>
+
+    <p>En este primer ejemplo, simplemente denegamos la solicitud, si no se
+    originó desde una página en nuestro sitio. Para el propósito de este ejemplo,
+    asumimos que nuestro sitio es <code>www.example.com</code>.</p>
+
+<!-- TODO: Añadir discusión aquí de por qué tenemos !^$ ahí. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>En este segundo ejemplo, en lugar de denegar la solicitud, mostramos
+    una imagen alternativa en su lugar.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>En el tercer ejemplo, redirigimos la solicitud a una imagen en algún
+    otro sitio.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>De estas técnicas, las dos últimas tienden a ser las más efectivas
+    para lograr que la gente deje de hacer hotlinking de sus imágenes, porque
+    simplemente no verán la imagen que esperaban ver.</p>
+
+        </dd>
+
+        <dt>Discusión:</dt>
+
+        <dd>
+        <p>Si todo lo que desea hacer es denegar el acceso al recurso, en lugar
+        de redirigir esa solicitud a otro lugar, esto se puede
+        lograr sin el uso de <module>mod_rewrite</module>:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>Bloqueo de Robots</title>
+
+      <dl>
+        <dt>Descripción:</dt>
+
+        <dd>
+        <p>
+        En esta receta, discutimos cómo bloquear solicitudes persistentes de
+        un robot o agente de usuario en particular.</p>
+
+        <p>El estándar para exclusión de robots define un archivo,
+        <code>/robots.txt</code> que especifica aquellas partes de su
+        sitio web donde desea excluir robots. Sin embargo, algunos robots
+        no respetan estos archivos.
+        </p>
+
+        <p>Tenga en cuenta que hay métodos para lograr esto que no
+        usan <module>mod_rewrite</module>. Tenga en cuenta también que cualquier técnica que dependa
+        de la cadena <code>USER_AGENT</code> del cliente puede ser evitada
+        muy fácilmente, ya que esa cadena puede cambiarse.</p>
+        </dd>
+
+        <dt>Solución:</dt>
+
+        <dd>
+        <p>Usamos un conjunto de reglas que especifica el directorio a ser
+        protegido, y el <code>USER_AGENT</code> del cliente que
+        identifica al robot malicioso o persistente.</p>
+
+        <p>En este ejemplo, estamos bloqueando un robot llamado
+        <code>NameOfBadRobot</code> de una ubicación
+        <code>/secret/files</code>. También puede especificar un rango de
+        direcciones IP, si está intentando bloquear ese agente de usuario solo desde
+        la fuente particular.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>Discusión:</dt>
+
+      <dd>
+      <p>
+        En lugar de usar <module>mod_rewrite</module> para esto, puede lograr el
+        mismo resultado usando medios alternativos, como se ilustra aquí:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      Como se indicó anteriormente, esta técnica es trivial de evadir, simplemente
+      modificando la cabecera de solicitud <code>USER_AGENT</code>. Si
+      está experimentando un ataque sostenido, debería considerar bloquearlo
+      a un nivel superior, como en su firewall.
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>Denegación de Hosts en una Lista de Rechazo</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Deseamos mantener una lista de hosts, similar a
+      <code>hosts.deny</code>, y hacer que esos hosts sean bloqueados
+      del acceso a nuestro servidor.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  ¡ATENCIÓN! Esto es un mapa, no una lista, incluso cuando lo tratamos como tal.<br />
+##             mod_rewrite lo analiza buscando pares clave/valor, así que al menos un<br />
+##             valor ficticio "-" debe estar presente para cada entrada.<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>Discusión:</dt>
+    <dd>
+    <p>
+    La segunda RewriteCond asume que tiene HostNameLookups activado,
+    de modo que las direcciones IP de los clientes sean resueltas. Si ese no es el
+    caso, debería eliminar la segunda RewriteCond, y eliminar la
+    bandera <code>[OR]</code> de la primera RewriteCond.
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>Deflector basado en Referer</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Redirigir solicitudes basadas en el Referer del cual provino la solicitud,
+      con diferentes destinos por Referer.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+  <p>El siguiente conjunto de reglas usa un archivo de mapa para asociar cada Referer
+  con un destino de redirección.</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>El archivo de mapa lista los destinos de redirección para cada referer, o, si
+      simplemente deseamos redirigir de vuelta a donde vinieron, se coloca un "-"
+      en el mapa:</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/access.xml.ja b/docs/manual/rewrite/access.xml.ja
new file mode 100644 (file)
index 0000000..5f5626f
--- /dev/null
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite を使ったアクセス制御</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> を使用してさまざまなリソースへのアクセスを制御する方法と、
+その他の関連テクニックについて説明します。
+<module>mod_rewrite</module> の一般的な使用例を多数含んでおり、
+それぞれの動作についての詳細な説明も含まれています。</p>
+
+<note type="warning">これらの例の多くは、特定のサーバ設定ではそのまま
+動作しないことに注意してください。そのため、単にコピー&ペーストするのではなく、
+内容を理解することが重要です。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<!-- <seealso><a href="access.html">アクセス制御</a></seealso> -->
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>画像の &quot;直リンク&quot; の禁止</title>
+
+      <dl>
+        <dt>説明:</dt>
+
+        <dd>
+          <p>以下のテクニックは、他のサイトがあなたの画像をそのページに
+          インラインで含める行為を禁止します。この行為は
+          &quot;直リンク&quot; と呼ばれることが多く、あなたの帯域幅が
+          他のサイトのコンテンツ提供のために使用される結果となります。</p>
+        </dd>
+
+        <dt>解決方法:</dt>
+
+        <dd>
+          <p>このテクニックは <code>HTTP_REFERER</code> 変数の値に
+          依存していますが、この値はオプションです。そのため、一部の
+          ユーザはこの制限を回避できます。ただし、ほとんどのユーザは
+          リクエスト失敗を経験し、時間の経過とともにその画像が
+          他のサイトから削除される結果となるはずです。</p>
+          <p>この状況に対処する方法はいくつかあります。</p>
+
+    <p>最初の例では、リクエストが当サイトのページから開始されたものでない
+    場合、単純にリクエストを拒否します。この例では、当サイトが
+    <code>www.example.com</code> であると仮定しています。</p>
+
+<!-- TODO: Add discussion here of why we have !^$ in there. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>2 番目の例では、リクエストを失敗させる代わりに、
+    代替画像を表示します。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>3 番目の例では、リクエストを他のサイトの画像にリダイレクト
+    します。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>これらのテクニックのうち、後の 2 つが画像の直リンクをやめさせる
+    のに最も効果的です。期待していた画像が表示されなくなるためです。</p>
+
+        </dd>
+
+        <dt>議論:</dt>
+
+        <dd>
+        <p>リクエストを他の場所にリダイレクトするのではなく、単にリソースへの
+        アクセスを拒否したいだけの場合、<module>mod_rewrite</module> を使わずに
+        実現できます:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>ロボットのブロック</title>
+
+      <dl>
+        <dt>説明:</dt>
+
+        <dd>
+        <p>
+        このレシピでは、特定のロボットやユーザエージェントからの
+        しつこいリクエストをブロックする方法について説明します。</p>
+
+        <p>ロボット排除の標準では、ウェブサイトのどの部分でロボットを
+        除外したいかを指定する <code>/robots.txt</code> というファイルが
+        定義されています。しかし、一部のロボットはこれらのファイルを
+        尊重しません。</p>
+
+        <p><module>mod_rewrite</module> を使用しない方法もあることに注意してください。
+        また、クライアントの <code>USER_AGENT</code> 文字列に依存する
+        テクニックは、その文字列を変更できるため、非常に簡単に回避できる
+        ことにも注意してください。</p>
+        </dd>
+
+        <dt>解決方法:</dt>
+
+        <dd>
+        <p>保護するディレクトリと、悪意のあるまたはしつこいロボットを
+        識別するクライアント <code>USER_AGENT</code> を指定する
+        ルールセットを使用します。</p>
+
+        <p>この例では、<code>NameOfBadRobot</code> というロボットを
+        <code>/secret/files</code> という場所からブロックしています。
+        特定のソースからのみそのユーザエージェントをブロックしたい場合は、
+        IP アドレス範囲も指定できます。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>議論:</dt>
+
+      <dd>
+      <p>
+        <module>mod_rewrite</module> を使わずに、次に示すような代替手段で
+        同じ目的を達成できます:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      上記で述べたように、このテクニックは <code>USER_AGENT</code>
+      リクエストヘッダを変更するだけで簡単に回避できます。持続的な
+      攻撃を受けている場合は、ファイアウォールなどのより上位のレベルで
+      ブロックすることを検討してください。
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>拒否リストのホストの拒否</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p><code>hosts.deny</code> のようなホストのリストを管理し、
+      それらのホストがサーバにアクセスするのをブロックしたいと
+      考えています。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  注意! これはリストではなくマップです。リストとして扱う場合でも、<br />
+##             mod_rewrite はキー/値のペアとして解析するため、各エントリに<br />
+##             少なくともダミーの値 "-" が必要です。<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>議論:</dt>
+    <dd>
+    <p>
+    2 番目の RewriteCond は、HostNameLookups がオンになっていて、
+    クライアント IP アドレスが解決されることを前提としています。
+    そうでない場合は、2 番目の RewriteCond を削除し、最初の
+    RewriteCond から <code>[OR]</code> フラグを削除してください。
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>リファラに基づくデフレクタ</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>リクエストの送信元のリファラに基づいてリクエストをリダイレクトし、
+      リファラごとに異なるターゲットを設定します。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+  <p>以下のルールセットは、マップファイルを使用して各リファラを
+  リダイレクト先に関連付けます。</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>マップファイルには各リファラのリダイレクト先が記述されています。
+      単にリファラ元にリダイレクトしたい場合は、マップに
+      "-" を配置します:</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/access.xml.ko b/docs/manual/rewrite/access.xml.ko
new file mode 100644 (file)
index 0000000..f7e1da5
--- /dev/null
@@ -0,0 +1,306 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite를 사용한 접근 제어</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module>를 사용하여 다양한 자원에 대한
+접근을 제어하는 방법과 기타 관련 기술을 설명합니다.
+여기에는 <module>mod_rewrite</module>의 일반적인 사용 예제가
+많이 포함되어 있으며, 각각이 어떻게 작동하는지에 대한
+자세한 설명이 있습니다.</p>
+
+<note type="warning">이 예제들 중 많은 것이 특정 서버 설정에서
+그대로 작동하지 않을 수 있으므로, 단순히 예제를 복사하여
+설정에 붙여넣기보다는 이해하는 것이 중요합니다.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<!-- <seealso><a href="access.html">접근 제어</a></seealso> -->
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>이미지 &quot;핫링킹&quot; 금지</title>
+
+      <dl>
+        <dt>설명:</dt>
+
+        <dd>
+          <p>다음 기술은 다른 사이트가 여러분의 이미지를
+          자신의 페이지에 인라인으로 포함하는 것을 금지합니다.
+          이 행위는 흔히 &quot;핫링킹&quot;이라고 하며,
+          여러분의 대역폭이 다른 사이트의 콘텐츠를 제공하는 데
+          사용되는 결과를 초래합니다.</p>
+        </dd>
+
+        <dt>해결책:</dt>
+
+        <dd>
+          <p>이 기술은 <code>HTTP_REFERER</code> 변수의 값에
+          의존하며, 이는 선택적입니다. 따라서 일부 사용자가
+          이 제한을 우회할 수 있습니다. 그러나 대부분의
+          사용자는 실패한 요청을 경험하게 되며, 시간이 지나면
+          해당 이미지가 다른 사이트에서 제거되는 결과를
+          가져올 것입니다.</p>
+          <p>이 상황을 처리하는 몇 가지 방법이 있습니다.</p>
+
+    <p>첫 번째 예제에서는 우리 사이트의 페이지에서 시작되지 않은
+    요청을 단순히 거부합니다. 이 예제에서는 우리 사이트가
+    <code>www.example.com</code>이라고 가정합니다.</p>
+
+<!-- TODO: Add discussion here of why we have !^$ in there. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>두 번째 예제에서는 요청을 실패시키는 대신
+    대체 이미지를 표시합니다.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>세 번째 예제에서는 요청을 다른 사이트의 이미지로
+    리다이렉트합니다.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>이 기술들 중 마지막 두 가지가 이미지 핫링킹을
+    중단시키는 데 가장 효과적입니다. 사용자들이 기대한
+    이미지를 볼 수 없기 때문입니다.</p>
+
+        </dd>
+
+        <dt>토론:</dt>
+
+        <dd>
+        <p>요청을 다른 곳으로 리다이렉트하는 것이 아니라
+        단순히 자원에 대한 접근을 거부하려는 경우,
+        <module>mod_rewrite</module>를 사용하지 않고도
+        이를 수행할 수 있습니다:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>로봇 차단</title>
+
+      <dl>
+        <dt>설명:</dt>
+
+        <dd>
+        <p>이 레시피에서는 특정 로봇 또는 사용자 에이전트의
+        지속적인 요청을 차단하는 방법을 논의합니다.</p>
+
+        <p>로봇 배제 표준은 <code>/robots.txt</code>라는
+        파일을 정의하며, 이 파일은 로봇을 배제하고자 하는
+        웹사이트의 부분을 지정합니다. 그러나 일부 로봇은
+        이 파일을 준수하지 않습니다.</p>
+
+        <p><module>mod_rewrite</module>를 사용하지 않고도
+        이를 수행할 수 있는 방법이 있다는 점에 유의하십시오.
+        또한 클라이언트의 <code>USER_AGENT</code> 문자열에
+        의존하는 기술은 해당 문자열을 쉽게 변경할 수 있으므로
+        매우 쉽게 우회할 수 있다는 점에 유의하십시오.</p>
+        </dd>
+
+        <dt>해결책:</dt>
+
+        <dd>
+        <p>보호할 디렉토리와 악의적이거나 지속적인 로봇을
+        식별하는 클라이언트 <code>USER_AGENT</code>를
+        지정하는 규칙 세트를 사용합니다.</p>
+
+        <p>이 예제에서는 <code>NameOfBadRobot</code>이라는
+        로봇을 <code>/secret/files</code> 위치에서
+        차단합니다. 특정 소스에서만 해당 사용자 에이전트를
+        차단하려는 경우 IP 주소 범위를 지정할 수도 있습니다.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>토론:</dt>
+
+      <dd>
+      <p>
+        <module>mod_rewrite</module>를 사용하는 대신, 여기에 설명된 대로
+        다른 방법을 사용하여 동일한 결과를 달성할 수 있습니다:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      위에서 언급한 바와 같이, 이 기술은 <code>USER_AGENT</code>
+      요청 헤더를 수정하는 것만으로도 쉽게 우회할 수 있습니다.
+      지속적인 공격을 받고 있다면, 방화벽과 같은 상위 수준에서
+      차단하는 것을 고려해야 합니다.
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>거부 목록의 호스트 차단</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p><code>hosts.deny</code>와 같은 호스트 목록을 관리하여
+      해당 호스트가 서버에 접근하지 못하도록 차단하고자 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  주의! 이것은 목록이 아니라 맵입니다.<br />
+##             mod_rewrite가 키/값 쌍을 파싱하므로 각 항목에<br />
+##             최소한 더미 값 "-"이 있어야 합니다.<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>토론:</dt>
+    <dd>
+    <p>
+    두 번째 RewriteCond는 HostNameLookups가 켜져 있어
+    클라이언트 IP 주소가 해석된다고 가정합니다. 그렇지
+    않은 경우, 두 번째 RewriteCond를 삭제하고 첫 번째
+    RewriteCond에서 <code>[OR]</code> 플래그를 제거해야
+    합니다.
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>리퍼러 기반 디플렉터</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>요청이 온 리퍼러에 따라 요청을 리다이렉트하며,
+      리퍼러별로 다른 대상을 지정합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+  <p>다음 규칙 세트는 맵 파일을 사용하여 각 리퍼러를
+  리다이렉션 대상과 연결합니다.</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>맵 파일은 각 리퍼러에 대한 리다이렉션 대상을
+      나열하거나, 단순히 원래 위치로 리다이렉트하려는
+      경우 맵에 "-"을 넣습니다:</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
index cda0183580c79b171a88d0c317a617d973ae87f4..362dc08a8fb9efc808313f346bc6ba2873353df6 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/access.xml.tr b/docs/manual/rewrite/access.xml.tr
new file mode 100644 (file)
index 0000000..6a2edcc
--- /dev/null
@@ -0,0 +1,308 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Erişim Denetimi için mod_rewrite Kullanımı</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+Çeşitli kaynaklara erişimi denetlemek için <module>mod_rewrite</module>
+modülünü nasıl kullanabileceğinizi ve diğer ilgili teknikleri açıklar.
+<module>mod_rewrite</module> modülünün yaygın kullanımlarına ilişkin,
+her birinin nasıl çalıştığının ayrıntılı açıklamalarını içeren birçok
+örnek sunulmaktadır.</p>
+
+<note type="warning">Bu örneklerin birçoğunun sizin sunucu yapılandırmanızda
+değişiklik yapılmadan çalışmayacağını unutmayın; bu nedenle örnekleri
+yapılandırmanıza kopyalayıp yapıştırmak yerine anlamanız
+önemlidir.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<!-- <seealso><a href="access.html">Erişim denetimi</a></seealso> -->
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>Resim &quot;Hotlinking&quot;inin Engellenmesi</title>
+
+      <dl>
+        <dt>Açıklama:</dt>
+
+        <dd>
+          <p>Aşağıdaki teknik, diğer sitelerin resimlerinizi kendi
+          sayfalarına satır içi olarak dahil etme uygulamasını engeller.
+          Bu uygulama genellikle &quot;hotlinking&quot; olarak anılır ve
+          bant genişliğinizin başkasının sitesi için içerik sunmak
+          amacıyla kullanılmasına neden olur.</p>
+        </dd>
+
+        <dt>Çözüm:</dt>
+
+        <dd>
+          <p>Bu teknik, isteğe bağlı olan <code>HTTP_REFERER</code>
+          değişkeninin değerine dayanır. Bu nedenle, bazı kişilerin bu
+          sınırlamayı atlaması mümkündür. Ancak çoğu kullanıcı başarısız
+          isteği deneyimleyecektir ve bu, zamanla resmin o diğer siteden
+          kaldırılmasına yol açacaktır.</p>
+          <p>Bu durumu ele almanın birkaç yolu vardır.</p>
+
+    <p>Bu ilk örnekte, istek sitemizden bir sayfadan başlatılmadıysa
+    isteği reddederiz. Bu örnek için sitemizin
+    <code>www.example.com</code> olduğunu varsayıyoruz.</p>
+
+<!-- TODO: Burada neden !^$ kullandığımızı tartışma ekleyin. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>Bu ikinci örnekte, isteği reddetmek yerine alternatif bir resim
+    gösteriyoruz.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>Üçüncü örnekte, isteği başka bir sitedeki bir resme
+    yönlendiriyoruz.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>Bu tekniklerden son ikisi, insanların resimlerinizi
+    hotlinking yapmayı bırakmasını sağlamada en etkili olanlardır;
+    çünkü görmeyi bekledikleri resmi göremeyeceklerdir.</p>
+
+        </dd>
+
+        <dt>Tartışma:</dt>
+
+        <dd>
+        <p>Tek yapmak istediğiniz kaynağa erişimi reddetmekse, isteği
+        başka bir yere yönlendirmek yerine bu,
+        <module>mod_rewrite</module> kullanılmadan da
+        gerçekleştirilebilir:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>Robotların Engellenmesi</title>
+
+      <dl>
+        <dt>Açıklama:</dt>
+
+        <dd>
+        <p>
+        Bu tarifle, belirli bir robot veya kullanıcı aracısından gelen
+        sürekli isteklerin nasıl engelleneceğini tartışıyoruz.</p>
+
+        <p>Robot dışlama standardı, web sitenizin robotları dışlamak
+        istediğiniz bölümlerini belirten <code>/robots.txt</code>
+        adında bir dosya tanımlar. Ancak bazı robotlar bu dosyalara
+        uymaz.</p>
+
+        <p>Bunu gerçekleştirmenin <module>mod_rewrite</module>
+        kullanmayan yöntemleri olduğunu unutmayın. Ayrıca istemcinin
+        <code>USER_AGENT</code> dizgesine dayanan herhangi bir tekniğin
+        kolayca atlanabileceğini de unutmayın; çünkü bu dizge
+        değiştirilebilir.</p>
+        </dd>
+
+        <dt>Çözüm:</dt>
+
+        <dd>
+        <p>Korunacak dizini ve zararlı ya da ısrarcı robotu tanımlayan
+        istemci <code>USER_AGENT</code> dizgesini belirten bir kural
+        kümesi kullanıyoruz.</p>
+
+        <p>Bu örnekte, <code>NameOfBadRobot</code> adlı bir robotu
+        <code>/secret/files</code> konumundan engelliyoruz. Kullanıcı
+        aracısını yalnızca belirli bir kaynaktan engellemek istiyorsanız
+        bir IP adresi aralığı da belirtebilirsiniz.</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>Tartışma:</dt>
+
+      <dd>
+      <p>
+        Bunun için <module>mod_rewrite</module> kullanmak yerine, aynı
+        sonucu burada gösterildiği gibi alternatif yollarla elde
+        edebilirsiniz:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      Yukarıda belirtildiği gibi, bu teknik <code>USER_AGENT</code>
+      istek başlığını değiştirerek kolayca atlanabilir. Sürekli bir
+      saldırıyla karşılaşıyorsanız, bunu güvenlik duvarınız gibi daha
+      üst bir düzeyde engellemeyi düşünmelisiniz.
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>Reddetme Listesindeki Konakların Engellenmesi</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p><code>hosts.deny</code> gibi bir konak listesi tutmak ve bu
+      konakların sunucumuza erişimini engellemek istiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  DİKKAT! Bu bir liste değil, bir eşlem dosyasıdır.<br />
+##             mod_rewrite bunu anahtar/değer çiftleri olarak çözümler,<br />
+##             bu yüzden her girdi için en azından bir yapay "-" değeri<br />
+##             mevcut olmalıdır.<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>Tartışma:</dt>
+    <dd>
+    <p>
+    İkinci RewriteCond, istemci IP adreslerinin çözümlenmesi için
+    HostNameLookups özelliğinin açık olduğunu varsayar. Durum böyle
+    değilse, ikinci RewriteCond'u kaldırmalı ve birinci RewriteCond'dan
+    <code>[OR]</code> bayrağını çıkarmalısınız.
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>Referer Tabanlı Yönlendirici</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>İstekleri, isteğin geldiği Referer'a göre, her Referer için
+      farklı hedeflerle yeniden yönlendirir.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+  <p>Aşağıdaki kural kümesi, her Referer'ı bir yönlendirme hedefiyle
+  ilişkilendirmek için bir eşlem dosyası kullanır.</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>Eşlem dosyası, her referer için yeniden yönlendirme hedeflerini
+      listeler veya yalnızca geldikleri yere geri yönlendirmek
+      istiyorsak eşleme bir "-" konur:</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/access.xml.zh-cn b/docs/manual/rewrite/access.xml.zh-cn
new file mode 100644 (file)
index 0000000..fb585c2
--- /dev/null
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933060 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="access.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>使用 mod_rewrite 控制访问</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了如何使用
+<module>mod_rewrite</module> 来控制对各种资源的访问,以及其他相关技术。
+其中包括许多 <module>mod_rewrite</module> 的常见用法示例,
+以及每个示例工作原理的详细描述。</p>
+
+<note type="warning">请注意,这些示例中的许多不会在你的特定服务器配置中直接生效,
+因此理解它们非常重要,而不仅仅是将示例复制粘贴到你的配置中。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<!-- <seealso><a href="access.html">访问控制</a></seealso> -->
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+    <section id="blocked-inline-images">
+
+      <title>禁止图片"盗链"</title>
+
+      <dl>
+        <dt>描述:</dt>
+
+        <dd>
+          <p>以下技术禁止其他站点将你的图片内联到他们的页面中。
+          这种做法通常被称为"盗链",会导致你的带宽被用来为他人的站点提供内容。</p>
+        </dd>
+
+        <dt>解决方案:</dt>
+
+        <dd>
+          <p>此技术依赖于 <code>HTTP_REFERER</code> 变量的值,
+          该变量是可选的。因此,某些人可能会绕过此限制。
+          但是,大多数用户将会遇到请求失败的情况,
+          随着时间推移,这应该会导致图片从其他站点上被移除。</p>
+          <p>有几种方法可以处理这种情况。</p>
+
+    <p>在第一个示例中,如果请求不是从我们站点上的页面发起的,
+    我们只是简单地拒绝请求。在本示例中,
+    我们假设我们的站点是 <code>www.example.com</code>。</p>
+
+<!-- TODO: Add discussion here of why we have !^$ in there. -->
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com" [NC]
+RewriteRule "\.(gif|jpg|png)$" "-"                [F,NC]
+</highlight>
+
+    <p>在第二个示例中,我们不是让请求失败,而是显示一个替代图片。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"      [NC]
+RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png"   [R,NC]
+</highlight>
+
+    <p>在第三个示例中,我们将请求重定向到另一个站点上的图片。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_REFERER}"  "!^$"
+RewriteCond "%{HTTP_REFERER}"  "!www.example.com"                    [NC]
+RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif"  [R,NC]
+</highlight>
+
+    <p>在这些技术中,后两种往往最能有效地阻止盗链行为,
+    因为他们根本看不到预期的图片。</p>
+
+        </dd>
+
+        <dt>讨论:</dt>
+
+        <dd>
+        <p>如果你只想拒绝对资源的访问,而不是将请求重定向到其他地方,
+        可以不使用 <module>mod_rewrite</module> 来实现:</p>
+
+        <highlight language="config">
+SetEnvIf Referer example\.com localreferer
+&lt;FilesMatch "\.(jpg|png|gif)$"&gt;
+    Require env localreferer
+&lt;/FilesMatch&gt;
+        </highlight>
+        </dd>
+      </dl>
+
+    </section>
+
+    <section id="blocking-of-robots">
+
+      <title>阻止机器人</title>
+
+      <dl>
+        <dt>描述:</dt>
+
+        <dd>
+        <p>在本配置方案中,我们讨论如何阻止来自特定机器人或用户代理的持续请求。</p>
+
+        <p>机器人排除标准定义了一个文件 <code>/robots.txt</code>,
+        用于指定你网站中希望排除机器人访问的部分。但是,某些机器人不遵守这些文件。</p>
+
+        <p>请注意,有些方法可以在不使用 <module>mod_rewrite</module> 的情况下实现此目的。
+        还要注意,任何依赖客户端 <code>USER_AGENT</code>
+        字符串的技术都可以很容易地被绕过,因为该字符串可以被更改。</p>
+        </dd>
+
+        <dt>解决方案:</dt>
+
+        <dd>
+        <p>我们使用一组规则来指定要保护的目录,
+        以及标识恶意或持续机器人的客户端 <code>USER_AGENT</code>。</p>
+
+        <p>在本示例中,我们从位置 <code>/secret/files</code>
+        阻止一个名为 <code>NameOfBadRobot</code> 的机器人。
+        如果你只想从特定来源阻止该用户代理,
+        也可以指定 IP 地址范围。</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_USER_AGENT}"   "^NameOfBadRobot"
+RewriteCond "%{REMOTE_ADDR}"       "=123\.45\.67\.[8-9]"
+RewriteRule "^/secret/files/"      "-"                   [F]
+</highlight>
+        </dd>
+
+      <dt>讨论:</dt>
+
+      <dd>
+      <p>
+        你可以使用替代方法来实现相同的目的,而不必使用
+        <module>mod_rewrite</module>,如下所示:
+      </p>
+      <highlight language="config">
+SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
+&lt;Location "/secret/files"&gt;
+    &lt;RequireAll&gt;
+        Require all granted
+        Require not env goaway
+    &lt;/RequireAll&gt;
+&lt;/Location&gt;
+      </highlight>
+      <p>
+      如上所述,这种技术很容易被绕过,只需修改
+      <code>USER_AGENT</code> 请求头即可。如果你遭受持续攻击,
+      应考虑在更高层级(如防火墙)进行阻止。
+      </p>
+
+      </dd>
+
+      </dl>
+
+    </section>
+
+<section id="host-deny">
+
+  <title>拒绝列表中的主机</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>我们希望维护一个主机列表,类似于 <code>hosts.deny</code>,
+      并阻止这些主机访问我们的服务器。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+<highlight language="config">
+RewriteEngine on
+RewriteMap    hosts-deny  "txt:/path/to/hosts.deny"
+RewriteCond   "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR]
+RewriteCond   "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule   "^"                                      "-"           [F]
+</highlight>
+
+<example>
+##<br />
+##  hosts.deny<br />
+##<br />
+##  注意!这是一个映射文件,不是列表,即使我们将其作为列表使用。<br />
+##             mod_rewrite 将其解析为键/值对,因此每个条目<br />
+##             至少必须存在一个虚拟值 "-"。<br />
+##<br />
+<br />
+193.102.180.41 -<br />
+bsdti1.sdm.de  -<br />
+192.76.162.40  -<br />
+</example>
+    </dd>
+
+    <dt>讨论:</dt>
+    <dd>
+    <p>
+    第二个 RewriteCond 假设你已启用 HostNameLookups,
+    以便客户端 IP 地址会被解析。如果未启用,
+    你应该删除第二个 RewriteCond,并从第一个 RewriteCond 中删除
+    <code>[OR]</code> 标志。
+    </p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="referer-deflector">
+
+  <title>基于 Referer 的转向器</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>根据请求来源的 Referer 重定向请求,
+      对每个 Referer 使用不同的目标。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+  <p>以下规则集使用映射文件将每个 Referer 与重定向目标关联。</p>
+
+<highlight language="config">
+RewriteMap  deflector "txt:/path/to/deflector.map"
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}}" =-
+RewriteRule "^"                            "%{HTTP_REFERER}" [R,L]
+
+RewriteCond "%{HTTP_REFERER}"              !=""
+RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND"
+RewriteRule "^"                            "${deflector:%{HTTP_REFERER}}" [R,L]
+</highlight>
+
+      <p>映射文件列出了每个 referer 的重定向目标,
+      或者如果我们只想重定向回他们的来源地,则在映射中放置 "-":</p>
+
+<highlight language="config">
+##
+##  deflector.map
+##
+
+http://badguys.example.com/bad/index.html    -
+http://badguys.example.com/bad/index2.html   -
+http://badguys.example.com/bad/index3.html   http://somewhere.example.com/
+</highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/advanced.xml.de b/docs/manual/rewrite/advanced.xml.de
new file mode 100644 (file)
index 0000000..aee08b6
--- /dev/null
@@ -0,0 +1,366 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Fortgeschrittene Techniken mit mod_rewrite</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es bietet
+einige fortgeschrittene Techniken zur Verwendung von <module>mod_rewrite</module>.</p>
+
+<!--
+Ich bezweifle, ob irgendetwas, das in diesem Dokument verbleibt, als
+"fortgeschritten" gilt. Es ist wahrscheinlich an der Zeit, eine
+Bestandsaufnahme der Beispiele zu machen, die wir in den verschiedenen
+Dokumenten haben, und eine Neuorganisation des Materials in diesem
+Verzeichnis in Betracht zu ziehen. Wieder einmal.
+-->
+
+<note type="warning">Beachten Sie, dass viele dieser Beispiele nicht unverändert in Ihrer
+speziellen Serverkonfiguration funktionieren werden. Es ist daher wichtig, dass Sie
+sie verstehen, anstatt die Beispiele einfach auszuschneiden und in Ihre
+Konfiguration einzufügen.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<!--<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>-->
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="sharding">
+
+  <title>URL-basiertes Sharding über mehrere Backends</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Eine gängige Technik zur Verteilung der Serverlast oder des
+      Speicherplatzes wird als "Sharding" bezeichnet.
+      Bei Verwendung dieser Methode verwendet ein Frontend-Server die
+      URL, um Benutzer oder Objekte konsistent auf separate
+      Backend-Server zu "verteilen".</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Eine Zuordnung von Benutzern zu Zielservern wird in externen
+      Map-Dateien gepflegt. Diese sehen wie folgt aus:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... und so weiter
+</example>
+
+  <p>Wir legen dies in eine <code>map.users-to-hosts</code>-Datei. Das
+    Ziel ist es, folgende Zuordnung vorzunehmen:</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>zu</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>Somit muss nicht jeder URL-Pfad auf jedem physischen Backend-Host
+      gültig sein. Der folgende Regelsatz erledigt dies für uns mit Hilfe der
+      Map-Dateien, wobei server0 ein Standardserver ist, der verwendet wird,
+      wenn ein Benutzer keinen Eintrag in der Map hat:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>Siehe die <directive module="mod_rewrite">RewriteMap</directive>-Dokumentation
+  und das <a href="./rewritemap.html">RewriteMap-HowTo</a>
+  für weitere Informationen zur Syntax dieser Direktive.</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>Dynamische Inhaltsregenerierung</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wir möchten Inhalte dynamisch generieren, sie aber statisch
+      speichern, sobald sie einmal generiert wurden. Diese Regel prüft,
+      ob die statische Datei vorhanden ist, und generiert sie, falls
+      nicht. Die statischen Dateien können bei Bedarf regelmäßig
+      entfernt werden (z.B. per Cron) und werden bei Bedarf neu
+      generiert.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      Dies wird durch den folgenden Regelsatz erreicht:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p>Der <code>-U</code>-Operator prüft, ob der Teststring
+    (in diesem Fall <code>REQUEST_URI</code>) eine gültige URL ist. Er
+    macht dies über eine Unteranfrage. Falls diese Unteranfrage fehlschlägt -
+    das heißt, die angeforderte Ressource existiert nicht - ruft diese
+    Regel das CGI-Programm <code>/regenerate_page.cgi</code> auf, das
+    die angeforderte Ressource generiert und im Dokumentenverzeichnis
+    speichert, sodass beim nächsten Aufruf eine statische Kopie
+    ausgeliefert werden kann.</p>
+
+    <p>Auf diese Weise können Dokumente, die selten aktualisiert werden, in
+    statischer Form ausgeliefert werden. Wenn Dokumente aktualisiert werden
+    müssen, können sie aus dem Dokumentenverzeichnis gelöscht werden, und sie
+    werden dann beim nächsten Aufruf erneut generiert.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>Lastverteilung</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wir möchten die Last zufällig auf mehrere Server verteilen,
+      indem wir <module>mod_rewrite</module> verwenden.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir verwenden <directive
+      module="mod_rewrite">RewriteMap</directive> und eine Serverliste,
+      um dies zu erreichen.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code> enthält eine Liste der Server:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>Wenn Sie möchten, dass ein bestimmter Server mehr Last als die
+anderen erhält, fügen Sie ihn mehrmals zur Liste hinzu.</p>
+
+   </dd>
+
+   <dt>Diskussion</dt>
+   <dd>
+<p>Apache wird mit einem Lastverteilungsmodul ausgeliefert -
+<module>mod_proxy_balancer</module> - das wesentlich flexibler und
+funktionsreicher ist als alles, was Sie mit <module>mod_rewrite</module>
+zusammenstellen können.</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>Strukturierte Benutzerverzeichnisse</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Einige Websites mit Tausenden von Benutzern verwenden ein
+      strukturiertes Heimatverzeichnis-Layout, <em>d.h.</em> jedes
+      Heimatverzeichnis befindet sich in einem Unterverzeichnis, das
+      (beispielsweise) mit dem ersten Zeichen des Benutzernamens beginnt.
+      So ist <code>/~larry/anypath</code> gleich
+      <code>/home/<strong>l</strong>/larry/public_html/anypath</code>,
+      während <code>/~waldo/anypath</code> gleich
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code> ist.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir verwenden den folgenden Regelsatz, um die Tilde-URLs
+      in das obige Layout umzusetzen.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>Umleitung von Ankern</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+    <p>Standardmäßig funktioniert die Umleitung zu einem HTML-Anker nicht,
+    da <module>mod_rewrite</module> das <code>#</code>-Zeichen maskiert und
+    es in <code>%23</code> umwandelt. Dies wiederum unterbricht die
+    Umleitung.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Verwenden Sie das <code>[NE]</code>-Flag in der
+      <code>RewriteRule</code>. NE steht für No Escape (Nicht maskieren).
+      </p>
+    </dd>
+
+    <dt>Diskussion:</dt>
+    <dd>Diese Technik funktioniert natürlich auch mit anderen
+    Sonderzeichen, die <module>mod_rewrite</module> standardmäßig URL-kodiert.</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>Zeitabhängiges Umschreiben</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wir möchten <module>mod_rewrite</module> verwenden, um je nach Tageszeit
+      unterschiedliche Inhalte auszuliefern.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Es gibt viele Variablen namens <code>TIME_xxx</code>
+      für Rewrite-Bedingungen. In Verbindung mit den speziellen
+      lexikographischen Vergleichsmustern <code>&lt;STRING</code>,
+      <code>&gt;STRING</code> und <code>=STRING</code> können wir
+      zeitabhängige Umleitungen durchführen:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>Dies liefert den Inhalt von <code>foo.day.html</code>
+      unter der URL <code>foo.html</code> von
+      <code>07:01-18:59</code> und zur restlichen Zeit den
+      Inhalt von <code>foo.night.html</code>.</p>
+
+      <note type="warning"><module>mod_cache</module>, Zwischenproxys
+      und Browser können jeweils Antworten zwischenspeichern und dazu
+      führen, dass eine der beiden Seiten außerhalb des konfigurierten
+      Zeitfensters angezeigt wird.
+      <module>mod_expires</module> kann verwendet werden, um diesen
+      Effekt zu kontrollieren. Es ist natürlich viel besser, die
+      Inhalte einfach dynamisch auszuliefern und basierend auf der
+      Tageszeit anzupassen.</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>Umgebungsvariablen basierend auf URL-Teilen setzen</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Manchmal möchten wir eine Art Status beibehalten, wenn wir
+      ein Umschreiben durchführen. Beispielsweise möchten Sie sich
+      merken, dass dieses Umschreiben stattgefunden hat, damit Sie
+      später prüfen können, ob eine Anfrage über dieses Umschreiben
+      kam. Eine Möglichkeit dafür ist das Setzen einer
+      Umgebungsvariable.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Verwenden Sie das [E]-Flag, um eine Umgebungsvariable zu setzen.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>Später in Ihrem Regelsatz können Sie diese Umgebungsvariable
+    mit einer RewriteCond prüfen:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>Beachten Sie, dass Umgebungsvariablen eine externe Umleitung nicht
+    überleben. Sie könnten stattdessen das [CO]-Flag verwenden, um ein
+    Cookie zu setzen. Für Verzeichniskontext- und htaccess-Umschreibungen,
+    bei denen die endgültige Ersetzung als interne Umleitung verarbeitet
+    wird, werden Umgebungsvariablen aus der vorherigen Runde des
+    Umschreibens mit dem Präfix "REDIRECT_" versehen.</p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/advanced.xml.es b/docs/manual/rewrite/advanced.xml.es
new file mode 100644 (file)
index 0000000..06d537a
--- /dev/null
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Técnicas avanzadas con mod_rewrite</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Proporciona
+algunas técnicas avanzadas usando <module>mod_rewrite</module>.</p>
+
+<!--
+Cuestiono si algo de lo que queda en este documento califica como
+"avanzado". Probablemente es hora de hacer un inventario de los ejemplos que
+tenemos en los diversos documentos, y considerar una reorganización del material en este
+directorio. De nuevo.
+-->
+
+<note type="warning">Tenga en cuenta que muchos de estos ejemplos no funcionarán sin cambios en su
+configuración particular del servidor, por lo que es importante que los
+entienda, en lugar de simplemente copiar y pegar los ejemplos en su
+configuración.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<!--<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>-->
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="sharding">
+
+  <title>Fragmentación basada en URL entre múltiples backends</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Una técnica común para distribuir la carga del
+      servidor o el espacio de almacenamiento se llama "fragmentación" (sharding).
+      Al usar este método, un servidor front-end usará la
+      URL para "fragmentar" consistentemente usuarios u objetos a servidores
+      backend separados.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Se mantiene un mapeo, de usuarios a servidores destino, en
+      archivos de mapa externos. Tienen este aspecto:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... y así sucesivamente
+</example>
+
+  <p>Colocamos esto en un archivo <code>map.users-to-hosts</code>. El
+    objetivo es mapear;</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>a</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>por lo que no es necesario que cada ruta URL sea válida en cada host físico
+      backend. El siguiente conjunto de reglas hace esto por nosotros con la ayuda de los
+      archivos de mapa, asumiendo que server0 es un servidor predeterminado que se usará si
+      un usuario no tiene entrada en el mapa:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>Consulte la documentación de la directiva <directive module="mod_rewrite">RewriteMap</directive>
+  y el <a href="./rewritemap.html">Cómo usar RewriteMap</a>
+  para más discusión de la sintaxis de esta directiva.</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>Regeneración de Contenido sobre la marcha</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Deseamos generar contenido dinámicamente, pero almacenarlo
+      estáticamente una vez que se ha generado. Esta regla verificará la
+      existencia del archivo estático, y si no está allí, lo generará.
+      Los archivos estáticos pueden eliminarse periódicamente, si se desea (digamos,
+      mediante cron) y se regenerarán bajo demanda.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      Esto se hace mediante el siguiente conjunto de reglas:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p>El operador <code>-U</code> determina si la cadena de prueba
+    (en este caso, <code>REQUEST_URI</code>) es una URL válida. Lo hace
+    mediante una sub-solicitud. En el caso de que esta sub-solicitud falle -
+    es decir, el recurso solicitado no existe - esta regla invoca
+    el programa CGI <code>/regenerate_page.cgi</code>, que genera
+    el recurso solicitado y lo guarda en el directorio de documentos, de modo
+    que la próxima vez que se solicite, se pueda servir una copia estática.</p>
+
+    <p>De esta manera, documentos que se actualizan con poca frecuencia pueden servirse en
+    forma estática. Si los documentos necesitan actualizarse, pueden eliminarse
+    del directorio de documentos, y se regenerarán la
+    próxima vez que se soliciten.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>Balanceo de Carga</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Deseamos distribuir aleatoriamente la carga entre varios servidores
+      usando <module>mod_rewrite</module>.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Usaremos <directive
+      module="mod_rewrite">RewriteMap</directive> y una lista de servidores
+      para lograr esto.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code> contendrá una lista de los servidores:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>Si desea que un servidor particular reciba más carga que los
+otros, agreguelo más veces a la lista.</p>
+
+   </dd>
+
+   <dt>Discusión</dt>
+   <dd>
+<p>Apache viene con un módulo de balanceo de carga -
+<module>mod_proxy_balancer</module> - que es mucho más flexible y
+con más funcionalidades que cualquier cosa que pueda construir usando <module>mod_rewrite</module>.</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>Directorios de Usuario Estructurados</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Algunos sitios con miles de usuarios usan una
+      disposición de directorio personal estructurada, <em>es decir,</em> cada directorio personal está en un
+      subdirectorio que comienza (por ejemplo) con el primer
+      carácter del nombre de usuario. Así, <code>/~larry/anypath</code>
+      es <code>/home/<strong>l</strong>/larry/public_html/anypath</code>
+      mientras que <code>/~waldo/anypath</code> es
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code>.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Usamos el siguiente conjunto de reglas para expandir las URLs de tilde
+      a la disposición anterior.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>Redireccionando Anclas</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+    <p>Por defecto, redirigir a un ancla HTML no funciona,
+    porque <module>mod_rewrite</module> escapa el carácter <code>#</code>,
+    convirtiéndolo en <code>%23</code>. Esto, a su vez, rompe la
+    redirección.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Use la bandera <code>[NE]</code> en la
+      <code>RewriteRule</code>. NE significa No Escapar.
+      </p>
+    </dd>
+
+    <dt>Discusión:</dt>
+    <dd>Esta técnica por supuesto también funcionará con otros
+    caracteres especiales que <module>mod_rewrite</module>, por defecto, codifica en URL.</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>Reescritura Dependiente del Tiempo</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Deseamos usar <module>mod_rewrite</module> para servir contenido diferente basado en
+      la hora del día.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Hay muchas variables llamadas <code>TIME_xxx</code>
+      para condiciones de reescritura. En conjunto con los patrones
+      especiales de comparación lexicográfica <code>&lt;STRING</code>,
+      <code>&gt;STRING</code> y <code>=STRING</code> podemos
+      hacer redirecciones dependientes del tiempo:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>Esto proporciona el contenido de <code>foo.day.html</code>
+      bajo la URL <code>foo.html</code> de
+      <code>07:01-18:59</code> y en el tiempo restante el
+      contenido de <code>foo.night.html</code>.</p>
+
+      <note type="warning"><module>mod_cache</module>, proxies intermedios
+      y navegadores pueden cada uno almacenar en caché las respuestas y causar que cualquiera de las páginas se
+      muestre fuera de la ventana de tiempo configurada.
+      Se puede usar <module>mod_expires</module> para controlar este
+      efecto. Por supuesto, es mucho mejor simplemente servir el
+      contenido dinámicamente y personalizarlo basándose en la hora del día.</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>Establecer Variables de Entorno Basadas en Partes de la URL</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>A veces, queremos mantener algún tipo de estado cuando
+      realizamos una reescritura. Por ejemplo, desea tomar nota de que
+      ha realizado esa reescritura, para poder verificar más tarde si una
+      solicitud llegó a través de esa reescritura. Una forma de hacer esto es estableciendo una
+      variable de entorno.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Use la bandera [E] para establecer una variable de entorno.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>Más adelante en su conjunto de reglas puede verificar esta variable
+    de entorno usando una RewriteCond:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>Tenga en cuenta que las variables de entorno no sobreviven a una
+    redirección externa. Podría considerar usar la bandera [CO] para establecer una
+    cookie. Para reescrituras en contexto per-directorio y htaccess, donde la sustitución
+    final se procesa como una redirección interna, las variables
+    de entorno de la ronda anterior de reescritura se prefijan con
+    "REDIRECT_". </p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/advanced.xml.ja b/docs/manual/rewrite/advanced.xml.ja
new file mode 100644 (file)
index 0000000..6694731
--- /dev/null
@@ -0,0 +1,361 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite の高度なテクニック</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> を使用したいくつかの高度なテクニックを提供します。</p>
+
+<!--
+I question whether anything remailing in this document qualifies as
+"advanced". It's probably time to take inventory of the examples that we
+have in the various docs, and consider a reorg of the stuff in this
+directory. Again.
+-->
+
+<note type="warning">これらの例の多くは、特定のサーバ設定ではそのまま
+動作しないことに注意してください。そのため、単にコピー&ペーストするのではなく、
+内容を理解することが重要です。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<!--<seealso><a href="advanced.html">高度なテクニック</a></seealso>-->
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="sharding">
+
+  <title>URL ベースの複数バックエンドへのシャーディング</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>サーバ負荷やストレージスペースの負担を分散するための
+      一般的なテクニックは「シャーディング」と呼ばれます。
+      この方法を使用すると、フロントエンドサーバは URL を使用して
+      ユーザやオブジェクトを別々のバックエンドサーバに一貫して
+      「シャード」します。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>ユーザからターゲットサーバへのマッピングが外部マップファイルに
+      保持されています。次のような形式です:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... 以下同様
+</example>
+
+  <p>これを <code>map.users-to-hosts</code> ファイルに入れます。目的は
+    以下をマッピングすることです:</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>を以下にマッピング:</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>このようにすると、すべての URL パスがすべてのバックエンド物理
+      ホストで有効である必要はありません。以下のルールセットは、
+      マップファイルの助けを借りてこれを実現します。server0 は、
+      ユーザがマップにエントリを持たない場合に使用されるデフォルト
+      サーバとして想定しています:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>このディレクティブの構文の詳細については、
+  <directive module="mod_rewrite">RewriteMap</directive>
+  ドキュメントと <a href="./rewritemap.html">RewriteMap ハウツー</a>
+  を参照してください。</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>オンザフライのコンテンツ再生成</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>コンテンツを動的に生成したいが、一度生成したら静的に
+      保存したいとします。このルールは静的ファイルの存在を確認し、
+      存在しない場合は生成します。静的ファイルは必要に応じて
+      (例えば cron で) 定期的に削除でき、要求に応じて再生成
+      されます。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      これは以下のルールセットで実現されます:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p><code>-U</code> 演算子は、テスト文字列 (この場合は
+    <code>REQUEST_URI</code>) が有効な URL かどうかを判定します。
+    これはサブリクエストを通じて行われます。このサブリクエストが
+    失敗した場合、つまりリクエストされたリソースが存在しない場合、
+    このルールは CGI プログラム <code>/regenerate_page.cgi</code>
+    を呼び出し、リクエストされたリソースを生成してドキュメント
+    ディレクトリに保存します。これにより、次回リクエストされたときに
+    静的コピーを提供できます。</p>
+
+    <p>このようにして、更新頻度の低いドキュメントを静的形式で
+    提供できます。ドキュメントを更新する必要がある場合は、
+    ドキュメントディレクトリから削除すれば、次回リクエストされたときに
+    再生成されます。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>ロードバランシング</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module> を使用して、複数のサーバに
+      ランダムに負荷を分散したいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>これを実現するために <directive
+      module="mod_rewrite">RewriteMap</directive> とサーバの
+      リストを使用します。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code> にはサーバのリストが含まれます:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>特定のサーバにより多くの負荷を割り当てたい場合は、
+リストにそのサーバを複数回追加してください。</p>
+
+   </dd>
+
+   <dt>議論</dt>
+   <dd>
+<p>Apache にはロードバランシングモジュール -
+<module>mod_proxy_balancer</module> - が付属しており、
+<module>mod_rewrite</module> で構築できるものよりもはるかに柔軟で
+機能豊富です。</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>構造化ユーザディレクトリ</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>数千人のユーザを持つサイトの中には、構造化されたホームディレクトリ
+      レイアウトを使用するものがあります。<em>つまり</em>、各ホームディレクトリは
+      ユーザ名の最初の文字で始まるサブディレクトリにあります。例えば、
+      <code>/~larry/anypath</code> は
+      <code>/home/<strong>l</strong>/larry/public_html/anypath</code>
+      であり、<code>/~waldo/anypath</code> は
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code>
+      です。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>上記のレイアウトにチルダ URL を展開するために、以下のルールセットを
+      使用します。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>アンカーのリダイレクト</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+    <p>デフォルトでは、HTML アンカーへのリダイレクトは機能しません。
+    <module>mod_rewrite</module> が <code>#</code> 文字をエスケープして
+    <code>%23</code> に変換するためです。これによりリダイレクトが
+    壊れます。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p><code>RewriteRule</code> で <code>[NE]</code> フラグを
+      使用します。NE は No Escape (エスケープしない) の略です。
+      </p>
+    </dd>
+
+    <dt>議論:</dt>
+    <dd>このテクニックは、<module>mod_rewrite</module> がデフォルトで
+    URL エンコードする他の特殊文字にも適用できます。</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>時間に依存する書き換え</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module> を使用して、時間帯に基づいて
+      異なるコンテンツを提供したいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>書き換え条件に使用できる <code>TIME_xxx</code> という名前の
+      変数が多数あります。特殊な辞書順比較パターン
+      <code>&lt;STRING</code>、<code>&gt;STRING</code>、
+      <code>=STRING</code> と組み合わせることで、時間に依存する
+      リダイレクトを行えます:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>これにより、URL <code>foo.html</code> で
+      <code>07:01-18:59</code> の間は <code>foo.day.html</code> の
+      コンテンツを、残りの時間帯は <code>foo.night.html</code> の
+      コンテンツを提供します。</p>
+
+      <note type="warning"><module>mod_cache</module>、中間プロキシ、
+      およびブラウザはそれぞれレスポンスをキャッシュし、設定された
+      時間枠外にいずれかのページが表示される可能性があります。
+      <module>mod_expires</module> を使用してこの影響を制御できます。
+      もちろん、コンテンツを動的に提供し、時間帯に基づいて
+      カスタマイズする方がはるかに良いでしょう。</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>URL の部分に基づく環境変数の設定</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>書き換えを実行する際に何らかの状態を維持したい場合が
+      あります。例えば、書き換えを行ったことをメモし、後でリクエストが
+      その書き換えを経由したかどうかを確認したいとします。これを行う
+      1 つの方法は、環境変数を設定することです。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>[E] フラグを使用して環境変数を設定します。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>後のルールセットで RewriteCond を使用してこの環境変数を
+    確認できます:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>環境変数は外部リダイレクトでは保持されないことに注意
+    してください。[CO] フラグを使用して cookie を設定することを
+    検討するとよいでしょう。ディレクトリ単位および htaccess の
+    書き換えでは、最終的な置換が内部リダイレクトとして処理されるため、
+    前回の書き換えラウンドの環境変数には "REDIRECT_" がプレフィックスとして
+    付きます。</p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/advanced.xml.ko b/docs/manual/rewrite/advanced.xml.ko
new file mode 100644 (file)
index 0000000..c27e461
--- /dev/null
@@ -0,0 +1,352 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite 고급 기술</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module>를 사용한 몇 가지 고급 기술을
+제공합니다.</p>
+
+<note type="warning">이 예제들 중 많은 것이 특정 서버 설정에서
+그대로 작동하지 않을 수 있으므로, 단순히 예제를 복사하여
+설정에 붙여넣기보다는 이해하는 것이 중요합니다.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<!--<seealso><a href="advanced.html">고급 기술</a></seealso>-->
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="sharding">
+
+  <title>여러 백엔드에 대한 URL 기반 샤딩</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>서버 부하나 저장 공간을 분산하는 일반적인 기술을
+      "샤딩"이라고 합니다. 이 방법을 사용할 때 프론트엔드
+      서버는 URL을 사용하여 사용자 또는 객체를 별도의
+      백엔드 서버에 일관되게 "샤딩"합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>사용자에서 대상 서버로의 매핑이 외부 맵 파일에
+      유지됩니다. 다음과 같은 형태입니다:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... 등등
+</example>
+
+  <p>이것을 <code>map.users-to-hosts</code> 파일에 넣습니다.
+    목적은 다음을 매핑하는 것입니다;</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>위의 것을 다음으로:</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>따라서 모든 URL 경로가 모든 백엔드 물리적 호스트에서
+      유효할 필요가 없습니다. 다음 규칙 세트는 맵 파일의
+      도움으로 이를 수행하며, 사용자가 맵에 항목이 없는
+      경우 server0이 기본 서버로 사용됩니다:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>이 지시어의 구문에 대한 자세한 내용은
+  <directive module="mod_rewrite">RewriteMap</directive>
+  문서와 <a href="./rewritemap.html">RewriteMap 사용법</a>을
+  참조하십시오.</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>실시간 콘텐츠 재생성</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>콘텐츠를 동적으로 생성하되, 한 번 생성되면
+      정적으로 저장하고자 합니다. 이 규칙은 정적 파일의
+      존재를 확인하고, 없으면 생성합니다. 정적 파일은
+      원하는 경우 (예를 들어 cron을 통해) 주기적으로
+      제거할 수 있으며, 필요에 따라 재생성됩니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      이는 다음 규칙 세트로 수행됩니다:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p><code>-U</code> 연산자는 테스트 문자열(이 경우
+    <code>REQUEST_URI</code>)이 유효한 URL인지
+    판단합니다. 이는 서브요청을 통해 수행됩니다.
+    이 서브요청이 실패하면 - 즉, 요청된 자원이 존재하지
+    않으면 - 이 규칙은 CGI 프로그램
+    <code>/regenerate_page.cgi</code>를 호출하여
+    요청된 자원을 생성하고 문서 디렉토리에 저장하므로,
+    다음에 요청될 때 정적 복사본을 제공할 수 있습니다.</p>
+
+    <p>이 방식으로 자주 업데이트되지 않는 문서를 정적
+    형태로 제공할 수 있습니다. 문서를 새로고침해야 하는
+    경우 문서 디렉토리에서 삭제할 수 있으며, 다음에
+    요청될 때 재생성됩니다.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>부하 분산</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module>를 사용하여 여러 서버에
+      무작위로 부하를 분산하고자 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p><directive module="mod_rewrite">RewriteMap</directive>과
+      서버 목록을 사용하여 이를 수행합니다.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code>에는 서버 목록이 포함됩니다:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>특정 서버가 다른 서버보다 더 많은 부하를 받도록 하려면
+목록에 해당 서버를 더 많이 추가하십시오.</p>
+
+   </dd>
+
+   <dt>토론</dt>
+   <dd>
+<p>Apache에는 부하 분산 모듈인
+<module>mod_proxy_balancer</module>가 포함되어 있으며,
+이것은 <module>mod_rewrite</module>를 사용하여 조합할 수 있는
+어떤 것보다 훨씬 더 유연하고 기능이 풍부합니다.</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>구조화된 사용자 디렉토리</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>수천 명의 사용자가 있는 일부 사이트는 구조화된
+      홈 디렉토리 레이아웃을 사용합니다. <em>즉,</em> 각
+      홈 디렉토리는 사용자 이름의 첫 번째 문자로 시작하는
+      하위 디렉토리에 있습니다. 예를 들어
+      <code>/~larry/anypath</code>는
+      <code>/home/<strong>l</strong>/larry/public_html/anypath</code>이고
+      <code>/~waldo/anypath</code>는
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code>입니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>위의 레이아웃으로 물결표 URL을 확장하기 위해
+      다음 규칙 세트를 사용합니다.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>앵커 리다이렉트</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+    <p>기본적으로 HTML 앵커로의 리다이렉트는 작동하지
+    않습니다. <module>mod_rewrite</module>가 <code>#</code>
+    문자를 이스케이프하여 <code>%23</code>으로 변환하기
+    때문입니다. 이로 인해 리다이렉션이 중단됩니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p><code>RewriteRule</code>에 <code>[NE]</code>
+      플래그를 사용합니다. NE는 No Escape를 의미합니다.</p>
+    </dd>
+
+    <dt>토론:</dt>
+    <dd>이 기술은 <module>mod_rewrite</module>가 기본적으로
+    URL 인코딩하는 다른 특수 문자에도 물론 적용됩니다.</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>시간 기반 재작성</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module>를 사용하여 시간대에 따라
+      다른 콘텐츠를 제공하고자 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>재작성 조건에 사용할 수 있는 <code>TIME_xxx</code>라는
+      많은 변수가 있습니다. 특수 사전식 비교 패턴
+      <code>&lt;STRING</code>, <code>&gt;STRING</code>,
+      <code>=STRING</code>과 함께 시간 기반 리다이렉트를
+      수행할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>이것은 <code>07:01-18:59</code> 사이에는 URL
+      <code>foo.html</code> 하에 <code>foo.day.html</code>의
+      콘텐츠를 제공하고, 나머지 시간에는
+      <code>foo.night.html</code>의 콘텐츠를 제공합니다.</p>
+
+      <note type="warning"><module>mod_cache</module>, 중간 프록시
+      및 브라우저는 각각 응답을 캐시할 수 있으며, 구성된
+      시간 창 밖에서 어느 쪽 페이지든 표시될 수 있습니다.
+      <module>mod_expires</module>를 사용하여 이 효과를
+      제어할 수 있습니다. 물론 콘텐츠를 동적으로 제공하고
+      시간대에 따라 사용자 정의하는 것이 훨씬 좋습니다.</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>URL 부분에 따른 환경 변수 설정</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>때때로 재작성을 수행할 때 어떤 종류의 상태를
+      유지하고 싶을 수 있습니다. 예를 들어, 해당 재작성을
+      수행했다는 것을 기록하여 나중에 요청이 해당 재작성을
+      통해 왔는지 확인하고 싶을 수 있습니다. 이를 수행하는
+      한 가지 방법은 환경 변수를 설정하는 것입니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>[E] 플래그를 사용하여 환경 변수를 설정합니다.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>나중에 규칙 세트에서 RewriteCond를 사용하여
+    이 환경 변수를 확인할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>환경 변수는 외부 리다이렉트에서 유지되지 않는다는
+    점에 유의하십시오. 쿠키를 설정하려면 [CO] 플래그를
+    사용하는 것을 고려할 수 있습니다. 디렉토리별 및
+    htaccess 재작성에서 최종 치환이 내부 리다이렉트로
+    처리되는 경우, 이전 라운드의 재작성에서 온 환경 변수는
+    "REDIRECT_" 접두사가 붙습니다.</p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
index 98192e701877451ef3fad04dc15f3f5fd1e04848..d4121a859a5fe79e9422ca7e89a52f9e8155930c 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/advanced.xml.tr b/docs/manual/rewrite/advanced.xml.tr
new file mode 100644 (file)
index 0000000..a8361f8
--- /dev/null
@@ -0,0 +1,362 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite ile İleri Teknikler</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+<module>mod_rewrite</module> kullanarak birkaç ileri teknik sunar.</p>
+
+<!--
+Burada kalan herhangi bir şeyin "ileri" sayılıp sayılmadığını
+sorguluyorum. Muhtemelen çeşitli belgelerdeki örneklerin envanterini
+çıkarmanın ve bu dizindeki malzemeyi yeniden düzenlemenin zamanı
+gelmiştir. Yine.
+-->
+
+<note type="warning">Bu örneklerin birçoğunun sizin sunucu yapılandırmanızda
+değişiklik yapılmadan çalışmayacağını unutmayın; bu nedenle örnekleri
+yapılandırmanıza kopyalayıp yapıştırmak yerine anlamanız
+önemlidir.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<!--<seealso><a href="advanced.html">İleri teknikler</a></seealso>-->
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="sharding">
+
+  <title>Birden Fazla Arka Uç Arasında URL Tabanlı Parçalama</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Sunucu yükünü veya depolama alanını dağıtmak için yaygın bir
+      teknik "parçalama" (sharding) olarak adlandırılır. Bu yöntem
+      kullanıldığında, bir ön uç sunucu kullanıcıları veya nesneleri
+      tutarlı bir şekilde ayrı arka uç sunuculara "parçalamak" için
+      URL'yi kullanır.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Kullanıcılardan hedef sunuculara bir eşleme, harici eşlem
+      dosyalarında tutulur. Şöyle görünürler:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... ve böyle devam eder
+</example>
+
+  <p>Bunu bir <code>map.users-to-hosts</code> dosyasına koyarız. Amaç
+    şunu eşlemektir;</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>buna</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>böylece her URL yolunun her arka uç fiziksel konakta geçerli
+      olması gerekmez. Aşağıdaki kural kümesi, eşlem dosyalarının
+      yardımıyla bunu bizim için yapar; bir kullanıcının eşlemde
+      girdisi yoksa server0'ın öntanımlı sunucu olarak
+      kullanılacağını varsayar:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>Bu yönergenin sözdizimi hakkında daha fazla tartışma için
+  <directive module="mod_rewrite">RewriteMap</directive> belgelerine ve
+  <a href="./rewritemap.html">RewriteMap Nasıl Yapılır</a> belgesine
+  bakın.</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>Anında İçerik Yeniden Oluşturma</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>İçeriği devingen olarak oluşturmak, ancak oluşturulduktan
+      sonra statik olarak saklamak istiyoruz. Bu kural, statik dosyanın
+      varlığını kontrol eder ve yoksa oluşturur. Statik dosyalar
+      istenirse periyodik olarak (örneğin cron ile) kaldırılabilir ve
+      istek üzerine yeniden oluşturulur.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      Bu, aşağıdaki kural kümesiyle yapılır:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p><code>-U</code> işleci, sınama dizgesinin (bu durumda
+    <code>REQUEST_URI</code>) geçerli bir URL olup olmadığını belirler.
+    Bunu bir alt istek aracılığıyla yapar. Bu alt istek başarısız
+    olursa - yani istenen kaynak mevcut değilse - bu kural, istenen
+    kaynağı oluşturan ve belge dizinine kaydeden
+    <code>/regenerate_page.cgi</code> CGI programını çalıştırır; böylece
+    bir sonraki istekte statik bir kopya sunulabilir.</p>
+
+    <p>Bu şekilde, seyrek güncellenen belgeler statik biçimde
+    sunulabilir. Belgelerin yenilenmesi gerekiyorsa belge dizininden
+    silinebilir ve bir sonraki istekte yeniden oluşturulur.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>Yük Dengeleme</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module> kullanarak yükü birkaç sunucu
+      arasında rastgele dağıtmak istiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Bunu gerçekleştirmek için <directive
+      module="mod_rewrite">RewriteMap</directive> ve bir sunucu listesi
+      kullanacağız.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code> sunucuların bir listesini içerecektir:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>Belirli bir sunucunun diğerlerinden daha fazla yük almasını
+istiyorsanız, onu listeye daha fazla kez ekleyin.</p>
+
+   </dd>
+
+   <dt>Tartışma</dt>
+   <dd>
+<p>Apache, <module>mod_rewrite</module> ile bir araya getireceğiniz
+herhangi bir şeyden çok daha esnek ve özellik açısından zengin bir yük
+dengeleme modülü olan <module>mod_proxy_balancer</module> ile
+birlikte gelir.</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>Yapılandırılmış Kullanıcı Dizinleri</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Binlerce kullanıcısı olan bazı siteler yapılandırılmış bir
+      ev dizini düzeni kullanır; <em>yani</em> her ev dizini, kullanıcı
+      adının (örneğin) ilk karakteriyle başlayan bir alt dizindedir.
+      Böylece, <code>/~larry/anypath</code> şu olur:
+      <code>/home/<strong>l</strong>/larry/public_html/anypath</code>;
+      <code>/~waldo/anypath</code> ise şu olur:
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code>.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Tilde URL'leri yukarıdaki düzene göre genişletmek için
+      aşağıdaki kural kümesini kullanırız.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>Çapaların Yeniden Yönlendirilmesi</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+    <p>Öntanımlı olarak, bir HTML çapasına yönlendirme çalışmaz;
+    çünkü <module>mod_rewrite</module> <code>#</code> karakterini
+    kodlayarak <code>%23</code>'e dönüştürür. Bu da yönlendirmeyi
+    bozar.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p><code>RewriteRule</code> üzerinde <code>[NE]</code> bayrağını
+      kullanın. NE, Kodlama Yapma (No Escape) anlamına gelir.
+      </p>
+    </dd>
+
+    <dt>Tartışma:</dt>
+    <dd>Bu teknik, <module>mod_rewrite</module> modülünün öntanımlı
+    olarak URL-kodladığı diğer özel karakterlerle de çalışacaktır.</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>Zamana Bağlı Yeniden Yazma</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Günün saatine göre farklı içerik sunmak için
+      <module>mod_rewrite</module> kullanmak istiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Yeniden yazma koşulları için <code>TIME_xxx</code> adlı birçok
+      değişken vardır. Özel sözlüksel karşılaştırma kalıpları olan
+      <code>&lt;DİZGE</code>, <code>&gt;DİZGE</code> ve
+      <code>=DİZGE</code> ile birlikte zamana bağlı yönlendirmeler
+      yapabiliriz:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>Bu, <code>foo.html</code> URL'si altında
+      <code>07:01-18:59</code> saatleri arasında
+      <code>foo.day.html</code> içeriğini, geri kalan zamanda ise
+      <code>foo.night.html</code> içeriğini sunar.</p>
+
+      <note type="warning"><module>mod_cache</module>, ara vekiller
+      ve tarayıcıların her biri yanıtları önbelleğe alabilir ve
+      yapılandırılan zaman penceresinin dışında herhangi bir sayfanın
+      gösterilmesine neden olabilir. Bu etkiyi kontrol etmek için
+      <module>mod_expires</module> kullanılabilir. Elbette, içeriği
+      devingen olarak sunmak ve günün saatine göre özelleştirmek çok
+      daha iyidir.</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>URL Parçalarına Göre Ortam Değişkenleri Atama</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Bazen bir yeniden yazma gerçekleştirdiğimizde bir tür durum
+      bilgisi tutmak isteriz. Örneğin, bu yeniden yazmayı yaptığınıza
+      dair bir not almak isteyebilirsiniz; böylece daha sonra bir
+      isteğin bu yeniden yazma yoluyla gelip gelmediğini kontrol
+      edebilirsiniz. Bunu yapmanın bir yolu bir ortam değişkeni
+      ayarlamaktır.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Bir ortam değişkeni ayarlamak için [E] bayrağını kullanın.</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>Daha sonra kural kümenizde bu ortam değişkenini bir RewriteCond
+    kullanarak kontrol edebilirsiniz:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>Ortam değişkenlerinin harici bir yönlendirmeden sonra kalıcı
+    olmadığını unutmayın. [CO] bayrağını kullanarak bir çerez
+    ayarlamayı düşünebilirsiniz. Dizin başına ve htaccess yeniden
+    yazmaları için, son değiştirme dahili bir yönlendirme olarak
+    işlendiğinde, önceki yeniden yazma turundan gelen ortam
+    değişkenlerinin başına "REDIRECT_" eklenir.</p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/advanced.xml.zh-cn b/docs/manual/rewrite/advanced.xml.zh-cn
new file mode 100644 (file)
index 0000000..40eafe1
--- /dev/null
@@ -0,0 +1,336 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="advanced.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite 高级技术</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。
+它提供了一些使用 <module>mod_rewrite</module> 的高级技术。</p>
+
+<!--
+I question whether anything remailing in this document qualifies as
+"advanced". It's probably time to take inventory of the examples that we
+have in the various docs, and consider a reorg of the stuff in this
+directory. Again.
+-->
+
+<note type="warning">请注意,这些示例中的许多不会在你的特定服务器配置中直接生效,
+因此理解它们非常重要,而不仅仅是将示例复制粘贴到你的配置中。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<!--<seealso><a href="advanced.html">高级技术</a></seealso>-->
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="sharding">
+
+  <title>基于 URL 的跨多后端分片</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>一种分配服务器负载或存储空间的常见技术称为"分片"。
+      使用此方法时,前端服务器将使用 URL 将用户或对象一致地"分片"到
+      不同的后端服务器。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>在外部映射文件中维护从用户到目标服务器的映射。
+      它们看起来像:</p>
+
+<example>
+user1  physical_host_of_user1<br />
+user2  physical_host_of_user2<br />
+# ... and so on
+</example>
+
+  <p>我们将其放入 <code>map.users-to-hosts</code> 文件。
+    目标是映射:</p>
+
+<example>
+/u/user1/anypath
+</example>
+
+  <p>到</p>
+
+<example>
+http://physical_host_of_user1/u/user/anypath
+</example>
+
+      <p>这样每个 URL 路径不需要在每个后端物理主机上都有效。
+      以下规则集借助映射文件为我们完成此操作,
+      假设 server0 是在用户在映射中没有条目时使用的默认服务器:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap    users-to-hosts      "txt:/path/to/map.users-to-hosts"
+RewriteRule   "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"
+</highlight>
+    </dd>
+  </dl>
+
+  <p>请参阅 <directive module="mod_rewrite">RewriteMap</directive>
+  文档和 <a href="./rewritemap.html">RewriteMap 指南</a>
+  以了解此指令语法的更多讨论。</p>
+
+</section>
+
+<section id="on-the-fly-content">
+
+  <title>即时内容再生成</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>我们希望动态生成内容,但一旦生成就将其静态存储。
+      此规则将检查静态文件是否存在,如果不存在,则生成它。
+      静态文件可以定期删除(例如通过 cron),
+      并在需要时按需重新生成。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      这通过以下规则集完成:
+
+<highlight language="config">
+# This example is valid in per-directory context only
+RewriteCond "%{REQUEST_URI}"   !-U
+RewriteRule "^(.+)\.html$"     "/regenerate_page.cgi"   [PT,L]
+</highlight>
+
+    <p><code>-U</code> 操作符确定测试字符串(在本例中为
+    <code>REQUEST_URI</code>)是否是有效的 URL。它通过子请求来完成。
+    如果此子请求失败——即请求的资源不存在——此规则将调用 CGI 程序
+    <code>/regenerate_page.cgi</code>,该程序生成请求的资源并将其保存到
+    文档目录中,这样下次请求时就可以提供静态副本了。</p>
+
+    <p>通过这种方式,不经常更新的文档可以以静态形式提供。
+    如果需要刷新文档,可以从文档目录中删除它们,
+    下次请求时将重新生成。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="load-balancing">
+
+  <title>负载均衡</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>我们希望使用 <module>mod_rewrite</module>
+      在多台服务器之间随机分配负载。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们将使用 <directive
+      module="mod_rewrite">RewriteMap</directive> 和服务器列表来实现。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteMap  lb       "rnd:/path/to/serverlist.txt"
+RewriteRule "^/(.*)" "http://${lb:servers}/$1"     [P,L]
+</highlight>
+
+<p><code>serverlist.txt</code> 将包含服务器列表:</p>
+
+<example>
+## serverlist.txt<br />
+<br />
+servers one.example.com|two.example.com|three.example.com<br />
+</example>
+
+<p>如果你希望某台特定服务器承担更多负载,可以在列表中多次添加它。</p>
+
+   </dd>
+
+   <dt>讨论</dt>
+   <dd>
+<p>Apache 自带一个负载均衡模块 -
+<module>mod_proxy_balancer</module> - 它比你使用
+<module>mod_rewrite</module> 拼凑出来的任何方案都更加灵活和功能丰富。</p>
+   </dd>
+  </dl>
+
+</section>
+
+<section id="structuredhomedirs">
+
+  <title>结构化用户目录</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>一些拥有数千用户的站点使用结构化的主目录布局,
+      <em>即</em>每个主目录位于一个子目录中,
+      该子目录以用户名的第一个字符开头。因此,
+      <code>/~larry/anypath</code> 是
+      <code>/home/<strong>l</strong>/larry/public_html/anypath</code>,
+      而 <code>/~waldo/anypath</code> 是
+      <code>/home/<strong>w</strong>/waldo/public_html/anypath</code>。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们使用以下规则集将波浪号 URL 展开为上述布局。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/~(<strong>([a-z])</strong>[a-z0-9]+)(.*)"  "/home/<strong>$2</strong>/$1/public_html$3"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="redirectanchors">
+
+  <title>重定向锚点</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+    <p>默认情况下,重定向到 HTML 锚点不起作用,因为
+    <module>mod_rewrite</module> 会转义 <code>#</code> 字符,
+    将其变为 <code>%23</code>。这反过来会破坏重定向。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>在 <code>RewriteRule</code> 上使用 <code>[NE]</code> 标志。
+      NE 代表不转义(No Escape)。
+      </p>
+    </dd>
+
+    <dt>讨论:</dt>
+    <dd>此技术当然也适用于 <module>mod_rewrite</module>
+    默认会进行 URL 编码的其他特殊字符。</dd>
+  </dl>
+
+</section>
+
+<section id="time-dependent">
+
+  <title>基于时间的重写</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>我们希望使用 <module>mod_rewrite</module>
+      根据一天中的时间提供不同的内容。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>有许多名为 <code>TIME_xxx</code>
+      的变量可用于重写条件。结合特殊的词法比较模式
+      <code>&lt;STRING</code>、<code>&gt;STRING</code> 和
+      <code>=STRING</code>,我们可以进行基于时间的重定向:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &gt;0700
+RewriteCond   "%{TIME_HOUR}%{TIME_MIN}" &lt;1900
+RewriteRule   "^foo\.html$"             "foo.day.html" [L]
+RewriteRule   "^foo\.html$"             "foo.night.html"
+</highlight>
+
+      <p>这将在 <code>07:01-18:59</code> 时间段内,以 URL
+      <code>foo.html</code> 提供 <code>foo.day.html</code> 的内容,
+      在其余时间提供 <code>foo.night.html</code> 的内容。</p>
+
+      <note type="warning"><module>mod_cache</module>、中间代理和浏览器
+      可能各自缓存响应,导致在配置的时间窗口之外显示某个页面。
+      可以使用 <module>mod_expires</module> 来控制此效果。
+      当然,动态提供内容并根据时间自定义它是更好的方式。</note>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="setenvvars">
+
+  <title>根据 URL 部分设置环境变量</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>有时,我们希望在执行重写时保持某种状态。例如,
+      你想记录你已完成该重写,以便稍后检查请求是否通过该重写。
+      一种方法是设置环境变量。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>使用 [E] 标志设置环境变量。</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/horse/(.*)"   "/pony/$1" [E=<strong>rewritten:1</strong>]
+</highlight>
+
+    <p>稍后在你的规则集中,你可以使用 RewriteCond 检查此环境变量:</p>
+
+<highlight language="config">
+RewriteCond "%{ENV:rewritten}"  =1
+</highlight>
+
+    <p>请注意,环境变量在外部重定向后不会保留。你可以考虑使用 [CO]
+    标志来设置 cookie。对于目录级和 htaccess 重写,
+    当最终替换作为内部重定向处理时,上一轮重写的环境变量会以
+    "REDIRECT_" 为前缀。</p>
+
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/avoid.xml.de b/docs/manual/rewrite/avoid.xml.de
new file mode 100644 (file)
index 0000000..a67e1c4
--- /dev/null
@@ -0,0 +1,251 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Wann man mod_rewrite nicht verwenden sollte</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt
+vielleicht eines der wichtigsten Konzepte bezüglich <module>mod_rewrite</module> -
+nämlich, wann man es vermeiden sollte.</p>
+
+<p><module>mod_rewrite</module> sollte als letzter Ausweg betrachtet werden, wenn andere
+Alternativen nicht ausreichen. Die Verwendung, wenn einfachere
+Alternativen existieren, führt zu Konfigurationen, die verwirrend, fragil und
+schwer zu warten sind. Das Verständnis der verfügbaren Alternativen ist
+ein sehr wichtiger Schritt zur Beherrschung von <module>mod_rewrite</module>.</p>
+
+<p>Beachten Sie, dass viele dieser Beispiele nicht unverändert in Ihrer
+speziellen Serverkonfiguration funktionieren werden. Es ist daher wichtig,
+dass Sie sie verstehen, anstatt die Beispiele einfach auszuschneiden und
+in Ihre Konfiguration einzufügen.</p>
+
+<p>Die häufigste Situation, in der <module>mod_rewrite</module> das
+richtige Werkzeug ist, ist wenn die allerbeste Lösung Zugriff auf die
+Serverkonfigurationsdateien erfordert und Sie diesen Zugriff nicht haben.
+Einige Konfigurationsdirektiven sind nur in der Serverkonfigurationsdatei
+verfügbar. Wenn Sie sich in einer Hosting-Situation befinden, in der Sie
+nur mit .htaccess-Dateien arbeiten können, müssen Sie möglicherweise auf
+<module>mod_rewrite</module> zurückgreifen.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<!--<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>-->
+
+<section id="redirect">
+<title>Einfache Umleitung</title>
+
+<p><module>mod_alias</module> stellt die Direktiven <directive
+module="mod_alias">Redirect</directive> und <directive
+module="mod_alias">RedirectMatch</directive> bereit, die eine Möglichkeit
+bieten, eine URL zu einer anderen umzuleiten. Diese Art der einfachen
+Umleitung einer URL oder einer Klasse von URLs an einen anderen Ort sollte
+mit diesen Direktiven und nicht mit <directive
+module="mod_rewrite">RewriteRule</directive> erfolgen. <code>RedirectMatch</code>
+ermöglicht es Ihnen, einen regulären Ausdruck in Ihre Umleitungskriterien
+einzubinden, was viele der Vorteile der Verwendung von
+<code>RewriteRule</code> bietet.</p>
+
+<p>Eine häufige Verwendung von <code>RewriteRule</code> ist die Umleitung
+einer ganzen Klasse von URLs. Beispielsweise müssen alle URLs im Verzeichnis
+<code>/one</code> nach <code>http://one.example.com/</code> umgeleitet werden,
+oder alle <code>http</code>-Anfragen müssen nach <code>https</code>
+umgeleitet werden.</p>
+
+<p>Diese Situationen werden besser mit der <code>Redirect</code>-Direktive
+behandelt. Denken Sie daran, dass <code>Redirect</code> Pfadinformationen
+beibehält. Das heißt, eine Umleitung für die URL <code>/one</code>
+wird auch alle darunter liegenden URLs umleiten, wie
+<code>/one/two.html</code> und <code>/one/three/four.html</code>.</p>
+
+<p>Um URLs unter <code>/one</code> nach
+<code>http://one.example.com</code> umzuleiten, tun Sie Folgendes:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>Um einen Hostnamen zu einem anderen umzuleiten, beispielsweise
+<code>example.com</code> zu <code>www.example.com</code>, siehe das
+Rezept für <a href="remapping.html#canonicalhost">kanonische Hostnamen</a>.</p>
+
+<p>Um <code>http</code>-URLs nach <code>https</code> umzuleiten, tun Sie
+Folgendes:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... SSL-Konfiguration hier
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>Die Verwendung von <code>RewriteRule</code> für diese Aufgabe kann
+angemessen sein, wenn andere <code>RewriteRule</code>-Direktiven im
+selben Geltungsbereich vorhanden sind. Dies liegt daran, dass bei
+<code>Redirect</code>- und <code>RewriteRule</code>-Direktiven im selben
+Geltungsbereich die <code>RewriteRule</code>-Direktiven immer zuerst
+ausgeführt werden, unabhängig von der Reihenfolge in der
+Konfigurationsdatei.</p>
+
+<p>Im Fall der <em>http-zu-https</em>-Umleitung wäre die Verwendung
+von <code>RewriteRule</code> angemessen, wenn Sie keinen Zugriff auf die
+Hauptserverkonfigurationsdatei haben und diese Aufgabe stattdessen in einer
+<code>.htaccess</code>-Datei erledigen müssen.</p>
+
+</section>
+
+<section id="alias"><title>URL-Aliasing</title>
+<p>Die <directive module="mod_alias">Alias</directive>-Direktive bietet
+eine Zuordnung von einem URI zu einem Verzeichnis - normalerweise einem
+Verzeichnis außerhalb Ihres <directive module="core">DocumentRoot</directive>.
+Obwohl es möglich ist, diese Zuordnung mit <module>mod_rewrite</module>
+durchzuführen, ist <directive module="mod_alias">Alias</directive> aus Gründen
+der Einfachheit und Leistung die bevorzugte Methode.</p>
+
+<example><title>Verwendung von Alias</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+Die Verwendung von <module>mod_rewrite</module> für diese Zuordnung kann
+angemessen sein, wenn Sie keinen Zugriff auf die Serverkonfigurationsdateien
+haben. Alias kann nur im Server- oder VirtualHost-Kontext verwendet werden
+und nicht in einer <code>.htaccess</code>-Datei.
+</p>
+
+<p>Symbolische Links wären eine weitere Möglichkeit, dasselbe zu erreichen,
+wenn Sie <code>Options FollowSymLinks</code> auf Ihrem Server aktiviert
+haben.</p>
+</section>
+
+<section id="vhosts"><title>Virtuelles Hosting</title>
+<p>Obwohl es möglich ist, <a href="vhosts.html">virtuelle Hosts
+mit mod_rewrite</a> zu verwalten, ist dies selten der richtige Weg. Das
+Erstellen einzelner <directive module="core" type="section">VirtualHost</directive>-Blöcke
+ist fast immer der richtige Ansatz. Falls Sie eine enorme Anzahl virtueller
+Hosts haben, erwägen Sie die Verwendung von
+<module>mod_vhost_alias</module>, um diese Hosts automatisch zu erstellen.</p>
+
+<p>Module wie <module>mod_macro</module> sind ebenfalls nützlich, um eine
+große Anzahl virtueller Hosts dynamisch zu erstellen.</p>
+
+<p>Die Verwendung von <module>mod_rewrite</module> für die Erstellung
+virtueller Hosts kann angemessen sein, wenn Sie einen Hosting-Dienst
+verwenden, der Ihnen keinen Zugriff auf die Serverkonfigurationsdateien
+gewährt und Sie daher auf die Konfiguration mittels
+<code>.htaccess</code>-Dateien beschränkt sind.</p>
+
+<p>Siehe das Dokument <a href="vhosts.html">Virtuelle Hosts mit mod_rewrite</a>
+für weitere Details, wie Sie dies erreichen können, wenn es Ihnen immer
+noch als der richtige Ansatz erscheint.</p>
+
+</section>
+
+<section id="proxy"><title>Einfaches Proxying</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> bietet das <a
+href="flags.html#flag_p">[P]</a>-Flag, um umgeschriebene URIs über
+<module>mod_proxy</module> weiterzuleiten.</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>In vielen Fällen jedoch, wenn kein tatsächlicher Musterabgleich
+erforderlich ist, wie im obigen Beispiel, ist die <directive
+module="mod_proxy">ProxyPass</directive>-Direktive die bessere Wahl.
+Das Beispiel hier könnte wie folgt dargestellt werden:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>Beachten Sie, dass Sie unabhängig davon, ob Sie <directive
+module="mod_rewrite">RewriteRule</directive> oder <directive
+module="mod_proxy">ProxyPass</directive> verwenden, die
+<directive module="mod_proxy">ProxyPassReverse</directive>-Direktive
+benötigen, um Umleitungen vom Backend-Server korrekt weiterzuleiten:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>Sie müssen möglicherweise stattdessen <code>RewriteRule</code> verwenden,
+wenn andere <code>RewriteRule</code>s im selben Geltungsbereich aktiv sind,
+da eine <code>RewriteRule</code> in der Regel vor einem
+<code>ProxyPass</code> wirksam wird und somit das gewünschte Ergebnis
+vorwegnehmen kann.</p>
+
+</section>
+
+<section id="setenv"><title>Test von Umgebungsvariablen</title>
+
+<p><module>mod_rewrite</module> wird häufig verwendet, um eine bestimmte
+Aktion basierend auf dem Vorhandensein oder Fehlen einer bestimmten
+Umgebungsvariable oder eines Anfrage-Headers durchzuführen. Dies kann
+effizienter mit der <directive module="core" type="section">If</directive>-Direktive
+erreicht werden.</p>
+
+<p>Betrachten Sie beispielsweise das häufige Szenario, in dem
+<directive>RewriteRule</directive> verwendet wird, um einen kanonischen
+Hostnamen zu erzwingen, wie <code>www.example.com</code> anstelle von
+<code>example.com</code>. Dies kann mit der <directive
+module="core" type="section">If</directive>-Direktive wie hier gezeigt
+erreicht werden:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>Diese Technik kann verwendet werden, um Aktionen basierend auf jedem
+beliebigen Anfrage-Header, Antwort-Header oder Umgebungsvariable
+durchzuführen und <module>mod_rewrite</module> in vielen gängigen
+Szenarien zu ersetzen.</p>
+
+<p>Siehe insbesondere die <a href="../expr.html">Dokumentation zur
+Ausdrucksauswertung</a> für einen Überblick darüber, welche Arten von
+Ausdrücken Sie in <directive module="core" type="section">If</directive>-Abschnitten
+und in bestimmten anderen Direktiven verwenden können.</p>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/avoid.xml.es b/docs/manual/rewrite/avoid.xml.es
new file mode 100644 (file)
index 0000000..7608538
--- /dev/null
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Cuándo no usar mod_rewrite</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+quizás uno de los conceptos más importantes sobre <module>mod_rewrite</module> - concretamente,
+cuándo evitar usarlo.</p>
+
+<p><module>mod_rewrite</module> debería considerarse como último recurso, cuando otras
+alternativas resultan insuficientes. Usarlo cuando hay alternativas más simples
+lleva a configuraciones que son confusas, frágiles y
+difíciles de mantener. Entender qué otras alternativas están disponibles es
+un paso muy importante hacia el dominio de <module>mod_rewrite</module>.</p>
+
+<p>Tenga en cuenta que muchos de estos ejemplos no funcionarán sin cambios en su
+configuración particular del servidor, por lo que es importante que los
+entienda, en lugar de simplemente copiar y pegar los ejemplos en su
+configuración.</p>
+
+<p>La situación más común en la que <module>mod_rewrite</module> es
+la herramienta correcta es cuando la mejor solución requiere acceso a los
+archivos de configuración del servidor, y usted no tiene ese acceso. Algunas
+directivas de configuración solo están disponibles en el archivo de configuración
+del servidor. Así que si está en una situación de alojamiento donde solo tiene archivos .htaccess
+con los que trabajar, puede necesitar recurrir a
+<module>mod_rewrite</module>.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<!--<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>-->
+
+<section id="redirect">
+<title>Redirección Simple</title>
+
+<p><module>mod_alias</module> proporciona las directivas <directive
+module="mod_alias">Redirect</directive> y <directive
+module="mod_alias">RedirectMatch</directive>, que proporcionan un
+medio para redirigir una URL a otra. Este tipo de redirección simple de
+una URL, o una clase de URLs, a otro lugar, debería realizarse
+usando estas directivas en lugar de <directive
+module="mod_rewrite">RewriteRule</directive>. <code>RedirectMatch</code>
+le permite incluir una expresión regular en sus criterios de redirección,
+proporcionando muchos de los beneficios de usar <code>RewriteRule</code>.</p>
+
+<p>Un uso común de <code>RewriteRule</code> es redirigir toda una
+clase de URLs. Por ejemplo, todas las URLs en el directorio <code>/one</code>
+deben ser redirigidas a <code>http://one.example.com/</code>, o quizás
+todas las solicitudes <code>http</code> deben ser redirigidas a
+<code>https</code>.</p>
+
+<p>Estas situaciones se manejan mejor con la directiva <code>Redirect</code>.
+Recuerde que <code>Redirect</code> preserva la información de
+ruta. Es decir, una redirección para una URL <code>/one</code> también
+redirigirá todas las URLs bajo ella, como <code>/one/two.html</code>
+y <code>/one/three/four.html</code>.</p>
+
+<p>Para redirigir URLs bajo <code>/one</code> a
+<code>http://one.example.com</code>, haga lo siguiente:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>Para redirigir un nombre de host a otro, por ejemplo
+<code>example.com</code> a <code>www.example.com</code>, vea la
+receta de <a href="remapping.html#canonicalhost">Nombres de Host Canónicos</a>.</p>
+
+<p>Para redirigir URLs <code>http</code> a <code>https</code>, haga lo
+siguiente:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... la configuración SSL va aquí
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>El uso de <code>RewriteRule</code> para realizar esta tarea puede ser
+apropiado si hay otras directivas <code>RewriteRule</code> en
+el mismo ámbito. Esto se debe a que, cuando hay directivas <code>Redirect</code>
+y <code>RewriteRule</code> en el mismo ámbito, las
+directivas <code>RewriteRule</code> se ejecutarán primero, independientemente del
+orden de aparición en el archivo de configuración.</p>
+
+<p>En el caso de la redirección de <em>http-a-https</em>, el uso de
+<code>RewriteRule</code> sería apropiado si no tiene acceso
+al archivo de configuración principal del servidor, y está obligado a realizar esta
+tarea en un archivo <code>.htaccess</code> en su lugar.</p>
+
+</section>
+
+<section id="alias"><title>Alias de URL</title>
+<p>La directiva <directive module="mod_alias">Alias</directive>
+proporciona mapeo de un URI a un directorio - generalmente un directorio fuera
+de su <directive module="core">DocumentRoot</directive>. Aunque es
+posible realizar este mapeo con <module>mod_rewrite</module>,
+<directive module="mod_alias">Alias</directive> es el método preferido, por
+razones de simplicidad y rendimiento.</p>
+
+<example><title>Usando Alias</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+El uso de <module>mod_rewrite</module> para realizar este mapeo puede ser
+apropiado cuando no tiene acceso a los archivos de configuración
+del servidor. Alias solo puede usarse en contexto de servidor o virtualhost, y no
+en un archivo <code>.htaccess</code>.
+</p>
+
+<p>Los enlaces simbólicos serían otra forma de lograr lo mismo, si
+tiene <code>Options FollowSymLinks</code> habilitado en su
+servidor.</p>
+</section>
+
+<section id="vhosts"><title>Alojamiento Virtual</title>
+<p>Aunque es posible manejar <a href="vhosts.html">hosts virtuales
+con mod_rewrite</a>, rara vez es la forma correcta. Crear bloques
+<directive module="core" type="section">VirtualHost</directive> individuales es
+casi siempre la forma correcta de proceder. En el
+caso de que tenga un número enorme de hosts virtuales, considere usar
+<module>mod_vhost_alias</module> para crear estos hosts automáticamente.</p>
+
+<p>Módulos como <module>mod_macro</module> también son
+útiles para crear un gran número de hosts virtuales dinámicamente.</p>
+
+<p>Usar <module>mod_rewrite</module> para la creación de hosts virtuales puede ser
+apropiado si está usando un servicio de alojamiento que no le proporciona
+acceso a los archivos de configuración del servidor, y por lo tanto está
+restringido a la configuración usando archivos <code>.htaccess</code>.</p>
+
+<p>Vea el documento de <a href="vhosts.html">hosts virtuales con mod_rewrite</a>
+para más detalles sobre cómo podría lograr esto si aún
+parece ser el enfoque correcto.</p>
+
+</section>
+
+<section id="proxy"><title>Proxy Simple</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> proporciona la bandera <a
+href="flags.html#flag_p">[P]</a> para pasar URIs reescritas a través de
+<module>mod_proxy</module>.</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>Sin embargo, en muchos casos, cuando no hay necesidad real de coincidencia
+de patrones, como en el ejemplo mostrado arriba, la directiva <directive
+module="mod_proxy">ProxyPass</directive> es una mejor opción.
+El ejemplo aquí podría expresarse como:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>Tenga en cuenta que ya sea que use <directive
+module="mod_rewrite">RewriteRule</directive> o <directive
+module="mod_proxy">ProxyPass</directive>, todavía necesitará usar la
+directiva <directive module="mod_proxy">ProxyPassReverse</directive> para
+capturar redirecciones emitidas por el servidor backend:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>Puede necesitar usar <code>RewriteRule</code> en su lugar cuando hay
+otras <code>RewriteRule</code>s en efecto en el mismo ámbito, ya que una
+<code>RewriteRule</code> generalmente tendrá efecto antes que un
+<code>ProxyPass</code>, y por lo tanto puede anticiparse a lo que está intentando
+lograr.</p>
+
+</section>
+
+<section id="setenv"><title>Prueba de Variables de Entorno</title>
+
+<p><module>mod_rewrite</module> se usa frecuentemente para tomar una acción particular
+basada en la presencia o ausencia de una variable de entorno particular
+o cabecera de solicitud. Esto puede hacerse de manera más eficiente usando la
+directiva <directive module="core" type="section">If</directive>.</p>
+
+<p>Considere, por ejemplo, el escenario común donde
+<directive>RewriteRule</directive> se usa para imponer un nombre de
+host canónico, como <code>www.example.com</code> en lugar de
+<code>example.com</code>. Esto puede hacerse usando la directiva <directive
+module="core" type="section">If</directive>, como se muestra aquí:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>Esta técnica puede usarse para tomar acciones basadas en cualquier cabecera de
+solicitud, cabecera de respuesta o variable de entorno, reemplazando
+<module>mod_rewrite</module> en muchos escenarios comunes.</p>
+
+<p>Vea especialmente la <a href="../expr.html">documentación de evaluación
+de expresiones</a> para una visión general de qué tipos de expresiones puede
+usar en secciones <directive module="core" type="section">If</directive>,
+y en ciertas otras directivas.</p>
+
+</section>
+
+</manualpage>
index 0024b2189b52c418757bcef5661714fbe5550e1f..13cd4a7f25324005ca16f3771f0eae53002dcd14 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1872293:1933071 (outdated) -->
+<!-- English Revision: 1933071 -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
@@ -100,7 +100,7 @@ rediriger toutes les URLs de niveaux inférieurs comme
 <code>http://un.example.com/</code>, utilisez cette définition :</p>
 
 <highlight language="config">
-Redirect /one/ http://one.example.com/
+Redirect "/one/" "http://one.example.com/"
 </highlight>
 
 <p>Pour rediriger un nom d'hôte vers un autre nom d'hôte, par exemple
@@ -112,13 +112,13 @@ utilisez cette définition :</p>
 
 <highlight language="config">
 &lt;VirtualHost *:80&gt;
-ServerName www.example.com
-Redirect "/" "https://www.example.com/"
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
 &lt;/VirtualHost&gt;
 
 &lt;VirtualHost *:443&gt;
-ServerName www.example.com
- ... insérer ici la configuration SSL
+    ServerName www.example.com
+    # ... insérer ici la configuration SSL
 &lt;/VirtualHost&gt;
 </highlight>
 
@@ -247,7 +247,7 @@ suit :</p>
 
 <highlight language="config">
 &lt;If "req('Host') != 'www.example.com'"&gt;
-    Redirect "/" "http://www.example.com"
+    Redirect "/" "http://www.example.com/"
 &lt;/If&gt;
 </highlight>
 
@@ -265,4 +265,3 @@ ainsi que dans certaines directives.</p>
 </section>
 
 </manualpage>
-
diff --git a/docs/manual/rewrite/avoid.xml.ja b/docs/manual/rewrite/avoid.xml.ja
new file mode 100644 (file)
index 0000000..2226b0d
--- /dev/null
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite を使わない場合</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> について最も重要な概念の一つ、
+すなわち、いつ使用を避けるべきかについて説明します。</p>
+
+<p><module>mod_rewrite</module> は、他の代替手段が不十分な場合の最後の手段と
+考えるべきです。よりシンプルな代替手段がある場合に使用すると、
+設定が混乱しやすく、壊れやすく、メンテナンスしにくくなります。
+他にどのような代替手段が利用できるかを理解することは、
+<module>mod_rewrite</module> を習得するための非常に重要なステップです。</p>
+
+<p>これらの例の多くは、特定のサーバ設定ではそのまま動作しないことに
+注意してください。そのため、単にコピー&ペーストするのではなく、
+内容を理解することが重要です。</p>
+
+<p><module>mod_rewrite</module> が適切なツールである最も一般的な状況は、
+最善の解決策がサーバ設定ファイルへのアクセスを必要とし、そのアクセスが
+ない場合です。一部の設定ディレクティブはサーバ設定ファイルでのみ
+使用可能です。そのため、.htaccess ファイルのみを使用できるホスティング
+環境にいる場合は、<module>mod_rewrite</module> に頼る必要があるかもしれません。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<!--<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>-->
+
+<section id="redirect">
+<title>シンプルなリダイレクト</title>
+
+<p><module>mod_alias</module> は、ある URL から別の URL へのリダイレクト手段を
+提供する <directive module="mod_alias">Redirect</directive> および <directive
+module="mod_alias">RedirectMatch</directive> ディレクティブを提供します。
+この種の、ある URL または URL のクラスを別の場所へのシンプルなリダイレクトは、
+<directive module="mod_rewrite">RewriteRule</directive> ではなく、これらの
+ディレクティブを使用して行うべきです。<code>RedirectMatch</code> では
+リダイレクト基準に正規表現を含めることができ、<code>RewriteRule</code> を
+使用する利点の多くを享受できます。</p>
+
+<p><code>RewriteRule</code> の一般的な使用法は、URL のクラス全体を
+リダイレクトすることです。例えば、<code>/one</code> ディレクトリのすべての
+URL を <code>http://one.example.com/</code> にリダイレクトする必要がある場合や、
+すべての <code>http</code> リクエストを <code>https</code> に
+リダイレクトする必要がある場合などです。</p>
+
+<p>これらの状況は <code>Redirect</code> ディレクティブで処理する方が
+適切です。<code>Redirect</code> はパス情報を保持することを忘れないでください。
+つまり、URL <code>/one</code> のリダイレクトは、<code>/one/two.html</code>
+や <code>/one/three/four.html</code> など、その配下のすべての URL も
+リダイレクトします。</p>
+
+<p><code>/one</code> 配下の URL を
+<code>http://one.example.com</code> にリダイレクトするには、
+以下のようにします:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>あるホスト名から別のホスト名にリダイレクトするには、例えば
+<code>example.com</code> を <code>www.example.com</code> にリダイレクトするには、
+<a href="remapping.html#canonicalhost">正規ホスト名</a>
+のレシピを参照してください。</p>
+
+<p><code>http</code> URL を <code>https</code> にリダイレクトするには、
+以下のようにします:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... SSL 設定をここに記述
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>同じスコープに他の <code>RewriteRule</code> ディレクティブがある場合は、
+このタスクに <code>RewriteRule</code> を使用するのが適切な場合があります。
+これは、同じスコープに <code>Redirect</code> と <code>RewriteRule</code>
+ディレクティブがある場合、設定ファイルでの出現順序に関係なく、
+<code>RewriteRule</code> ディレクティブが先に実行されるためです。</p>
+
+<p><em>http から https への</em>リダイレクトの場合、メインサーバ設定ファイルに
+アクセスできず、<code>.htaccess</code> ファイルでこのタスクを実行する必要がある
+場合は、<code>RewriteRule</code> の使用が適切です。</p>
+
+</section>
+
+<section id="alias"><title>URL エイリアス</title>
+<p><directive module="mod_alias">Alias</directive> ディレクティブは、
+URI からディレクトリ (通常は <directive module="core">DocumentRoot</directive>
+の外部のディレクトリ) へのマッピングを提供します。このマッピングを
+<module>mod_rewrite</module> で行うことは可能ですが、シンプルさとパフォーマンスの
+理由から <directive module="mod_alias">Alias</directive> が推奨される
+方法です。</p>
+
+<example><title>Alias の使用</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+サーバ設定ファイルにアクセスできない場合に、このマッピングを行うために
+<module>mod_rewrite</module> を使用するのが適切な場合があります。Alias は
+サーバまたはバーチャルホストのコンテキストでのみ使用でき、
+<code>.htaccess</code> ファイルでは使用できません。
+</p>
+
+<p>サーバで <code>Options FollowSymLinks</code> が有効になっている場合は、
+シンボリックリンクも同じことを実現する方法の一つです。</p>
+</section>
+
+<section id="vhosts"><title>バーチャルホスティング</title>
+<p><a href="vhosts.html">mod_rewrite でバーチャルホスト</a>を
+処理することは可能ですが、適切な方法であることはめったにありません。
+個別の <directive module="core" type="section">VirtualHost</directive>
+ブロックを作成するのがほぼ常に正しい方法です。非常に多数のバーチャルホストが
+ある場合は、<module>mod_vhost_alias</module> を使用してこれらのホストを
+自動的に作成することを検討してください。</p>
+
+<p><module>mod_macro</module> などのモジュールも、
+多数のバーチャルホストを動的に作成するのに便利です。</p>
+
+<p>ホスティングサービスがサーバ設定ファイルへのアクセスを提供せず、
+<code>.htaccess</code> ファイルを使用した設定に制限されている場合は、
+バーチャルホスト作成に <module>mod_rewrite</module> を使用するのが
+適切な場合があります。</p>
+
+<p>それでも適切なアプローチと思われる場合に、これをどのように実現
+するかの詳細については、<a href="vhosts.html">mod_rewrite による
+バーチャルホスト</a>ドキュメントを参照してください。</p>
+
+</section>
+
+<section id="proxy"><title>シンプルなプロキシ</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> は、書き換えた URI を
+<module>mod_proxy</module> 経由で渡すための <a href="flags.html#flag_p">[P]</a>
+フラグを提供します。</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>ただし、上の例のように実際のパターンマッチングが不要な場合は、
+<directive module="mod_proxy">ProxyPass</directive> ディレクティブの方が
+適切な選択です。上の例は以下のように記述できます:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> と <directive
+module="mod_proxy">ProxyPass</directive> のどちらを使用する場合でも、
+バックエンドサーバから発行されるリダイレクトをキャッチするために
+<directive module="mod_proxy">ProxyPassReverse</directive> ディレクティブを
+使用する必要があることに注意してください:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>同じスコープで他の <code>RewriteRule</code> が有効な場合は、
+<code>RewriteRule</code> は通常 <code>ProxyPass</code> よりも先に適用されるため、
+実現しようとしていることを横取りする可能性があり、代わりに
+<code>RewriteRule</code> を使用する必要がある場合があります。</p>
+
+</section>
+
+<section id="setenv"><title>環境変数のテスト</title>
+
+<p><module>mod_rewrite</module> は、特定の環境変数やリクエストヘッダの
+有無に基づいて特定のアクションを実行するために頻繁に使用されます。
+これは <directive module="core" type="section">If</directive>
+ディレクティブを使用してより効率的に行えます。</p>
+
+<p>例えば、正規ホスト名を強制するために <directive>RewriteRule</directive>
+を使用する一般的なシナリオ、つまり <code>example.com</code> の代わりに
+<code>www.example.com</code> を使用させるシナリオを考えてみましょう。
+これは、次に示すように <directive module="core" type="section">If</directive>
+ディレクティブを使用して行えます:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>このテクニックは、任意のリクエストヘッダ、レスポンスヘッダ、または
+環境変数に基づいてアクションを実行するために使用でき、多くの一般的な
+シナリオで <module>mod_rewrite</module> を置き換えることができます。</p>
+
+<p>特に <directive module="core" type="section">If</directive> セクションや
+その他の特定のディレクティブで使用できる式の種類の概要については、
+<a href="../expr.html">式の評価ドキュメント</a>を参照してください。</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/avoid.xml.ko b/docs/manual/rewrite/avoid.xml.ko
new file mode 100644 (file)
index 0000000..cfdb395
--- /dev/null
@@ -0,0 +1,252 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite를 사용하지 말아야 할 경우</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module>에 대한 가장 중요한 개념 중 하나,
+즉 사용을 피해야 할 때를 설명합니다.</p>
+
+<p><module>mod_rewrite</module>는 다른 대안이 부족할 때 최후의
+수단으로 고려해야 합니다. 더 간단한 대안이 있을 때 이를
+사용하면 혼란스럽고 취약하며 유지 관리하기 어려운 설정이
+됩니다. 어떤 다른 대안이 가능한지 이해하는 것은
+<module>mod_rewrite</module> 숙달을 위한 매우 중요한
+단계입니다.</p>
+
+<p>이 예제들 중 많은 것이 특정 서버 설정에서 그대로
+작동하지 않을 수 있으므로, 단순히 예제를 복사하여 설정에
+붙여넣기보다는 이해하는 것이 중요합니다.</p>
+
+<p><module>mod_rewrite</module>가 올바른 도구인 가장 일반적인
+상황은 최선의 해결책이 서버 설정 파일에 대한 접근을
+필요로 하지만 그 접근 권한이 없는 경우입니다. 일부 설정
+지시어는 서버 설정 파일에서만 사용할 수 있습니다. 따라서
+.htaccess 파일만 사용할 수 있는 호스팅 환경에 있다면
+<module>mod_rewrite</module>에 의존해야 할 수 있습니다.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<!--<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>-->
+
+<section id="redirect">
+<title>단순 리다이렉션</title>
+
+<p><module>mod_alias</module>는 <directive
+module="mod_alias">Redirect</directive>와 <directive
+module="mod_alias">RedirectMatch</directive> 지시어를 제공하며,
+하나의 URL을 다른 URL로 리다이렉트하는 수단을 제공합니다.
+하나의 URL 또는 URL 클래스를 다른 곳으로 이러한 종류의
+단순 리다이렉션은 <directive
+module="mod_rewrite">RewriteRule</directive> 대신 이 지시어를
+사용하여 수행해야 합니다. <code>RedirectMatch</code>를 사용하면
+리다이렉션 기준에 정규 표현식을 포함할 수 있어
+<code>RewriteRule</code> 사용의 많은 이점을 제공합니다.</p>
+
+<p><code>RewriteRule</code>의 일반적인 용도는 전체 URL 클래스를
+리다이렉트하는 것입니다. 예를 들어, <code>/one</code> 디렉토리의
+모든 URL을 <code>http://one.example.com/</code>으로
+리다이렉트하거나, 모든 <code>http</code> 요청을
+<code>https</code>로 리다이렉트해야 할 수 있습니다.</p>
+
+<p>이러한 상황은 <code>Redirect</code> 지시어로 더 잘 처리됩니다.
+<code>Redirect</code>는 경로 정보를 보존한다는 것을
+기억하십시오. 즉, URL <code>/one</code>에 대한 리다이렉트는
+<code>/one/two.html</code> 및
+<code>/one/three/four.html</code>과 같은 그 아래의 모든
+URL도 리다이렉트합니다.</p>
+
+<p><code>/one</code> 아래의 URL을
+<code>http://one.example.com</code>으로 리다이렉트하려면
+다음과 같이 하십시오:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>하나의 호스트명을 다른 것으로 리다이렉트하려면, 예를 들어
+<code>example.com</code>을 <code>www.example.com</code>으로,
+<a href="remapping.html#canonicalhost">정규 호스트명</a>
+레시피를 참조하십시오.</p>
+
+<p><code>http</code> URL을 <code>https</code>로
+리다이렉트하려면 다음과 같이 하십시오:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... SSL 설정은 여기에
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>같은 범위에 다른 <code>RewriteRule</code> 지시어가 있는
+경우 이 작업을 수행하기 위해 <code>RewriteRule</code>을
+사용하는 것이 적절할 수 있습니다. 이는 같은 범위에
+<code>Redirect</code>와 <code>RewriteRule</code> 지시어가
+있을 때 설정 파일의 순서에 관계없이 <code>RewriteRule</code>
+지시어가 먼저 실행되기 때문입니다.</p>
+
+<p><em>http에서 https로의</em> 리다이렉션의 경우, 주 서버
+설정 파일에 접근할 수 없고 <code>.htaccess</code> 파일에서
+이 작업을 수행해야 하는 경우 <code>RewriteRule</code> 사용이
+적절합니다.</p>
+
+</section>
+
+<section id="alias"><title>URL 별칭 지정</title>
+<p><directive module="mod_alias">Alias</directive> 지시어는
+URI에서 디렉토리로의 매핑을 제공하며, 보통
+<directive module="core">DocumentRoot</directive> 외부의
+디렉토리입니다. <module>mod_rewrite</module>로 이 매핑을
+수행할 수 있지만, 단순성과 성능의 이유로
+<directive module="mod_alias">Alias</directive>가 선호되는
+방법입니다.</p>
+
+<example><title>Alias 사용</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+서버 설정 파일에 접근할 수 없는 경우 이 매핑을 수행하기 위해
+<module>mod_rewrite</module>를 사용하는 것이 적절할 수 있습니다.
+Alias는 서버 또는 가상호스트 컨텍스트에서만 사용할 수 있으며
+<code>.htaccess</code> 파일에서는 사용할 수 없습니다.
+</p>
+
+<p>서버에서 <code>Options FollowSymLinks</code>가 활성화되어
+있다면 심볼릭 링크도 같은 것을 달성하는 또 다른 방법이
+될 수 있습니다.</p>
+</section>
+
+<section id="vhosts"><title>가상 호스팅</title>
+<p><a href="vhosts.html">mod_rewrite로 가상 호스트</a>를
+처리할 수 있지만, 올바른 방법은 거의 아닙니다. 개별
+<directive module="core" type="section">VirtualHost</directive>
+블록을 만드는 것이 거의 항상 올바른 방법입니다. 가상 호스트가
+매우 많은 경우 이러한 호스트를 자동으로 생성하기 위해
+<module>mod_vhost_alias</module> 사용을 고려하십시오.</p>
+
+<p><module>mod_macro</module>와 같은 모듈도 대량의 가상
+호스트를 동적으로 생성하는 데 유용합니다.</p>
+
+<p>서버 설정 파일에 대한 접근 권한을 제공하지 않는 호스팅
+서비스를 사용하고 있어 <code>.htaccess</code> 파일을 사용한
+설정으로 제한되는 경우 가상호스트 생성에
+<module>mod_rewrite</module>를 사용하는 것이 적절할 수
+있습니다.</p>
+
+<p>이것이 여전히 올바른 접근 방법으로 보인다면 이를 어떻게
+수행할 수 있는지에 대한 자세한 내용은
+<a href="vhosts.html">mod_rewrite로 가상 호스트</a> 문서를
+참조하십시오.</p>
+
+</section>
+
+<section id="proxy"><title>단순 프록시</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive>은
+재작성된 URI를 <module>mod_proxy</module>를 통해 전달하기 위한
+<a href="flags.html#flag_p">[P]</a> 플래그를 제공합니다.</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>그러나 위의 예제처럼 실제 패턴 매칭이 필요하지 않은
+많은 경우 <directive module="mod_proxy">ProxyPass</directive>
+지시어가 더 나은 선택입니다. 여기의 예제는 다음과 같이
+표현할 수 있습니다:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p><directive module="mod_rewrite">RewriteRule</directive>이든
+<directive module="mod_proxy">ProxyPass</directive>이든,
+백엔드 서버에서 발행한 리다이렉트를 올바르게 전달하기 위해
+<directive module="mod_proxy">ProxyPassReverse</directive>
+지시어를 사용해야 한다는 점에 유의하십시오:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>같은 범위에 다른 <code>RewriteRule</code>이 적용되고 있어
+<code>RewriteRule</code>이 <code>ProxyPass</code>보다 먼저
+적용되어 수행하려는 작업을 선점할 수 있는 경우
+<code>RewriteRule</code>을 대신 사용해야 할 수 있습니다.</p>
+
+</section>
+
+<section id="setenv"><title>환경 변수 테스트</title>
+
+<p><module>mod_rewrite</module>는 특정 환경 변수 또는 요청
+헤더의 존재 여부에 따라 특정 동작을 수행하는 데 자주
+사용됩니다. 이것은 <directive module="core"
+type="section">If</directive> 지시어를 사용하여 더 효율적으로
+수행할 수 있습니다.</p>
+
+<p>예를 들어, <directive>RewriteRule</directive>이
+<code>example.com</code> 대신 <code>www.example.com</code>과
+같은 정규 호스트명을 강제하는 데 사용되는 일반적인 시나리오를
+고려하십시오. 이것은 여기에 표시된 대로 <directive
+module="core" type="section">If</directive> 지시어를 사용하여
+수행할 수 있습니다:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>이 기술은 요청 헤더, 응답 헤더 또는 환경 변수에 기반한
+동작을 수행하는 데 사용할 수 있으며, 많은 일반적인
+시나리오에서 <module>mod_rewrite</module>를 대체합니다.</p>
+
+<p><directive module="core" type="section">If</directive> 섹션과
+특정 다른 지시어에서 사용할 수 있는 표현식 유형에 대한
+개요는 특히 <a href="../expr.html">표현식 평가
+문서</a>를 참조하십시오.</p>
+
+</section>
+
+</manualpage>
index 405691d6afdac15a8a350f21394095642d2e90a5..aa4a8b2c99b985b7aeded87030c6050b232d8c06 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant outdated="yes">fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/avoid.xml.tr b/docs/manual/rewrite/avoid.xml.tr
new file mode 100644 (file)
index 0000000..1c39663
--- /dev/null
@@ -0,0 +1,248 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite Ne Zaman Kullanılmamalı</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+<module>mod_rewrite</module> hakkındaki belki de en önemli kavramlardan
+birini açıklar: ne zaman kullanılmaması gerektiğini.</p>
+
+<p><module>mod_rewrite</module>, diğer alternatiflerin yetersiz kaldığı
+durumlarda son çare olarak düşünülmelidir. Daha basit alternatifler
+varken kullanılması, kafa karıştırıcı, kırılgan ve bakımı zor
+yapılandırmalara yol açar. Hangi alternatiflerin mevcut olduğunu
+anlamak, <module>mod_rewrite</module> konusunda uzmanlaşmanın çok
+önemli bir adımıdır.</p>
+
+<p>Bu örneklerin birçoğunun sizin sunucu yapılandırmanızda değişiklik
+yapılmadan çalışmayacağını unutmayın; bu nedenle örnekleri
+yapılandırmanıza kopyalayıp yapıştırmak yerine anlamanız
+önemlidir.</p>
+
+<p><module>mod_rewrite</module> modülünün doğru araç olduğu en yaygın
+durum, en iyi çözümün sunucu yapılandırma dosyalarına erişim
+gerektirdiği ancak bu erişime sahip olmadığınız durumdur. Bazı
+yapılandırma yönergeleri yalnızca sunucu yapılandırma dosyasında
+kullanılabilir. Bu nedenle, yalnızca .htaccess dosyalarıyla
+çalışabileceğiniz bir barındırma ortamındaysanız,
+<module>mod_rewrite</module> kullanmanız gerekebilir.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<!--<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>-->
+
+<section id="redirect">
+<title>Basit Yönlendirme</title>
+
+<p><module>mod_alias</module>, bir URL'yi başka birine yönlendirme
+aracı sağlayan <directive module="mod_alias">Redirect</directive> ve
+<directive module="mod_alias">RedirectMatch</directive> yönergelerini
+sunar. Bir URL'nin veya bir URL sınıfının başka bir yere bu tür basit
+yönlendirmesi, <directive module="mod_rewrite">RewriteRule</directive>
+yerine bu yönergeler kullanılarak gerçekleştirilmelidir.
+<code>RedirectMatch</code>, yönlendirme kriterlerinize düzenli ifade
+eklemenize olanak tanır ve <code>RewriteRule</code> kullanmanın
+avantajlarının birçoğunu sağlar.</p>
+
+<p><code>RewriteRule</code> için yaygın bir kullanım, URL'lerin tüm bir
+sınıfını yönlendirmektir. Örneğin, <code>/one</code> dizinindeki tüm
+URL'ler <code>http://one.example.com/</code> adresine yönlendirilmeli
+veya belki tüm <code>http</code> istekleri <code>https</code>'ye
+yönlendirilmelidir.</p>
+
+<p>Bu durumlar <code>Redirect</code> yönergesiyle daha iyi ele alınır.
+<code>Redirect</code> yönergesinin yol bilgisini koruduğunu
+unutmayın. Yani, <code>/one</code> URL'si için bir yönlendirme,
+<code>/one/two.html</code> ve <code>/one/three/four.html</code>
+gibi altındaki tüm URL'leri de yönlendirecektir.</p>
+
+<p><code>/one</code> altındaki URL'leri
+<code>http://one.example.com</code> adresine yönlendirmek için
+şunları yapın:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>Bir konak adını başka birine yönlendirmek için, örneğin
+<code>example.com</code>'u <code>www.example.com</code>'a yönlendirmek
+için <a href="remapping.html#canonicalhost">Kurallı Konak Adları</a>
+tarifine bakın.</p>
+
+<p><code>http</code> URL'lerini <code>https</code>'ye yönlendirmek
+için şunları yapın:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... SSL yapılandırması burada yer alır
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p><code>RewriteRule</code> kullanarak bu görevi gerçekleştirmek, aynı
+kapsamda başka <code>RewriteRule</code> yönergeleri varsa uygun
+olabilir. Çünkü aynı kapsamda <code>Redirect</code> ve
+<code>RewriteRule</code> yönergeleri olduğunda,
+<code>RewriteRule</code> yönergeleri yapılandırma dosyasındaki sıraya
+bakılmaksızın önce çalışacaktır.</p>
+
+<p><em>http-to-https</em> yönlendirmesi durumunda, ana sunucu
+yapılandırma dosyasına erişiminiz yoksa ve bu görevi bunun yerine bir
+<code>.htaccess</code> dosyasında gerçekleştirmek zorundaysanız,
+<code>RewriteRule</code> kullanımı uygun olacaktır.</p>
+
+</section>
+
+<section id="alias"><title>URL Takma Adlandırma</title>
+<p><directive module="mod_alias">Alias</directive> yönergesi, bir
+URI'den bir dizine - genellikle <directive
+module="core">DocumentRoot</directive> dışındaki bir dizine - eşleme
+sağlar. Bu eşlemeyi <module>mod_rewrite</module> ile gerçekleştirmek
+mümkün olsa da, basitlik ve performans nedeniyle <directive
+module="mod_alias">Alias</directive> tercih edilen yöntemdir.</p>
+
+<example><title>Alias Kullanımı</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+Bu eşlemeyi gerçekleştirmek için <module>mod_rewrite</module>
+kullanımı, sunucu yapılandırma dosyalarına erişiminiz olmadığında
+uygun olabilir. Alias yalnızca sunucu veya sanal konak bağlamında
+kullanılabilir, <code>.htaccess</code> dosyasında kullanılamaz.
+</p>
+
+<p>Sunucunuzda <code>Options FollowSymLinks</code> etkinse, sembolik
+bağlantılar aynı şeyi gerçekleştirmenin başka bir yolu olabilir.</p>
+</section>
+
+<section id="vhosts"><title>Sanal Konak Oluşturma</title>
+<p><a href="vhosts.html">mod_rewrite ile sanal konakları</a> yönetmek
+mümkün olsa da, nadiren doğru yoldur. Ayrı ayrı <directive
+module="core" type="section">VirtualHost</directive> blokları
+oluşturmak neredeyse her zaman doğru yaklaşımdır. Çok sayıda sanal
+konağınız olması durumunda, bu konakları otomatik olarak oluşturmak
+için <module>mod_vhost_alias</module> kullanmayı düşünün.</p>
+
+<p><module>mod_macro</module> gibi modüller de çok sayıda sanal konağı
+devingen olarak oluşturmak için yararlıdır.</p>
+
+<p>Sanal konak oluşturma için <module>mod_rewrite</module> kullanımı,
+sunucu yapılandırma dosyalarına erişim sağlamayan bir barındırma
+hizmeti kullanıyorsanız ve yapılandırmayı <code>.htaccess</code>
+dosyaları kullanarak yapmak zorundaysanız uygun olabilir.</p>
+
+<p>Yine de doğru yaklaşım gibi görünüyorsa, bunu nasıl
+gerçekleştirebileceğiniz hakkında daha fazla ayrıntı için <a
+href="vhosts.html">mod_rewrite ile sanal konaklar</a> belgesine
+bakın.</p>
+
+</section>
+
+<section id="proxy"><title>Basit Vekil Kullanımı</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive>, yeniden
+yazılmış URI'leri <module>mod_proxy</module> üzerinden geçirmek için
+<a href="flags.html#flag_p">[P]</a> bayrağını sağlar.</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>Ancak birçok durumda, yukarıdaki örnekte gösterildiği gibi gerçek
+bir kalıp eşleştirmesine gerek olmadığında, <directive
+module="mod_proxy">ProxyPass</directive> yönergesi daha iyi bir
+seçimdir. Buradaki örnek şöyle ifade edilebilir:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>İster <directive module="mod_rewrite">RewriteRule</directive>
+ister <directive module="mod_proxy">ProxyPass</directive> kullanın,
+arka uç sunucu tarafından verilen yönlendirmeleri yakalamak için yine de
+<directive module="mod_proxy">ProxyPassReverse</directive> yönergesini
+kullanmanız gerekeceğini unutmayın:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>Aynı kapsamda diğer <code>RewriteRule</code>'lar etkinse,
+<code>RewriteRule</code> kullanmanız gerekebilir; çünkü
+<code>RewriteRule</code> genellikle <code>ProxyPass</code>'tan önce
+etki eder ve yapmaya çalıştığınız şeyi geçersiz kılabilir.</p>
+
+</section>
+
+<section id="setenv"><title>Ortam Değişkeni Sınaması</title>
+
+<p><module>mod_rewrite</module>, belirli bir ortam değişkeninin veya
+istek başlığının varlığına veya yokluğuna bağlı olarak belirli bir
+eylem yapmak için sıklıkla kullanılır. Bu, <directive module="core"
+type="section">If</directive> yönergesi kullanılarak daha verimli bir
+şekilde yapılabilir.</p>
+
+<p>Örneğin, <directive>RewriteRule</directive> kullanılarak
+<code>www.example.com</code> gibi kurallı bir konak adının
+zorlanmasının yaygın senaryosunu ele alalım. Bu, burada gösterildiği
+gibi <directive module="core" type="section">If</directive>
+yönergesi kullanılarak yapılabilir:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>Bu teknik, herhangi bir istek başlığına, yanıt başlığına veya ortam
+değişkenine dayalı eylemler yapmak için kullanılabilir ve birçok yaygın
+senaryoda <module>mod_rewrite</module> yerine geçer.</p>
+
+<p>Özellikle <directive module="core" type="section">If</directive>
+bölümlerinde ve belirli diğer yönergelerde kullanabileceğiniz ifade
+türlerine genel bir bakış için <a href="../expr.html">ifade
+değerlendirme belgelerine</a> bakın.</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/avoid.xml.zh-cn b/docs/manual/rewrite/avoid.xml.zh-cn
new file mode 100644 (file)
index 0000000..ea42f70
--- /dev/null
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="avoid.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>何时不使用 mod_rewrite</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了关于
+<module>mod_rewrite</module> 最重要的概念之一——
+即何时应避免使用它。</p>
+
+<p><module>mod_rewrite</module> 应被视为最后的手段,
+当其他替代方案不能满足需求时才使用。在有更简单替代方案的情况下使用它,
+会导致配置混乱、脆弱且难以维护。
+了解有哪些替代方案可用是掌握 <module>mod_rewrite</module> 的重要一步。</p>
+
+<p>请注意,这些示例中的许多不会在你的特定服务器配置中直接生效,
+因此理解它们非常重要,而不仅仅是将示例复制粘贴到你的配置中。</p>
+
+<p>最常见的适合使用 <module>mod_rewrite</module> 的情况是,
+最佳解决方案需要访问服务器配置文件,而你没有该访问权限。
+某些配置指令只能在服务器配置文件中使用。因此,
+如果你处于只能使用 .htaccess 文件的托管环境中,
+你可能需要借助 <module>mod_rewrite</module>。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<!--<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>-->
+
+<section id="redirect">
+<title>简单重定向</title>
+
+<p><module>mod_alias</module> 提供了 <directive
+module="mod_alias">Redirect</directive> 和 <directive
+module="mod_alias">RedirectMatch</directive> 指令,
+它们提供了将一个 URL 重定向到另一个 URL 的方法。
+这种简单的将一个 URL 或一类 URL 重定向到其他地方的操作,
+应使用这些指令而不是
+<directive module="mod_rewrite">RewriteRule</directive> 来完成。
+<code>RedirectMatch</code> 允许你在重定向条件中包含正则表达式,
+提供了使用 <code>RewriteRule</code> 的许多好处。</p>
+
+<p><code>RewriteRule</code> 的一个常见用途是重定向整类 URL。
+例如,<code>/one</code> 目录中的所有 URL 必须重定向到
+<code>http://one.example.com/</code>,或者所有 <code>http</code>
+请求必须重定向到 <code>https</code>。</p>
+
+<p>这些情况更适合使用 <code>Redirect</code> 指令处理。
+请记住,<code>Redirect</code> 会保留路径信息。也就是说,
+对 URL <code>/one</code> 的重定向也会重定向其下的所有 URL,
+例如 <code>/one/two.html</code> 和 <code>/one/three/four.html</code>。</p>
+
+<p>要将 <code>/one</code> 下的 URL 重定向到
+<code>http://one.example.com</code>,请执行以下操作:</p>
+
+<highlight language="config">
+Redirect "/one/" "http://one.example.com/"
+</highlight>
+
+<p>要将一个主机名重定向到另一个,例如将
+<code>example.com</code> 重定向到 <code>www.example.com</code>,
+请参阅<a href="remapping.html#canonicalhost">规范主机名</a>方案。</p>
+
+<p>要将 <code>http</code> URL 重定向到 <code>https</code>,
+请执行以下操作:</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+    ServerName www.example.com
+    Redirect "/" "https://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:443&gt;
+    ServerName www.example.com
+    # ... SSL 配置放在这里
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>当同一作用域中存在其他 <code>RewriteRule</code> 指令时,
+使用 <code>RewriteRule</code> 来完成此任务可能是合适的。
+这是因为,当 <code>Redirect</code> 和 <code>RewriteRule</code>
+指令在同一作用域中时,无论它们在配置文件中的出现顺序如何,
+<code>RewriteRule</code> 指令都会先执行。</p>
+
+<p>对于 <em>http 到 https</em> 的重定向,
+当你无权访问主服务器配置文件,
+而被迫在 <code>.htaccess</code> 文件中执行此任务时,
+使用 <code>RewriteRule</code> 是合适的。</p>
+
+</section>
+
+<section id="alias"><title>URL 别名</title>
+<p><directive module="mod_alias">Alias</directive>
+指令提供了从 URI 到目录的映射——通常是
+<directive module="core">DocumentRoot</directive> 之外的目录。
+虽然可以使用 <module>mod_rewrite</module> 执行此映射,
+但出于简便性和性能原因,<directive module="mod_alias">Alias</directive>
+是首选方法。</p>
+
+<example><title>使用 Alias</title>
+<highlight language="config">
+Alias "/cats" "/var/www/virtualhosts/felines/htdocs"
+</highlight>
+</example>
+
+<p>
+当你无权访问服务器配置文件时,使用 <module>mod_rewrite</module>
+执行此映射可能是合适的。Alias 只能在服务器或虚拟主机上下文中使用,
+不能在 <code>.htaccess</code> 文件中使用。
+</p>
+
+<p>如果你的服务器启用了 <code>Options FollowSymLinks</code>,
+符号链接将是实现同样目标的另一种方式。</p>
+</section>
+
+<section id="vhosts"><title>虚拟主机</title>
+<p>虽然可以<a href="vhosts.html">使用 mod_rewrite 处理虚拟主机</a>,
+但这很少是正确的方式。创建单独的
+<directive module="core" type="section">VirtualHost</directive>
+块几乎总是正确的做法。如果你有大量的虚拟主机,
+可以考虑使用 <module>mod_vhost_alias</module> 来自动创建这些主机。</p>
+
+<p><module>mod_macro</module> 等模块对于动态创建大量虚拟主机也很有用。</p>
+
+<p>当你使用的托管服务不提供服务器配置文件的访问权限,
+你只能使用 <code>.htaccess</code> 文件进行配置时,
+使用 <module>mod_rewrite</module> 创建虚拟主机可能是合适的。</p>
+
+<p>请参阅<a href="vhosts.html">使用 mod_rewrite 的虚拟主机</a>文档,
+了解如何实现此目的(如果这仍然看起来是正确的方法)。</p>
+
+</section>
+
+<section id="proxy"><title>简单代理</title>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> 提供了 <a
+href="flags.html#flag_p">[P]</a> 标志,用于将重写后的 URI 通过
+<module>mod_proxy</module> 传递。</p>
+
+<highlight language="config">
+RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]
+</highlight>
+
+<p>但是,在许多情况下,当不需要实际的模式匹配时(如上面的示例所示),
+<directive module="mod_proxy">ProxyPass</directive> 指令是更好的选择。
+上面的示例可以表示为:</p>
+
+<highlight language="config">
+ProxyPass "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>请注意,无论你使用
+<directive module="mod_rewrite">RewriteRule</directive> 还是
+<directive module="mod_proxy">ProxyPass</directive>,
+你仍然需要使用
+<directive module="mod_proxy">ProxyPassReverse</directive>
+指令来捕获后端服务器发出的重定向:</p>
+
+<highlight language="config">
+ProxyPassReverse "/images/" "http://imageserver.local/images/"
+</highlight>
+
+<p>当同一作用域中有其他 <code>RewriteRule</code> 生效时,
+你可能需要使用 <code>RewriteRule</code> 代替,
+因为 <code>RewriteRule</code> 通常会在 <code>ProxyPass</code>
+之前生效,可能会抢先处理你要完成的操作。</p>
+
+</section>
+
+<section id="setenv"><title>环境变量测试</title>
+
+<p><module>mod_rewrite</module> 经常用于根据特定环境变量或请求头
+是否存在来执行特定操作。使用
+<directive module="core" type="section">If</directive>
+指令可以更高效地完成此操作。</p>
+
+<p>例如,考虑使用 <directive>RewriteRule</directive>
+来强制使用规范主机名(如 <code>www.example.com</code> 而不是
+<code>example.com</code>)的常见场景。可以使用
+<directive module="core" type="section">If</directive>
+指令来完成,如下所示:</p>
+
+<highlight language="config">
+&lt;If "req('Host') != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>此技术可用于根据任何请求头、响应头或环境变量执行操作,
+在许多常见场景中替代 <module>mod_rewrite</module>。</p>
+
+<p>特别请参阅<a href="../expr.html">表达式求值文档</a>,
+了解在 <directive module="core" type="section">If</directive>
+配置段和某些其他指令中可以使用哪些类型的表达式。</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/flags.xml.de b/docs/manual/rewrite/flags.xml.de
new file mode 100644 (file)
index 0000000..0b94f45
--- /dev/null
@@ -0,0 +1,915 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>RewriteRule-Flags</title>
+
+<summary>
+<p>Dieses Dokument behandelt die Flags, die für die Direktive
+<directive module="mod_rewrite">RewriteRule</directive> verfügbar sind,
+und bietet detaillierte Erklärungen und Beispiele.</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="introduction"><title>Einführung</title>
+<p>Das Verhalten einer <directive module="mod_rewrite">RewriteRule</directive>
+kann durch ein oder mehrere Flags modifiziert werden. Flags werden in
+eckigen Klammern am Ende der Regel angegeben, und mehrere Flags werden
+durch Kommas getrennt.</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>Jedes Flag hat (mit wenigen Ausnahmen) eine Kurzform, wie
+<code>CO</code>, sowie eine Langform, wie <code>cookie</code>.
+Obwohl es am häufigsten ist, die Kurzform zu verwenden, wird empfohlen,
+sich mit der Langform vertraut zu machen, damit Sie sich merken können,
+was jedes Flag bewirken soll. Einige Flags akzeptieren ein oder mehrere
+Argumente. Flags unterscheiden nicht zwischen Groß- und Kleinschreibung.</p>
+
+<p>Flags, die mit der Anfrage verknüpfte Metadaten ändern (T=, H=, E=),
+haben im Verzeichniskontext und htaccess-Kontext keine Wirkung, wenn eine
+Ersetzung (außer '-') während derselben Runde der Umschreibungsverarbeitung
+durchgeführt wird.</p>
+
+<p>Hier werden alle verfügbaren Flags vorgestellt, zusammen mit einem
+Beispiel, wie Sie diese verwenden könnten.</p>
+</section>
+
+<section id="flag_b"><title>B (Rückreferenzen maskieren)</title>
+<p>Das [B]-Flag weist <directive
+module="mod_rewrite">RewriteRule</directive> an, nicht-alphanumerische
+Zeichen vor der Anwendung der Transformation zu maskieren.</p>
+
+<p><module>mod_rewrite</module> muss URLs demaskieren, bevor sie zugeordnet werden,
+sodass Rückreferenzen zum Zeitpunkt ihrer Anwendung demaskiert sind.
+Mit dem B-Flag werden nicht-alphanumerische Zeichen in Rückreferenzen
+maskiert. Betrachten Sie beispielsweise die folgende Regel:</p>
+
+<p>Für eine ähnliche Maskierung von Server-Variablen siehe die
+    "escape"-<a href="#mapfunc">Zuordnungsfunktion</a></p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>Bei einem Suchbegriff von 'x &amp; y/z' kodiert ein Browser diesen als
+'x%20%26%20y%2Fz', sodass die Anfrage 'search/x%20%26%20y%2Fz' lautet. Ohne das B-Flag
+wird diese Rewrite-Regel auf 'search.php?term=x &amp; y/z' abgebildet, was
+keine gültige URL ist und daher als
+<code>search.php?term=x%20&amp;y%2Fz=</code> kodiert würde, was nicht beabsichtigt war.</p>
+
+<p>Mit gesetztem B-Flag bei derselben Regel werden die Parameter erneut
+kodiert, bevor sie an die Ausgabe-URL übergeben werden, was zu einer korrekten
+Zuordnung zu <code>/search.php?term=x%20%26%20y%2Fz</code> führt.</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>Beachten Sie, dass Sie möglicherweise auch <directive
+module="core">AllowEncodedSlashes</directive> auf <code>On</code> setzen müssen,
+damit dieses spezielle Beispiel funktioniert, da httpd keine kodierten
+Schrägstriche in URLs zulässt und bei deren Auftreten einen 404-Fehler
+zurückgibt.</p>
+
+<p>Diese Maskierung ist besonders notwendig in einer Proxy-Situation,
+wenn das Backend bei einer nicht-maskierten URL Probleme haben könnte.</p>
+
+<p>Eine Alternative zu diesem Flag ist die Verwendung einer <directive module="mod_rewrite"
+>RewriteCond</directive>, die gegen %{THE_REQUEST} prüft, welche Strings
+in kodierter Form erfasst.</p>
+
+<p>Ab Version 2.4.26 können Sie die Maskierung auf bestimmte Zeichen
+in Rückreferenzen beschränken, indem Sie diese auflisten: <code>[B=#?;]</code>.
+Hinweis: Das Leerzeichen kann in der Liste der zu maskierenden Zeichen
+verwendet werden, aber Sie müssen das gesamte dritte Argument der
+<directive module="mod_rewrite">RewriteRule</directive> in Anführungszeichen
+setzen und das Leerzeichen darf nicht das letzte Zeichen in der Liste sein.</p>
+
+<highlight language="config">
+# Leerzeichen und Fragezeichen maskieren. Die Anführungszeichen um das letzte Argument
+# sind erforderlich, wenn ein Leerzeichen enthalten ist.
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>Um die auf diese Weise maskierten Zeichen einzuschränken, siehe <a href="#flag_bne">#flag_bne</a>
+        und <a href="#flag_bctls">#flag_bctls</a></p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus (Leerzeichen nicht zu + maskieren)</title>
+<p>Das [BNP]-Flag weist <directive
+module="mod_rewrite">RewriteRule</directive> an, das Leerzeichen
+in einer Rückreferenz zu %20 statt zu '+' zu maskieren. Nützlich, wenn die
+Rückreferenz im Pfadteil statt im Query-String verwendet wird.</p>
+
+<highlight language="config">
+# Leerzeichen im Pfad zu %20 maskieren statt zu +, wie es bei Formularübermittlungen
+# über den Query-String verwendet wird
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+<p>Dieses Flag ist ab Version 2.4.26 verfügbar.</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>Das [BCTLS]-Flag ähnelt dem [B]-Flag, maskiert aber nur
+Steuerzeichen und das Leerzeichen. Dies ist dieselbe Menge von
+Zeichen, die abgelehnt werden, wenn sie unkodiert in den Query-String
+kopiert werden.</p>
+
+<highlight language="config">
+# Steuerzeichen und Leerzeichen maskieren
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>Dieses Flag ist ab Version 2.5.1 verfügbar.</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>Die Liste der Zeichen in [BNE=...] wird als Ausnahmen von den
+Zeichen der [B]- oder [BCTLS]-Flags behandelt. Die aufgelisteten Zeichen
+werden nicht maskiert.</p>
+
+<highlight language="config">
+# Standardzeichen maskieren, aber / beibehalten
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>Dieses Flag ist ab Version 2.5.1 verfügbar.</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>Das [C]- oder [chain]-Flag zeigt an, dass die <directive
+module="mod_rewrite">RewriteRule</directive> mit der nächsten Regel
+verkettet ist. Wenn die Regel übereinstimmt, wird sie wie gewohnt
+verarbeitet und die Kontrolle geht an die nächste Regel über. Wenn sie
+jedoch nicht übereinstimmt, werden die nächste Regel und alle weiteren
+verketteten Regeln übersprungen.</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>Das [CO]- oder [cookie]-Flag ermöglicht es Ihnen, ein Cookie zu setzen,
+wenn eine bestimmte <directive module="mod_rewrite">RewriteRule</directive>
+übereinstimmt. Das Argument besteht aus drei erforderlichen und fünf
+optionalen Feldern.</p>
+
+<p>Die vollständige Syntax für das Flag einschließlich aller Attribute
+lautet wie folgt:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>Wenn ein literales ':'-Zeichen in einem der Cookie-Felder benötigt wird,
+steht eine alternative Syntax zur Verfügung. Um die alternative Syntax zu
+verwenden, sollte der Cookie-"Name" mit einem ';'-Zeichen eingeleitet werden,
+und die Feldtrenner sollten als ';' angegeben werden.</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>Sie müssen einen Namen, einen Wert und eine Domain angeben, damit das
+Cookie gesetzt wird.</p>
+
+<dl>
+<dt>Domain</dt>
+<dd>Die Domain, für die das Cookie gültig sein soll. Dies kann ein
+Hostname sein, wie <code>www.example.com</code>, oder eine Domain,
+wie <code>.example.com</code>. Sie muss aus mindestens zwei durch einen
+Punkt getrennten Teilen bestehen. Das heißt, sie kann nicht einfach nur
+<code>.com</code> oder <code>.net</code> sein. Cookies dieser Art werden
+durch das Cookie-Sicherheitsmodell verboten.</dd>
+</dl>
+
+<p>Sie können optional auch die folgenden Werte setzen:</p>
+
+<dl>
+<dt>Lebensdauer</dt>
+<dd>Die Zeit, für die das Cookie bestehen bleibt, in Minuten.</dd>
+<dd>Ein Wert von 0 bedeutet, dass das Cookie nur für die aktuelle
+Browser-Sitzung bestehen bleibt. Dies ist der Standardwert, wenn keiner
+angegeben wird.</dd>
+<dd>Ein negativer Wert bewirkt, dass das Cookie im Browser gelöscht wird.</dd>
+
+<dt>Pfad</dt>
+<dd>Der Pfad auf der aktuellen Website, für den das Cookie gültig ist,
+wie <code>/customers/</code> oder <code>/files/download/</code>.</dd>
+<dd>Standardmäßig ist dies auf <code>/</code> gesetzt - also die gesamte
+Website.</dd>
+
+<dt>Secure</dt>
+<dd>Wenn auf <code>secure</code>, <code>true</code> oder <code>1</code>
+gesetzt, wird das Cookie nur über sichere (https-)Verbindungen
+übertragen.</dd>
+
+<dt>httponly</dt>
+<dd>Wenn auf <code>HttpOnly</code>, <code>true</code> oder
+<code>1</code> gesetzt, wird das Cookie mit dem <code>HttpOnly</code>-Flag
+versehen, was bedeutet, dass das Cookie für JavaScript-Code in Browsern,
+die diese Funktion unterstützen, nicht zugänglich ist.</dd>
+
+<dt>samesite</dt>
+<dd>Wenn auf etwas anderes als <code>false</code> oder <code>0</code> gesetzt,
+wird das <code>SameSite</code>-Attribut auf den angegebenen Wert gesetzt.
+Typische Werte sind <code>None</code>, <code>Lax</code> und
+<code>Strict</code>. Verfügbar ab Version 2.5.1.</dd>
+</dl>
+
+<p>Betrachten Sie dieses Beispiel:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>In diesem Beispiel schreibt die Regel die Anfrage nicht um.
+Das "-"-Umschreibungsziel weist <module>mod_rewrite</module> an, die Anfrage
+unverändert weiterzuleiten. Stattdessen setzt sie ein Cookie
+namens 'frontdoor' auf den Wert 'yes'. Das Cookie ist für jeden Host
+in der <code>.example.com</code>-Domain gültig. Es läuft in 1440
+Minuten (24 Stunden) ab und wird für alle URIs zurückgegeben.</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>Das DPI-Flag bewirkt, dass der PATH_INFO-Teil des umgeschriebenen URI
+verworfen wird.</p>
+<p>Dieses Flag ist ab Version 2.2.12 verfügbar.</p>
+<p>Im Verzeichniskontext wird der URI, gegen den jede
+<directive>RewriteRule</directive> prüft, aus der Verkettung der aktuellen
+Werte von URI und PATH_INFO gebildet.</p>
+
+<p>Der aktuelle URI kann der ursprünglich vom Client angeforderte URI sein,
+das Ergebnis einer vorherigen Runde der <module>mod_rewrite</module>-Verarbeitung
+oder das Ergebnis einer früheren Regel in der aktuellen Runde der
+<module>mod_rewrite</module>-Verarbeitung.</p>
+
+<p>Im Gegensatz dazu spiegelt der PATH_INFO, der vor jeder Regel an den
+URI angehängt wird, nur den Wert von PATH_INFO vor dieser Runde der
+<module>mod_rewrite</module>-Verarbeitung wider. Wenn daher große Teile
+des URI in einer Ersetzung in mehreren <directive>RewriteRule</directive>-Direktiven
+abgeglichen und kopiert werden, ohne zu berücksichtigen, welche Teile des
+URI vom aktuellen PATH_INFO stammen, kann der endgültige URI mehrere
+Kopien von PATH_INFO enthalten.</p>
+
+<p>Verwenden Sie dieses Flag bei jeder Ersetzung, bei der der PATH_INFO,
+der aus der vorherigen Zuordnung dieser Anfrage zum Dateisystem resultierte,
+nicht von Interesse ist. Dieses Flag vergisst dauerhaft den PATH_INFO,
+der vor dieser Runde der <module>mod_rewrite</module>-Verarbeitung festgelegt wurde.
+PATH_INFO wird erst neu berechnet, wenn die aktuelle Runde der
+<module>mod_rewrite</module>-Verarbeitung abgeschlossen ist. Nachfolgende Regeln
+während dieser Runde der Verarbeitung sehen nur das direkte Ergebnis der
+Ersetzungen, ohne angehängten PATH_INFO.</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>Mit dem [E]- oder [env]-Flag können Sie den Wert einer Umgebungsvariable
+setzen. Beachten Sie, dass einige Umgebungsvariablen nach der Ausführung
+der Regel gesetzt werden können, wodurch das von Ihnen Gesetzte überschrieben
+wird. Siehe <a href="../env.html">das Dokument zu Umgebungsvariablen</a>
+für weitere Details zur Funktionsweise von Umgebungsvariablen.</p>
+
+<p>Die vollständige Syntax für dieses Flag lautet:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code> kann Rückreferenzen (<code>$N</code> oder
+<code>%N</code>) enthalten, die expandiert werden.</p>
+
+<p>In der Kurzform</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p>können Sie die Umgebungsvariable namens <code>VAR</code> auf einen
+leeren Wert setzen.</p>
+
+<p>Die Form</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>ermöglicht es, eine zuvor gesetzte Umgebungsvariable namens
+<code>VAR</code> zu löschen.</p>
+
+<p>Umgebungsvariablen können dann in verschiedenen Kontexten verwendet
+werden, einschließlich CGI-Programmen, anderen RewriteRule-Direktiven
+oder CustomLog-Direktiven.</p>
+
+<p>Das folgende Beispiel setzt eine Umgebungsvariable namens 'image' auf
+den Wert '1', wenn der angeforderte URI eine Bilddatei ist. Dann wird
+diese Umgebungsvariable verwendet, um diese Anfragen aus dem
+Zugriffsprotokoll auszuschließen.</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>Beachten Sie, dass derselbe Effekt mit <directive
+module="mod_setenvif">SetEnvIf</directive> erzielt werden kann. Diese
+Technik wird als Beispiel angeboten, nicht als Empfehlung.</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>Die Verwendung des [END]-Flags beendet nicht nur die aktuelle Runde der
+Umschreibungsverarbeitung (wie [L]), sondern verhindert auch jede
+nachfolgende Umschreibungsverarbeitung im Verzeichniskontext (htaccess).</p>
+
+<p>Dies gilt nicht für neue Anfragen, die aus externen Umleitungen
+resultieren.</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>Die Verwendung des [F]-Flags bewirkt, dass der Server einen
+403-Forbidden-Statuscode an den Client zurückgibt. Obwohl dasselbe
+Verhalten mit der <directive module="mod_access_compat">Deny</directive>-Direktive
+erreicht werden kann, ermöglicht dies mehr Flexibilität bei der Zuweisung
+eines Forbidden-Status.</p>
+
+<p>Die folgende Regel verbietet das Herunterladen von <code>.exe</code>-Dateien
+von Ihrem Server.</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>Dieses Beispiel verwendet die "-"-Syntax für das Umschreibungsziel,
+was bedeutet, dass der angeforderte URI nicht geändert wird. Es gibt
+keinen Grund, zu einem anderen URI umzuschreiben, wenn Sie die Anfrage
+verweigern möchten.</p>
+
+<p>Bei der Verwendung von [F] wird ein [L] impliziert - das heißt, die
+Antwort wird sofort zurückgegeben und keine weiteren Regeln werden
+ausgewertet.</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>Das [G]-Flag zwingt den Server, einen 410-Gone-Status mit der
+Antwort zurückzugeben. Dies zeigt an, dass eine Ressource früher
+verfügbar war, aber nicht mehr verfügbar ist.</p>
+
+<p>Wie beim [F]-Flag verwenden Sie typischerweise die "-"-Syntax für das
+Umschreibungsziel, wenn Sie das [G]-Flag verwenden:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>Bei der Verwendung von [G] wird ein [L] impliziert - das heißt, die
+Antwort wird sofort zurückgegeben und keine weiteren Regeln werden
+ausgewertet.</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>Erzwingt, dass die resultierende Anfrage mit dem angegebenen
+Handler behandelt wird. Beispielsweise könnte man dies verwenden, um
+alle Dateien ohne Dateiendung vom PHP-Handler parsen zu lassen:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+Der obige reguläre Ausdruck - <code>!\.</code> - stimmt mit jeder Anfrage
+überein, die kein literales <code>.</code>-Zeichen enthält.
+</p>
+
+<p>Dies kann auch verwendet werden, um den Handler basierend auf
+bestimmten Bedingungen zu erzwingen. Beispielsweise ermöglicht der
+folgende Ausschnitt, der im Server-Kontext verwendet wird, dass
+<code>.php</code>-Dateien von <code>mod_php</code> <em>angezeigt</em>
+werden, wenn sie mit der <code>.phps</code>-Erweiterung angefordert werden:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>Der obige reguläre Ausdruck - <code>^(/source/.+\.php)s$</code> - stimmt
+mit jeder Anfrage überein, die mit <code>/source/</code> beginnt, gefolgt von
+einem oder mehreren Zeichen, gefolgt von <code>.phps</code>. Die Rückreferenz
+$1 verweist auf die erfasste Übereinstimmung innerhalb der Klammern des
+regulären Ausdrucks.</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>Das [L]-Flag bewirkt, dass <module>mod_rewrite</module> die Verarbeitung
+des Regelsatzes stoppt. In den meisten Kontexten bedeutet dies, dass bei
+Übereinstimmung der Regel keine weiteren Regeln verarbeitet werden. Dies
+entspricht dem <code>last</code>-Befehl in Perl oder dem <code>break</code>-Befehl
+in C. Verwenden Sie dieses Flag, um anzuzeigen, dass die aktuelle Regel
+sofort angewendet werden soll, ohne weitere Regeln zu berücksichtigen.</p>
+
+<p>Wenn Sie <directive module="mod_rewrite">RewriteRule</directive> in
+<code>.htaccess</code>-Dateien oder in
+<directive type="section" module="core">Directory</directive>-Abschnitten
+verwenden, ist es wichtig, ein gewisses Verständnis dafür zu haben, wie die
+Regeln verarbeitet werden. Die vereinfachte Form davon ist, dass nach der
+Verarbeitung der Regeln die umgeschriebene Anfrage an die URL-Parsing-Engine
+zurückgegeben wird. Es ist möglich, dass bei der Verarbeitung der
+umgeschriebenen Anfrage die <code>.htaccess</code>-Datei oder der
+<directive type="section" module="core">Directory</directive>-Abschnitt
+erneut angetroffen wird und der Regelsatz von Anfang an erneut durchlaufen
+wird. Am häufigsten geschieht dies, wenn eine der Regeln eine Umleitung
+auslöst - entweder intern oder extern - wodurch der Anfrageprozess von
+vorne beginnt.</p>
+
+<p>Es ist daher wichtig, wenn Sie <directive
+module="mod_rewrite">RewriteRule</directive>-Direktiven in einem dieser
+Kontexte verwenden, dass Sie explizite Maßnahmen ergreifen, um
+Regelschleifen zu vermeiden, und sich nicht ausschließlich auf das [L]-Flag
+verlassen, um die Ausführung einer Reihe von Regeln zu beenden, wie
+unten gezeigt.</p>
+
+<p>Ein alternatives Flag, [END], kann verwendet werden, um nicht nur die
+aktuelle Runde der Umschreibungsverarbeitung zu beenden, sondern auch
+jede nachfolgende Umschreibungsverarbeitung im Verzeichniskontext (htaccess)
+zu verhindern. Dies gilt nicht für neue Anfragen, die aus externen
+Umleitungen resultieren.</p>
+
+<p>Das hier gegebene Beispiel schreibt jede Anfrage auf
+<code>index.php</code> um und gibt die ursprüngliche Anfrage als
+Query-String-Argument an <code>index.php</code> weiter. Die <directive
+module="mod_rewrite">RewriteCond</directive> stellt jedoch sicher, dass die
+<directive module="mod_rewrite">RewriteRule</directive> übersprungen wird,
+wenn die Anfrage bereits für <code>index.php</code> bestimmt ist.</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+Das [N]-Flag bewirkt, dass der Regelsatz von oben neu gestartet wird,
+wobei das bisherige Ergebnis des Regelsatzes als Ausgangspunkt verwendet wird.
+Verwenden Sie es mit äußerster Vorsicht, da es zu Schleifen führen kann.
+</p>
+<p>
+Das [Next]-Flag könnte beispielsweise verwendet werden, wenn Sie einen
+bestimmten String oder Buchstaben wiederholt in einer Anfrage ersetzen
+möchten. Das hier gezeigte Beispiel ersetzt A überall in einer Anfrage
+durch B und fährt damit fort, bis keine weiteren A mehr zu ersetzen sind.
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>Sie können sich dies als <code>while</code>-Schleife vorstellen: Solange
+dieses Muster noch übereinstimmt (d.h. solange der URI noch ein
+<code>A</code> enthält), führe diese Ersetzung durch (d.h. ersetze das
+<code>A</code> durch ein <code>B</code>).</p>
+
+<p>Ab Version 2.5.0 gibt dieses Modul nach 10.000 Iterationen einen Fehler
+zurück, um vor unbeabsichtigten Schleifen zu schützen. Eine alternative
+maximale Anzahl von Iterationen kann durch Hinzufügen zum N-Flag angegeben
+werden.</p>
+<highlight language="config">
+# Bereit, 1 Zeichen pro Schleifendurchlauf zu ersetzen
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ... oder nach 10 Schleifen aufgeben
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>Die Verwendung des [NC]-Flags bewirkt, dass die <directive
+module="mod_rewrite">RewriteRule</directive> ohne Berücksichtigung der
+Groß-/Kleinschreibung abgeglichen wird. Das heißt, es spielt keine Rolle,
+ob Buchstaben im abgeglichenen URI als Groß- oder Kleinbuchstaben
+erscheinen.</p>
+
+<p>Im folgenden Beispiel wird jede Anfrage nach einer Bilddatei an Ihren
+dedizierten Bildserver weitergeleitet. Der Abgleich erfolgt ohne
+Berücksichtigung der Groß-/Kleinschreibung, sodass beispielsweise sowohl
+<code>.jpg</code>- als auch <code>.JPG</code>-Dateien akzeptiert werden.</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>Standardmäßig werden bei einer <directive module="mod_rewrite">RewriteRule</directive>,
+die zu einer externen Umleitung führt, alle Zeichen in der Ausgabe, die
+nicht in der folgenden sicheren Menge enthalten sind, in ihre
+Hexcode-Äquivalente (prozentcodiert) umgewandelt:</p>
+
+<ul>
+  <li>Alphanumerische Zeichen: <code>A-Z</code>, <code>a-z</code>,
+  <code>0-9</code></li>
+  <li>Sonderzeichen: <code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>Beispielsweise würde <code>#</code> in <code>%23</code> umgewandelt
+und <code>?</code> in <code>%3F</code>. Das <code>%</code>-Zeichen
+wird ebenfalls maskiert (zu <code>%25</code>), was bedeutet, dass jede
+bereits vorhandene Prozentkodierung in der Ersetzung doppelt kodiert wird.</p>
+
+<p>Die Verwendung des [NE]-Flags verhindert diese Maskierung und ermöglicht,
+dass Zeichen wie <code>#</code> und <code>?</code> unverändert an die
+Umleitungs-URL weitergegeben werden.</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+Das obige Beispiel leitet <code>/anchor/xyz</code> auf
+<code>/bigpage.html#xyz</code> um. Ohne [NE] würde das #-Zeichen in
+sein Hexcode-Äquivalent <code>%23</code> umgewandelt, was dann zu einem
+404-Nicht-Gefunden-Fehler führen würde.
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>Die Verwendung des [NS]-Flags verhindert, dass die Regel auf
+Unteranfragen angewendet wird. Beispielsweise ist eine Seite, die mittels
+SSI (Server Side Include) eingebunden wird, eine Unteranfrage, und Sie
+möchten möglicherweise Umschreibungen bei diesen Unteranfragen vermeiden.
+Auch wenn <module>mod_dir</module> versucht, Informationen über mögliche
+Standarddateien des Verzeichnisses herauszufinden (wie
+<code>index.html</code>-Dateien), handelt es sich um eine interne
+Unteranfrage, und Sie möchten häufig Umschreibungen bei solchen
+Unteranfragen vermeiden. Bei Unteranfragen ist es nicht immer nützlich
+und kann sogar Fehler verursachen, wenn der vollständige Regelsatz
+angewendet wird. Verwenden Sie dieses Flag, um problematische Regeln
+auszuschließen.</p>
+
+<p>Um zu entscheiden, ob Sie diese Regel verwenden sollten oder nicht: Wenn
+Sie URLs mit CGI-Skripten voranstellen, um deren Verarbeitung durch das
+CGI-Skript zu erzwingen, werden Sie wahrscheinlich bei Unteranfragen auf
+Probleme (oder erheblichen Overhead) stoßen. In diesen Fällen verwenden
+Sie dieses Flag.</p>
+
+<p>
+Bilder, JavaScript-Dateien oder CSS-Dateien, die als Teil einer HTML-Seite
+geladen werden, sind keine Unteranfragen - der Browser fordert sie als
+separate HTTP-Anfragen an.
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>Die Verwendung des [P]-Flags bewirkt, dass die Anfrage von
+<module>mod_proxy</module> behandelt und über eine Proxy-Anfrage verarbeitet
+wird. Wenn Sie beispielsweise möchten, dass alle Bildanfragen von einem
+Backend-Bildserver behandelt werden, könnten Sie Folgendes tun:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.( jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>Die Verwendung des [P]-Flags impliziert [L] - das heißt, die Anfrage
+wird sofort durch den Proxy geleitet und nachfolgende Regeln werden nicht
+berücksichtigt.</p>
+
+<p>
+Sie müssen sicherstellen, dass der Ersetzungsstring ein gültiger URI ist
+(typischerweise beginnend mit <code>http://</code><em>hostname</em>),
+der von <module>mod_proxy</module> verarbeitet werden kann. Andernfalls
+erhalten Sie einen Fehler vom Proxy-Modul. Verwenden Sie dieses Flag,
+um eine leistungsfähigere Implementierung der <directive
+module="mod_proxy">ProxyPass</directive>-Direktive zu erreichen und
+entfernte Inhalte in den Namensraum des lokalen Servers einzubinden.</p>
+
+<note type="warning">
+<title>Sicherheitswarnung</title>
+<p>Seien Sie vorsichtig beim Aufbau der Ziel-URL der Regel und bedenken Sie
+die Sicherheitsauswirkungen, wenn Sie dem Client Einfluss auf die Menge
+der URLs gewähren, für die Ihr Server als Proxy fungiert. Stellen Sie
+sicher, dass Schema und Hostname-Teil der URL entweder fest sind oder dem
+Client keinen unangemessenen Einfluss gewähren.</p>
+</note>
+
+<note type="warning">
+<title>Leistungswarnung</title>
+<p>Die Verwendung dieses Flags löst die Nutzung von <module>mod_proxy</module> aus,
+ohne Verwaltung persistenter Verbindungen, da in diesem Fall der
+Standard-Worker verwendet wird, der kein Connection-Pooling/-Reuse
+durchführt.</p>
+<p>Um persistente Verbindungen zu nutzen, müssen Sie einen
+<directive module="mod_proxy">Proxy</directive>-Block mindestens für den
+Schema- und Host-Teil der Ziel-URL einrichten, der eine
+<directive module="mod_proxy">ProxySet</directive>-Direktive enthält,
+in der Sie z.B. ein Timeout setzen.</p>
+<p>Wenn Sie es mit <directive module="mod_proxy">ProxyPass</directive> oder
+<directive module="mod_proxy">ProxyPassMatch</directive> einrichten,
+werden persistente Verbindungen automatisch verwendet.</p>
+</note>
+
+<p>Hinweis: <module>mod_proxy</module> muss aktiviert sein, um dieses
+Flag verwenden zu können.</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+Das Ziel (oder der Ersetzungsstring) in einer RewriteRule wird
+standardmäßig als Dateipfad behandelt. Die Verwendung des [PT]-Flags
+bewirkt, dass es stattdessen als URI behandelt wird. Das heißt, die
+Verwendung des [PT]-Flags bewirkt, dass das Ergebnis der <directive
+module="mod_rewrite">RewriteRule</directive> durch die
+URL-Zuordnung zurückgeleitet wird, sodass standortbasierte Zuordnungen
+wie <directive module="mod_alias">Alias</directive>, <directive
+module="mod_alias">Redirect</directive> oder <directive
+module="mod_alias">ScriptAlias</directive> beispielsweise wirksam
+werden können.
+</p>
+
+<p>
+Wenn Sie beispielsweise einen <directive module="mod_alias">Alias</directive>
+für /icons haben und eine <directive
+module="mod_rewrite">RewriteRule</directive> dorthin zeigt, sollten
+Sie das [PT]-Flag verwenden, um sicherzustellen, dass der
+<directive module="mod_alias">Alias</directive> ausgewertet wird.
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+Das Weglassen des [PT]-Flags in diesem Fall führt dazu, dass der Alias
+ignoriert wird und ein 'Datei nicht gefunden'-Fehler zurückgegeben wird.
+</p>
+
+<p>Das <code>PT</code>-Flag impliziert das <code>L</code>-Flag:
+Die Umschreibung wird gestoppt, um die Anfrage an die
+nächste Verarbeitungsphase weiterzuleiten.</p>
+
+<p>Beachten Sie, dass das <code>PT</code>-Flag in Verzeichniskontexten
+wie <directive type="section" module="core">Directory</directive>-Abschnitten
+oder in <code>.htaccess</code>-Dateien impliziert ist. Die einzige
+Möglichkeit, dies zu umgehen, ist die Umschreibung zu <code>-</code>.</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+Wenn der Ersetzungs-URI einen Query-String enthält, ist das Standardverhalten
+von <directive module="mod_rewrite">RewriteRule</directive>, den vorhandenen
+Query-String zu verwerfen und durch den neu generierten zu ersetzen.
+Die Verwendung des [QSA]-Flags bewirkt, dass die Query-Strings kombiniert
+werden.
+</p>
+
+<p>Betrachten Sie die folgende Regel:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>Mit dem [QSA]-Flag wird eine Anfrage für <code>/pages/123?one=two</code>
+auf <code>/page.php?page=123&amp;one=two</code> abgebildet. Ohne das
+[QSA]-Flag wird dieselbe Anfrage auf <code>/page.php?page=123</code>
+abgebildet - das heißt, der vorhandene Query-String wird verworfen.
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+Wenn der angeforderte URI einen Query-String enthält und der Ziel-URI
+nicht, ist das Standardverhalten von <directive
+module="mod_rewrite">RewriteRule</directive>, diesen Query-String in den
+Ziel-URI zu kopieren. Die Verwendung des [QSD]-Flags bewirkt, dass der
+Query-String verworfen wird.
+</p>
+
+<p>Dieses Flag ist ab Version 2.4.0 verfügbar.</p>
+
+<p>
+Die gemeinsame Verwendung von [QSD] und [QSA] führt dazu, dass [QSD]
+Vorrang hat.
+</p>
+
+<p>
+Wenn der Ziel-URI einen Query-String hat, wird das Standardverhalten
+beobachtet - das heißt, der ursprüngliche Query-String wird verworfen und
+durch den Query-String im <code>RewriteRule</code>-Ziel-URI ersetzt.
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+Standardmäßig trennt das erste (linkeste) Fragezeichen in der Ersetzung
+den Pfad vom Query-String. Die Verwendung des [QSL]-Flags weist
+<directive module="mod_rewrite">RewriteRule</directive> an, stattdessen
+die beiden Komponenten beim letzten (rechtesten) Fragezeichen zu trennen.
+</p>
+
+<p>
+Dies ist nützlich bei der Zuordnung zu Dateien, die literale Fragezeichen
+in ihrem Dateinamen haben. Wenn kein Query-String in der Ersetzung
+verwendet wird, kann ein Fragezeichen in Kombination mit diesem Flag
+angehängt werden.
+</p>
+
+<p>Dieses Flag ist ab Version 2.4.19 verfügbar.</p>
+
+</section>
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+Die Verwendung des [R]-Flags bewirkt, dass eine HTTP-Umleitung an den
+Browser gesendet wird. Wenn eine vollqualifizierte URL angegeben wird
+(das heißt, einschließlich <code>http://servername/</code>), wird eine
+Umleitung an diesen Ort durchgeführt. Andernfalls werden das aktuelle
+Protokoll, der Servername und die Portnummer verwendet, um die URL zu
+generieren, die mit der Umleitung gesendet wird.
+</p>
+
+<p>
+<em>Jeder</em> gültige HTTP-Antwort-Statuscode kann angegeben werden,
+mit der Syntax [R=305], wobei standardmäßig ein 302-Statuscode verwendet
+wird, wenn keiner angegeben ist. Der angegebene Statuscode muss nicht
+unbedingt ein Umleitungs-(3xx-)Statuscode sein. Wenn jedoch ein Statuscode
+außerhalb des Umleitungsbereichs (300-399) liegt, wird der
+Ersetzungsstring vollständig verworfen und die Umschreibung gestoppt,
+als ob <code>L</code> verwendet worden wäre.</p>
+
+<p>Zusätzlich zu Antwort-Statuscodes können Sie auch den Umleitungsstatus
+mit ihren symbolischen Namen angeben: <code>temp</code> (Standard),
+<code>permanent</code> oder <code>seeother</code>.</p>
+
+<p>
+Sie werden fast immer [R] in Verbindung mit [L] verwenden wollen (also
+[R,L]), da das [R]-Flag allein <code>http://thishost[:thisport]</code> dem
+URI voranstellt, dies aber dann an die nächste Regel im Regelsatz
+weitergibt, was häufig zu 'Ungültiger URI in Anfrage'-Warnungen führen kann.
+</p>
+
+<p>Hinweis: httpd unterstützt nur Statuscodes, die in der HTTP-Spezifikation
+enthalten sind. Die Verwendung eines nicht erkannten Statuscodes führt zu
+einem 500-Fehler und einer Fehlermeldung im Fehlerprotokoll.</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>Das [S]-Flag wird verwendet, um Regeln zu überspringen, die Sie nicht
+ausführen möchten. Die Syntax des Skip-Flags ist [S=<em>N</em>], wobei
+<em>N</em> die Anzahl der zu überspringenden Regeln angibt (vorausgesetzt,
+die <directive module="mod_rewrite">RewriteRule</directive> und alle
+vorhergehenden <directive module="mod_rewrite">RewriteCond</directive>-Direktiven
+stimmen überein). Dies kann als <code>goto</code>-Anweisung in Ihrem
+Umschreibungsregelsatz betrachtet werden. Im folgenden Beispiel möchten
+wir die <directive module="mod_rewrite">RewriteRule</directive> nur
+ausführen, wenn der angeforderte URI keiner tatsächlichen Datei entspricht.</p>
+
+<highlight language="config">
+# Ist die Anfrage für eine nicht existierende Datei?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Falls ja, überspringe diese zwei RewriteRules
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>Diese Technik ist nützlich, weil eine <directive
+module="mod_rewrite">RewriteCond</directive> nur auf die unmittelbar
+darauf folgende <directive module="mod_rewrite">RewriteRule</directive>
+angewendet wird. Wenn Sie also eine <code>RewriteCond</code> auf mehrere
+<code>RewriteRule</code>s anwenden möchten, besteht eine Möglichkeit darin,
+diese Bedingungen zu negieren und eine <code>RewriteRule</code> mit einem
+[Skip]-Flag hinzuzufügen. Sie können damit Pseudo-if-then-else-Konstrukte
+erstellen: Die letzte Regel der then-Klausel wird zu
+<code>skip=N</code>, wobei N die Anzahl der Regeln in der
+else-Klausel ist:</p>
+<highlight language="config">
+# Existiert die Datei?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Erstelle ein if-then-else-Konstrukt, indem 3 Zeilen übersprungen werden, wenn wir zur "else"-Klausel wollten.
+RewriteRule ".?"                  "-" [S=3]
+
+# WENN die Datei existiert, dann:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # Überspringe die "else"-Klausel.
+    RewriteRule ".?"         "-" [S=1]
+# SONST...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# ENDE
+</highlight>
+
+<p>Es ist wahrscheinlich einfacher, diese Art der Konfiguration mit den
+Direktiven <directive type="section">If</directive>, <directive
+type="section">ElseIf</directive> und <directive
+type="section">Else</directive> zu erreichen.</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>Setzt den MIME-Typ, mit dem die resultierende Antwort gesendet wird.
+Dies hat denselben Effekt wie die <directive
+module="mod_mime">AddType</directive>-Direktive.</p>
+
+<p>Sie könnten beispielsweise die folgende Technik verwenden, um
+Perl-Quellcode als Klartext bereitzustellen, wenn er auf eine bestimmte
+Weise angefordert wird:</p>
+
+<highlight language="config">
+# .pl-Dateien als Klartext bereitstellen
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>Oder wenn Sie eine Kamera haben, die JPEG-Bilder ohne Dateiendungen
+produziert, könnten Sie erzwingen, dass diese Bilder mit dem korrekten
+MIME-Typ bereitgestellt werden, basierend auf ihren Dateinamen:</p>
+
+<highlight language="config">
+# Dateien mit 'IMG' im Namen sind jpg-Bilder.
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>Bitte beachten Sie, dass dies ein triviales Beispiel ist und besser mit
+<directive type="section" module="core">FilesMatch</directive> gelöst werden
+könnte. Berücksichtigen Sie immer die alternativen Lösungen für ein Problem,
+bevor Sie auf Umschreibung zurückgreifen, die stets eine weniger
+effiziente Lösung darstellt als die Alternativen.</p>
+
+<p>
+Bei Verwendung im Verzeichniskontext verwenden Sie nur <code>-</code> (Bindestrich)
+als Ersetzung <em>für die gesamte Runde der <module>mod_rewrite</module>-Verarbeitung</em>,
+da sonst der mit diesem Flag gesetzte MIME-Typ durch eine interne
+Neuverarbeitung verloren geht (einschließlich nachfolgender Runden der
+<module>mod_rewrite</module>-Verarbeitung). Das <code>L</code>-Flag kann in
+diesem Kontext nützlich sein, um die <em>aktuelle</em> Runde der
+<module>mod_rewrite</module>-Verarbeitung zu beenden.</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>Das Setzen dieses Flags ist erforderlich, um eine Umschreibung
+    fortzusetzen, wenn die zu schreibende HTTP-Anfrage ein kodiertes
+    Fragezeichen '%3f' enthält und das umgeschriebene Ergebnis ein '?' in
+    der Ersetzung hat. Dies schützt vor einer bösartigen URL, die eine
+    Erfassung und Neuersetzung des kodierten Fragezeichens ausnutzt.</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>Das Setzen dieses Flags ist erforderlich bei Server-Kontext-Ersetzungen,
+    die mit einer Variable oder Rückreferenz beginnen und zu einem
+    Dateisystempfad aufgelöst werden. Diesen Ersetzungen wird nicht das
+    Document Root vorangestellt. Dies schützt vor einer bösartigen URL,
+    die die expandierte Ersetzung auf einen unerwarteten
+    Dateisystemstandort abbilden lässt.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>Das Setzen dieses Flags verhindert das Zusammenführen mehrerer
+    führender Schrägstriche, wie sie in Windows-UNC-Pfaden verwendet werden.
+    Das Flag ist nicht erforderlich, wenn die Regelersetzung mit mehreren
+    literalen Schrägstrichen beginnt.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/flags.xml.es b/docs/manual/rewrite/flags.xml.es
new file mode 100644 (file)
index 0000000..08618aa
--- /dev/null
@@ -0,0 +1,895 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Banderas de RewriteRule</title>
+
+<summary>
+<p>Este documento describe las banderas que están disponibles para la
+directiva <directive module="mod_rewrite">RewriteRule</directive>,
+proporcionando explicaciones detalladas y ejemplos.</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="introduction"><title>Introducción</title>
+<p>Una <directive module="mod_rewrite">RewriteRule</directive> puede tener
+su comportamiento modificado por una o más banderas. Las banderas se incluyen entre
+corchetes al final de la regla, y múltiples banderas se separan
+con comas.</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>Cada bandera (con algunas excepciones) tiene una forma corta, como
+<code>CO</code>, así como una forma más larga, como <code>cookie</code>.
+Aunque es más común usar
+la forma corta, se recomienda que se familiarice con la
+forma larga, para que recuerde qué se supone que hace cada bandera.
+Algunas banderas toman uno o más argumentos. Las banderas no distinguen entre mayúsculas y minúsculas.</p>
+
+<p>Las banderas que alteran metadatos asociados con la solicitud (T=, H=, E=)
+no tienen efecto en contexto per-directorio y htaccess, cuando una sustitución
+(distinta de '-') se realiza durante la misma ronda de procesamiento de reescritura.
+</p>
+
+<p>Aquí se presentan cada una de las banderas disponibles, junto con un ejemplo
+de cómo podría usarlas.</p>
+</section>
+
+<section id="flag_b"><title>B (escapar referencias inversas)</title>
+<p>La bandera [B] indica a <directive
+module="mod_rewrite">RewriteRule</directive> que escape los caracteres no alfanuméricos
+antes de aplicar la transformación.</p>
+
+<p><module>mod_rewrite</module> tiene que desescapar URLs antes de mapearlas,
+por lo que las referencias inversas se desescapan en el momento en que se aplican.
+Usando la bandera B, los caracteres no alfanuméricos en las referencias inversas
+se escaparán. Por ejemplo, considere la regla:</p>
+
+<p>Para un escape similar de variables del servidor, vea
+    la <a href="#mapfunc">función de mapeo</a> "escape"</p>
+
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>Dado un término de búsqueda de 'x &amp; y/z', un navegador lo codificará como
+'x%20%26%20y%2Fz', haciendo la solicitud 'search/x%20%26%20y%2Fz'. Sin la bandera B,
+esta regla de reescritura mapeará a 'search.php?term=x &amp; y/z', que
+no es una URL válida, y por lo tanto sería codificada como
+<code>search.php?term=x%20&amp;y%2Fz=</code>, que no era lo que se pretendía.</p>
+
+<p>Con la bandera B establecida en esta misma regla, los parámetros se re-codifican
+antes de pasarse a la URL de salida, resultando en un mapeo correcto a
+<code>/search.php?term=x%20%26%20y%2Fz</code>.</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>Tenga en cuenta que también puede necesitar establecer <directive
+module="core">AllowEncodedSlashes</directive> a <code>On</code> para que este
+ejemplo particular funcione, ya que httpd no permite barras codificadas en URLs, y
+devuelve un 404 si ve una.</p>
+
+<p>Este escape es particularmente necesario en una situación de proxy,
+cuando el backend puede fallar si se le presenta una URL sin escapar.</p>
+
+<p>Una alternativa a esta bandera es usar una <directive module="mod_rewrite"
+>RewriteCond</directive> para capturar contra %{THE_REQUEST} que capturará
+cadenas en la forma codificada.</p>
+
+<p>En 2.4.26 y posterior, puede limitar el escape a caracteres específicos
+en las referencias inversas listándolos: <code>[B=#?;]</code>. Nota: El carácter
+de espacio puede usarse en la lista de caracteres a escapar, pero debe entrecomillar
+el tercer argumento completo de <directive module="mod_rewrite">RewriteRule</directive>
+y el espacio no debe ser el último carácter en la lista.</p>
+
+<highlight language="config">
+# Escapar espacios y signos de interrogación. Las comillas alrededor del argumento final
+# son necesarias cuando se incluye un espacio.
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>Para limitar los caracteres escapados de esta manera, vea <a href="#flag_bne">#flag_bne</a>
+        y <a href="#flag_bctls">#flag_bctls</a></p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus (no escapar espacio a +)</title>
+<p>La bandera [BNP] indica a <directive
+module="mod_rewrite">RewriteRule</directive> que escape el carácter de espacio
+en una referencia inversa a %20 en lugar de '+'. Útil cuando la referencia inversa
+se usará en el componente de ruta en lugar de la cadena de consulta.</p>
+
+<highlight language="config">
+# Escapar espacios a %20 en la ruta en lugar de + como se usa en el envío de formularios a través de
+# la cadena de consulta
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+
+<p>Esta bandera está disponible en la versión 2.4.26 y posterior.</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>La bandera [BCTLS] es similar a la bandera [B], pero solo escapa
+caracteres de control y el carácter de espacio. Este es el mismo conjunto de
+caracteres rechazados cuando se copian en la cadena de consulta sin codificar.
+</p>
+
+<highlight language="config">
+# Escapar caracteres de control y espacios
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>Esta bandera está disponible en la versión 2.5.1 y posterior.</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>La lista de caracteres en [BNE=...] se trata como exclusiones de los
+caracteres de las banderas [B] o [BCTLS]. Los caracteres listados no serán
+escapados.
+</p>
+
+<highlight language="config">
+# Escapar los caracteres predeterminados, pero dejar /
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>Esta bandera está disponible en la versión 2.5.1 y posterior.</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>La bandera [C] o [chain] indica que la <directive
+module="mod_rewrite">RewriteRule</directive> está encadenada a la siguiente
+regla. Es decir, si la regla coincide, entonces se procesa como de costumbre y
+el control pasa a la siguiente regla. Sin embargo, si no coincide, entonces
+la siguiente regla, y cualquier otra regla que esté encadenada, se
+omiten.</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>La bandera [CO], o [cookie], le permite establecer una cookie cuando una
+<directive module="mod_rewrite">RewriteRule</directive> particular
+coincide. El argumento consiste en tres campos obligatorios y cinco
+campos opcionales.</p>
+
+<p>La sintaxis completa para la bandera, incluyendo todos los atributos, es la
+siguiente:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>Si se necesita un carácter literal ':' en cualquiera de los campos de la cookie, está disponible una
+sintaxis alternativa. Para optar por la sintaxis alternativa, el
+"Name" de la cookie debe ir precedido por un carácter ';', y los separadores de campo deben
+especificarse como ';'.</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>Debe declarar un nombre, un valor y un dominio para que la cookie se establezca.</p>
+
+<dl>
+<dt>Dominio</dt>
+<dd>El dominio para el cual desea que la cookie sea válida. Este puede ser un
+nombre de host, como <code>www.example.com</code>, o puede ser un dominio,
+como <code>.example.com</code>. Debe tener al menos dos partes
+separadas por un punto. Es decir, no puede ser simplemente <code>.com</code> o
+<code>.net</code>. Las cookies de ese tipo están prohibidas por el modelo de
+seguridad de cookies.</dd>
+</dl>
+
+<p>Opcionalmente también puede establecer los siguientes valores:</p>
+
+<dl>
+<dt>Tiempo de vida</dt>
+<dd>El tiempo durante el cual la cookie persistirá, en minutos.</dd>
+<dd>Un valor de 0 indica que la cookie persistirá solo durante la
+sesión actual del navegador. Este es el valor predeterminado si no se
+especifica ninguno.</dd>
+<dd>Un valor negativo causa que la cookie sea eliminada en el navegador.</dd>
+
+<dt>Ruta</dt>
+<dd>La ruta, en el sitio web actual, para la cual la cookie es válida,
+como <code>/customers/</code> o <code>/files/download/</code>.</dd>
+<dd>Por defecto, esto se establece a <code>/</code> - es decir, todo el
+sitio web.</dd>
+
+<dt>Secure</dt>
+<dd>Si se establece a <code>secure</code>, <code>true</code>, o <code>1</code>,
+la cookie solo se permitirá ser transmitida a través de conexiones seguras (https).</dd>
+
+<dt>httponly</dt>
+<dd>Si se establece a <code>HttpOnly</code>, <code>true</code>, o
+<code>1</code>, la cookie tendrá la bandera <code>HttpOnly</code> establecida,
+lo que significa que la cookie es inaccesible para código JavaScript en
+navegadores que soportan esta característica.</dd>
+
+<dt>samesite</dt>
+<dd>Si se establece a algo distinto de <code>false</code> o <code>0</code>, el atributo <code>SameSite</code>
+se establece al valor especificado. Valores típicos son <code>None</code>,
+<code>Lax</code>, y <code>Strict</code>. Disponible en 2.5.1 y posterior.</dd>
+</dl>
+
+
+<p>Considere este ejemplo:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>En el ejemplo dado, la regla no reescribe la solicitud.
+El destino de reescritura "-" le dice a <module>mod_rewrite</module> que pase la solicitud
+sin cambios. En su lugar, establece una cookie
+llamada 'frontdoor' con un valor de 'yes'. La cookie es válida para cualquier host
+en el dominio <code>.example.com</code>. Se establece para expirar en 1440
+minutos (24 horas) y se devuelve para todas las URIs.</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>La bandera DPI causa que la porción PATH_INFO de la URI reescrita sea
+descartada.</p>
+<p>Esta bandera está disponible en la versión 2.2.12 y posterior.</p>
+<p>En contexto per-directorio, la URI contra la que cada <directive>RewriteRule</directive>
+compara es la concatenación de los valores actuales de la URI
+y PATH_INFO.</p>
+
+<p>La URI actual puede ser la URI inicial solicitada por el cliente, el
+resultado de una ronda anterior de procesamiento de <module>mod_rewrite</module>, o el resultado de
+una regla previa en la ronda actual de procesamiento de <module>mod_rewrite</module>.</p>
+
+<p>En contraste, el PATH_INFO que se añade a la URI antes de cada
+regla refleja solo el valor de PATH_INFO antes de esta ronda de
+procesamiento de <module>mod_rewrite</module>. Como consecuencia, si porciones grandes
+de la URI se hacen coincidir y copian en una sustitución en múltiples
+directivas <directive>RewriteRule</directive>, sin considerar
+qué partes de la URI provienen del PATH_INFO actual, la URI
+final puede tener múltiples copias de PATH_INFO añadidas.</p>
+
+<p>Use esta bandera en cualquier sustitución donde el PATH_INFO que resultó
+del mapeo anterior de esta solicitud al sistema de archivos no es de
+interés. Esta bandera olvida permanentemente el PATH_INFO establecido
+antes de que comenzara esta ronda de procesamiento de <module>mod_rewrite</module>. PATH_INFO no
+se recalculará hasta que se complete la ronda actual de procesamiento de <module>mod_rewrite</module>.
+Las reglas subsiguientes durante esta ronda de procesamiento verán
+solo el resultado directo de las sustituciones, sin ningún PATH_INFO
+añadido.</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>Con la bandera [E], o [env], puede establecer el valor de una variable
+de entorno. Tenga en cuenta que algunas variables de entorno pueden establecerse después de que la regla
+se ejecute, deshaciendo así lo que ha establecido. Vea <a href="../env.html">el
+documento de Variables de Entorno</a> para más detalles sobre cómo funcionan las variables
+de entorno.</p>
+
+<p>La sintaxis completa para esta bandera es:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code> puede contener referencias inversas (<code>$N</code> o
+<code>%N</code>) que se expanden.</p>
+
+<p>Usando la forma corta</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p>puede establecer la variable de entorno llamada <code>VAR</code> a un
+valor vacío.</p>
+
+<p>La forma</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>permite eliminar una variable de entorno previamente establecida
+llamada <code>VAR</code>.</p>
+
+<p>Las variables de entorno pueden usarse en una variedad de
+contextos, incluyendo programas CGI, otras directivas RewriteRule, o
+directivas CustomLog.</p>
+
+<p>El siguiente ejemplo establece una variable de entorno llamada 'image' con un
+valor de '1' si la URI solicitada es un archivo de imagen. Entonces, esa
+variable de entorno se usa para excluir esas solicitudes del registro de
+acceso.</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>Tenga en cuenta que este mismo efecto se puede obtener usando <directive
+module="mod_setenvif">SetEnvIf</directive>. Esta técnica se ofrece como
+un ejemplo, no como una recomendación.</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>Usar la bandera [END] termina no solo la ronda actual de procesamiento de
+reescritura (como [L]) sino también previene que cualquier procesamiento de
+reescritura posterior ocurra en contexto per-directorio (htaccess).</p>
+
+<p>Esto no se aplica a nuevas solicitudes resultantes de
+redirecciones externas.</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>Usar la bandera [F] causa que el servidor devuelva un código de estado 403 Forbidden
+al cliente. Aunque el mismo comportamiento puede lograrse usando
+la directiva <directive module="mod_access_compat">Deny</directive>, esto
+permite más flexibilidad en la asignación de un estado Forbidden.</p>
+
+<p>La siguiente regla prohibirá que archivos <code>.exe</code> sean
+descargados de su servidor.</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>Este ejemplo usa la sintaxis "-" para el destino de reescritura, que significa
+que la URI solicitada no se modifica. No hay razón para reescribir a
+otra URI, si va a prohibir la solicitud.</p>
+
+<p>Cuando se usa [F], se implica un [L] - es decir, la respuesta se devuelve
+inmediatamente, y no se evalúan más reglas.</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>La bandera [G] fuerza al servidor a devolver un estado 410 Gone con la
+respuesta. Esto indica que un recurso solía estar disponible, pero ya no
+lo está.</p>
+
+<p>Como con la bandera [F], normalmente usará la sintaxis "-" para el
+destino de reescritura cuando use la bandera [G]:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>Cuando se usa [G], se implica un [L] - es decir, la respuesta se devuelve
+inmediatamente, y no se evalúan más reglas.</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>Fuerza que la solicitud resultante sea manejada con el manejador
+especificado. Por ejemplo, uno podría usar esto para forzar que todos los archivos sin
+extensión de archivo sean procesados por el manejador de php:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+La expresión regular anterior - <code>!\.</code> - coincidirá con cualquier solicitud
+que no contenga el carácter literal <code>.</code>.
+</p>
+
+<p>Esto también puede usarse para forzar el manejador basado en algunas condiciones.
+Por ejemplo, el siguiente fragmento usado en contexto per-servidor permite que
+archivos <code>.php</code> sean <em>mostrados</em> por <code>mod_php</code>
+si se solicitan con la extensión <code>.phps</code>:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>La expresión regular anterior - <code>^(/source/.+\.php)s$</code> - coincidirá
+con cualquier solicitud que comience con <code>/source/</code> seguido de 1 o
+más caracteres seguidos de <code>.phps</code> literalmente. La referencia inversa
+$1 se refiere a la coincidencia capturada dentro de los paréntesis de la expresión
+regular.</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>La bandera [L] causa que <module>mod_rewrite</module> deje de procesar
+el conjunto de reglas. En la mayoría de los contextos, esto significa que si la regla coincide, no
+se procesarán más reglas. Esto corresponde al
+comando <code>last</code> en Perl, o al comando <code>break</code> en
+C. Use esta bandera para indicar que la regla actual debe aplicarse
+inmediatamente sin considerar más reglas.</p>
+
+<p>Si está usando <directive
+module="mod_rewrite">RewriteRule</directive> en archivos
+<code>.htaccess</code> o en
+secciones <directive type="section" module="core">Directory</directive>,
+es importante entender cómo se procesan las reglas. La forma simplificada de esto es que una vez que las reglas han sido
+procesadas, la solicitud reescrita se devuelve al motor de análisis
+de URL para que haga lo que pueda con ella. Es posible que mientras se maneja la solicitud reescrita, el archivo <code>.htaccess</code> o
+la sección <directive type="section" module="core">Directory</directive>
+pueda encontrarse de nuevo, y así el conjunto de reglas pueda ejecutarse de nuevo desde el
+inicio. Lo más común es que esto suceda si una de las reglas causa una
+redirección - ya sea interna o externa - causando que el proceso de solicitud
+comience de nuevo.</p>
+
+<p>Es por lo tanto importante, si está usando directivas <directive
+module="mod_rewrite">RewriteRule</directive> en uno de estos
+contextos, que tome pasos explícitos para evitar bucles en las reglas, y no
+contar únicamente con la bandera [L] para terminar la ejecución de una serie de
+reglas, como se muestra a continuación.</p>
+
+<p>Una bandera alternativa, [END], puede usarse para terminar no solo la
+ronda actual de procesamiento de reescritura sino prevenir cualquier
+procesamiento de reescritura posterior en contexto per-directorio
+(htaccess). Esto no se aplica a nuevas solicitudes resultantes de
+redirecciones externas.</p>
+
+<p>El ejemplo dado aquí reescribirá cualquier solicitud a
+<code>index.php</code>, dando la solicitud original como un argumento de cadena
+de consulta a <code>index.php</code>, sin embargo, la <directive
+module="mod_rewrite">RewriteCond</directive> asegura que si la solicitud
+ya es para <code>index.php</code>, la <directive
+module="mod_rewrite">RewriteRule</directive> se omitirá.</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+La bandera [N] causa que el conjunto de reglas comience de nuevo desde el principio, usando
+el resultado del conjunto de reglas hasta el momento como punto de partida. Use
+con extrema precaución, ya que puede resultar en un bucle.
+</p>
+<p>
+La bandera [Next] podría usarse, por ejemplo, si deseara reemplazar una
+cierta cadena o letra repetidamente en una solicitud. El ejemplo mostrado aquí
+reemplazará A con B en todas partes de una solicitud, y continuará haciéndolo
+hasta que no haya más As por reemplazar.
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>Puede pensar en esto como un bucle <code>while</code>: Mientras este
+patrón siga coincidiendo (es decir, mientras la URI aún contenga una
+<code>A</code>), realice esta sustitución (es decir, reemplace la
+<code>A</code> con una <code>B</code>).</p>
+
+<p>En 2.5.0 y posterior, este módulo devuelve un error después de 10,000 iteraciones para
+proteger contra bucles no intencionados. Se puede especificar un número máximo alternativo de
+iteraciones añadiéndolo a la bandera N. </p>
+<highlight language="config">
+# Estar dispuesto a reemplazar 1 carácter en cada pasada del bucle
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ... o, rendirse después de 10 bucles
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>El uso de la bandera [NC] causa que la <directive
+module="mod_rewrite">RewriteRule</directive> se evalúe de manera
+insensible a mayúsculas/minúsculas. Es decir, no importa si las letras aparecen
+en mayúsculas o minúsculas en la URI coincidente.</p>
+
+<p>En el ejemplo siguiente, cualquier solicitud de un archivo de imagen será proxied
+a su servidor de imágenes dedicado. La coincidencia es insensible a mayúsculas/minúsculas, de modo que
+archivos <code>.jpg</code> y <code>.JPG</code> son ambos aceptables, por
+ejemplo.</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>Por defecto, cuando una <directive module="mod_rewrite">RewriteRule</directive>
+resulta en una redirección externa, cualquier carácter en la salida que no esté
+en el siguiente conjunto seguro será convertido a sus equivalentes en hexadecimal
+(codificación porcentual):</p>
+
+<ul>
+  <li>Caracteres alfanuméricos: <code>A-Z</code>, <code>a-z</code>,
+  <code>0-9</code></li>
+  <li>Caracteres especiales: <code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>Por ejemplo, <code>#</code> se convertiría a <code>%23</code>,
+y <code>?</code> a <code>%3F</code>. El carácter <code>%</code>
+también se escapa (a <code>%25</code>), lo que significa que cualquier
+codificación porcentual ya presente en la sustitución será
+doblemente codificada.</p>
+
+<p>Usar la bandera [NE] previene este escape, permitiendo que caracteres
+como <code>#</code> y <code>?</code> pasen a la
+URL de redirección sin modificar.</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+El ejemplo anterior redirigirá <code>/anchor/xyz</code> a
+<code>/bigpage.html#xyz</code>. Omitir la [NE] resultará en que el #
+sea convertido a su equivalente hexadecimal, <code>%23</code>, lo que
+entonces resultará en una condición de error 404 No Encontrado.
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>El uso de la bandera [NS] previene que la regla se use en
+sub-solicitudes. Por ejemplo, una página incluida usando un SSI (Server
+Side Include) es una sub-solicitud, y usted puede querer evitar que las reescrituras
+ocurran en esas sub-solicitudes. También, cuando <module>mod_dir</module>
+intenta encontrar información sobre posibles archivos predeterminados de directorio
+(como archivos <code>index.html</code>), esto es una
+sub-solicitud interna, y a menudo querrá evitar reescrituras en tales sub-solicitudes.
+En sub-solicitudes, no siempre es útil, e incluso puede causar errores, si
+el conjunto completo de reglas se aplica. Use esta bandera para excluir
+reglas problemáticas.</p>
+
+<p>Para decidir si usar o no esta regla: si prefija URLs con
+scripts CGI, para forzar que sean procesadas por el script CGI, es
+probable que tenga problemas (o una sobrecarga significativa)
+en sub-solicitudes. En estos casos, use esta bandera.</p>
+
+<p>
+Imágenes, archivos javascript, o archivos css, cargados como parte de una página HTML,
+no son sub-solicitudes - el navegador los solicita como solicitudes HTTP
+separadas.
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>El uso de la bandera [P] causa que la solicitud sea manejada por
+<module>mod_proxy</module>, y procesada a través de una solicitud proxy. Por
+ejemplo, si quisiera que todas las solicitudes de imágenes fueran manejadas por un servidor
+de imágenes backend, podría hacer algo como lo siguiente:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>El uso de la bandera [P] implica [L] - es decir, la solicitud se envía inmediatamente
+a través del proxy, y cualquier regla siguiente no será
+considerada.</p>
+
+<p>
+Debe asegurarse de que la cadena de sustitución sea una URI válida
+(típicamente comenzando con <code>http://</code><em>hostname</em>) que pueda ser
+manejada por <module>mod_proxy</module>. Si no, obtendrá un
+error del módulo proxy. Use esta bandera para lograr una
+implementación más potente de la directiva <directive
+module="mod_proxy">ProxyPass</directive>,
+para mapear contenido remoto al espacio de nombres del servidor local.</p>
+
+<note type="warning">
+<title>Advertencia de Seguridad</title>
+<p>Tenga cuidado al construir la URL destino de la regla, considerando
+el impacto de seguridad de permitir que el cliente influya en el conjunto de
+URLs a las que su servidor actuará como proxy. Asegúrese de que la parte del esquema
+y nombre de host de la URL sea fija, o no permita al
+cliente una influencia indebida.</p>
+</note>
+
+<note type="warning">
+<title>Advertencia de Rendimiento</title>
+<p>Usar esta bandera provoca el uso de <module>mod_proxy</module>, sin
+manejo de conexiones persistentes ya que se usa el worker predeterminado en este caso,
+el cual no maneja agrupación/reutilización de conexiones.</p>
+<p>Para usar conexiones persistentes necesita configurar un
+bloque <directive module="mod_proxy">Proxy</directive> al menos para la parte del esquema
+y host de la URL destino conteniendo una
+directiva <directive module="mod_proxy">ProxySet</directive> donde por ejemplo establezca
+un timeout.</p>
+<p>Si lo configura con <directive module="mod_proxy">ProxyPass</directive> o
+<directive module="mod_proxy">ProxyPassMatch</directive> se usarán conexiones
+persistentes automáticamente.</p>
+</note>
+
+<p>Nota: <module>mod_proxy</module> debe estar habilitado para
+usar esta bandera.</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+El destino (o cadena de sustitución) en una RewriteRule se asume que es una
+ruta de archivo, por defecto. El uso de la bandera [PT] causa que sea tratada
+como una URI en su lugar. Es decir, el
+uso de la bandera [PT] causa que el resultado de la <directive
+module="mod_rewrite">RewriteRule</directive> se pase de vuelta a través del
+mapeo de URL, de modo que mapeos basados en ubicación, como <directive
+module="mod_alias">Alias</directive>, <directive
+module="mod_alias">Redirect</directive>, o <directive
+module="mod_alias">ScriptAlias</directive>, por ejemplo, puedan tener la
+oportunidad de tomar efecto.
+</p>
+
+<p>
+Si, por ejemplo, tiene un
+<directive module="mod_alias">Alias</directive>
+para /icons, y tiene una <directive
+module="mod_rewrite">RewriteRule</directive> apuntando allí, debería
+usar la bandera [PT] para asegurar que el
+<directive module="mod_alias">Alias</directive> sea evaluado.
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+La omisión de la bandera [PT] en este caso causará que el Alias sea
+ignorado, resultando en un error 'Archivo no encontrado'.
+</p>
+
+<p>La bandera <code>PT</code> implica la bandera <code>L</code>:
+la reescritura se detendrá para pasar la solicitud a
+la siguiente fase de procesamiento.</p>
+
+<p>Tenga en cuenta que la bandera <code>PT</code> está implícita en contextos per-directorio
+como secciones
+<directive type="section" module="core">Directory</directive>
+o en archivos <code>.htaccess</code>. La única forma de evitar eso
+es reescribir a <code>-</code>.</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+Cuando la URI de reemplazo contiene una cadena de consulta, el comportamiento predeterminado
+de <directive module="mod_rewrite">RewriteRule</directive> es descartar
+la cadena de consulta existente, y reemplazarla con la recién generada.
+Usar la bandera [QSA] causa que las cadenas de consulta se combinen.
+</p>
+
+<p>Considere la siguiente regla:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>Con la bandera [QSA], una solicitud para <code>/pages/123?one=two</code> será
+mapeada a <code>/page.php?page=123&amp;one=two</code>. Sin la bandera [QSA],
+esa misma solicitud será mapeada a
+<code>/page.php?page=123</code> - es decir, la cadena de consulta existente
+será descartada.
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+Cuando la URI solicitada contiene una cadena de consulta, y la URI destino no
+la contiene, el comportamiento predeterminado de <directive
+module="mod_rewrite">RewriteRule</directive> es copiar esa cadena de consulta
+a la URI destino. Usar la bandera [QSD] causa que la cadena de consulta
+sea descartada.
+</p>
+
+<p>Esta bandera está disponible en la versión 2.4.0 y posterior.</p>
+
+<p>
+Usar [QSD] y [QSA] juntos resultará en que [QSD] tenga precedencia.
+</p>
+
+<p>
+Si la URI destino tiene una cadena de consulta, se observará el comportamiento predeterminado
+- es decir, la cadena de consulta original será descartada y
+reemplazada con la cadena de consulta en la URI destino de la <code>RewriteRule</code>.
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+Por defecto, el primer signo de interrogación (el más a la izquierda) en la sustitución
+delimita la ruta de la cadena de consulta. Usar la bandera [QSL] indica a
+<directive module="mod_rewrite">RewriteRule</directive> que en su lugar divida
+los dos componentes usando el último signo de interrogación (el más a la derecha). </p>
+
+<p>
+Esto es útil cuando se mapea a archivos que tienen signos de interrogación literales en
+sus nombres de archivo. Si no se usa cadena de consulta en la sustitución,
+se puede añadir un signo de interrogación en combinación con esta bandera. </p>
+
+<p>Esta bandera está disponible en la versión 2.4.19 y posterior.</p>
+
+</section>
+
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+El uso de la bandera [R] causa que se emita una redirección HTTP al navegador.
+Si se especifica una URL completamente cualificada (es decir, incluyendo
+<code>http://servername/</code>) entonces se emitirá una redirección a esa
+ubicación. De lo contrario, se usará el protocolo actual, nombre del servidor, y número de puerto
+para generar la URL enviada con la redirección.
+</p>
+
+<p>
+Se puede especificar <em>cualquier</em> código de estado de respuesta HTTP válido,
+usando la sintaxis [R=305], con un código de estado 302 siendo usado por
+defecto si no se especifica ninguno. El código de estado especificado no necesita
+necesariamente ser un código de estado de redirección (3xx). Sin embargo,
+si un código de estado está fuera del rango de redirección (300-399) entonces la
+cadena de sustitución se descarta por completo, y la reescritura se detiene como si
+se usara <code>L</code>.</p>
+
+<p>Además de los códigos de estado de respuesta, también puede especificar estados de
+redirección usando sus nombres simbólicos: <code>temp</code> (predeterminado),
+<code>permanent</code>, o <code>seeother</code>.</p>
+
+<p>
+Casi siempre querrá usar [R] junto con [L] (es decir,
+usar [R,L]) porque por sí sola, la bandera [R] antepone
+<code>http://thishost[:thisport]</code> a la URI, pero luego pasa esto
+a la siguiente regla en el conjunto de reglas, lo que a menudo puede resultar en advertencias de 'URI
+inválida en solicitud'.
+</p>
+
+<p>Nota: httpd solo soporta códigos de estado que están incluidos en la especificación
+HTTP. Usar un código de estado no reconocido resultará en un error 500 y
+un mensaje en el log de errores.</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>La bandera [S] se usa para omitir reglas que no desea ejecutar. La
+sintaxis de la bandera skip es [S=<em>N</em>], donde <em>N</em> indica
+el número de reglas a omitir (siempre que la <directive module="mod_rewrite">
+RewriteRule</directive> y cualquier directiva <directive module="mod_rewrite">
+RewriteCond</directive> precedente coincidan). Esto puede pensarse como una
+sentencia <code>goto</code> en su conjunto de reglas de reescritura. En el siguiente
+ejemplo, solo queremos ejecutar la <directive module="mod_rewrite">
+RewriteRule</directive> si la URI solicitada no corresponde a un
+archivo real.</p>
+
+<highlight language="config">
+# Is the request for a non-existent file?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# If so, skip these two RewriteRules
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>Esta técnica es útil porque una <directive
+module="mod_rewrite">RewriteCond</directive> solo se aplica a la
+<directive module="mod_rewrite">RewriteRule</directive> inmediatamente
+siguiente. Así, si desea hacer que una <code>RewriteCond</code> se aplique
+a varias <code>RewriteRule</code>s, una técnica posible es negar
+esas condiciones y añadir una <code>RewriteRule</code> con una bandera [Skip]. Puede
+usar esto para hacer construcciones pseudo if-then-else: La última regla de
+la cláusula then se convierte en <code>skip=N</code>, donde N es el
+número de reglas en la cláusula else:</p>
+<highlight language="config">
+# Does the file exist?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Create an if-then-else construct by skipping 3 lines if we meant to go to the &quot;else&quot; stanza.
+RewriteRule ".?"                  "-" [S=3]
+
+# IF the file exists, then:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # Skip past the &quot;else&quot; stanza.
+    RewriteRule ".?"         "-" [S=1]
+# ELSE...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# END
+</highlight>
+
+<p>Probablemente sea más fácil lograr este tipo de configuración usando
+las directivas <directive type="section">If</directive>, <directive
+type="section">ElseIf</directive>, y <directive
+type="section">Else</directive> en su lugar.</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>Establece el tipo MIME con el que se enviará la respuesta
+resultante. Esto tiene el mismo efecto que la directiva <directive
+module="mod_mime">AddType</directive>.</p>
+
+<p>Por ejemplo, podría usar la siguiente técnica para servir código fuente Perl
+como texto plano, si se solicita de una manera particular:</p>
+
+<highlight language="config">
+# Servir archivos .pl como texto plano
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>O, quizás, si tiene una cámara que produce imágenes jpeg sin
+extensiones de archivo, podría forzar que esas imágenes sean servidas con el
+tipo MIME correcto por virtud de sus nombres de archivo:</p>
+
+<highlight language="config">
+# Los archivos con 'IMG' en el nombre son imágenes jpg.
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>Por favor tenga en cuenta que este es un ejemplo trivial, y podría hacerse mejor
+usando <directive type="section" module="core">FilesMatch</directive>
+en su lugar. Siempre considere las soluciones
+alternativas a un problema antes de recurrir a rewrite, que invariablemente
+será una solución menos eficiente que las alternativas.</p>
+
+<p>
+Si se usa en contexto per-directorio, use solo <code>-</code> (guión)
+como la sustitución <em>para toda la ronda de procesamiento de <module>mod_rewrite</module></em>,
+de lo contrario el tipo MIME establecido con esta bandera se pierde debido a un
+re-procesamiento interno (incluyendo rondas posteriores de procesamiento de <module>mod_rewrite</module>).
+La bandera <code>L</code> puede ser útil en este contexto para terminar la
+ronda <em>actual</em> de procesamiento de <module>mod_rewrite</module>.</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>Establecer esta bandera es necesario para permitir que una reescritura continúe si la
+    solicitud HTTP que se está reescribiendo tiene un signo de interrogación codificado, '%3f', y el
+    resultado reescrito tiene un '?' en la sustitución. Esto protege contra una URL
+    maliciosa que aproveche una captura y re-sustitución del signo de interrogación
+    codificado.</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>Establecer esta bandera es necesario en sustituciones de ámbito de servidor
+    que comienzan con una variable o referencia inversa y se resuelven a una ruta del sistema de archivos.
+    Estas sustituciones no se prefijan con la raíz del documento.
+    Esto protege contra una URL maliciosa que cause que la sustitución expandida se
+    mapee a una ubicación inesperada del sistema de archivos.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>Establecer esta bandera previene la fusión de múltiples barras iniciales,
+    como se usa en las rutas UNC de Windows. La bandera no es necesaria cuando la
+    sustitución de las reglas comienza con múltiples barras literales.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/flags.xml.ja b/docs/manual/rewrite/flags.xml.ja
new file mode 100644 (file)
index 0000000..e2ef7e2
--- /dev/null
@@ -0,0 +1,853 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>RewriteRule フラグ</title>
+
+<summary>
+<p>このドキュメントでは、<directive module="mod_rewrite">RewriteRule</directive>
+ディレクティブで使用可能なフラグについて、詳細な説明と例を提供します。</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="introduction"><title>はじめに</title>
+<p><directive module="mod_rewrite">RewriteRule</directive> は、
+1 つ以上のフラグによって動作を変更できます。フラグはルールの末尾の
+角括弧内に含まれ、複数のフラグはカンマで区切られます。</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>各フラグ (いくつかの例外を除き) には <code>CO</code> のような短い形式と、
+<code>cookie</code> のような長い形式があります。短い形式を使用するのが
+最も一般的ですが、各フラグの機能を覚えるために長い形式に慣れることを
+お勧めします。一部のフラグは 1 つ以上の引数を取ります。フラグは
+大文字小文字を区別しません。</p>
+
+<p>メタデータを変更するフラグ (T=、H=、E=) は、ディレクトリ単位および
+htaccess コンテキストで、同じ書き換え処理ラウンド中に ('-' 以外の)
+置換が行われる場合、効果がありません。</p>
+
+<p>ここでは、各フラグと使用例を紹介します。</p>
+</section>
+
+<section id="flag_b"><title>B (バックリファレンスのエスケープ)</title>
+<p>[B] フラグは、変換を適用する前に非英数字文字をエスケープするよう
+<directive module="mod_rewrite">RewriteRule</directive> に指示します。</p>
+
+<p><module>mod_rewrite</module> はマッピング前に URL をアンエスケープする
+必要があるため、バックリファレンスは適用時にアンエスケープされています。
+B フラグを使用すると、バックリファレンス内の非英数字文字がエスケープ
+されます。例えば、以下のルールを考えてみてください:</p>
+
+<p>サーバ変数の同様のエスケープについては、"escape"
+    <a href="#mapfunc">マッピング関数</a>を参照してください</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>検索語が 'x &amp; y/z' の場合、ブラウザはこれを
+'x%20%26%20y%2Fz' としてエンコードし、リクエストは 'search/x%20%26%20y%2Fz'
+になります。B フラグがない場合、この書き換えルールは 'search.php?term=x &amp; y/z'
+にマッピングされますが、これは有効な URL ではないため、
+<code>search.php?term=x%20&amp;y%2Fz=</code> としてエンコードされ、
+意図した結果になりません。</p>
+
+<p>同じルールに B フラグを設定すると、パラメータは出力 URL に渡される前に
+再エンコードされ、正しいマッピング
+<code>/search.php?term=x%20%26%20y%2Fz</code> になります。</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>この特定の例を動作させるには、<directive
+module="core">AllowEncodedSlashes</directive> を <code>On</code> に
+設定する必要がある場合があることに注意してください。httpd は URL 内の
+エンコードされたスラッシュを許可せず、見つけた場合は 404 を返します。</p>
+
+<p>このエスケープは特にプロキシの状況で必要です。バックエンドが
+アンエスケープされた URL を受け取ると壊れる可能性があるためです。</p>
+
+<p>このフラグの代替として、<directive module="mod_rewrite"
+>RewriteCond</directive> を使用して %{THE_REQUEST} に対してキャプチャする
+方法があります。これはエンコードされた形式の文字列をキャプチャします。</p>
+
+<p>2.4.26 以降では、エスケープする文字を特定の文字に限定できます:
+<code>[B=#?;]</code>。注: スペース文字はエスケープする文字リストに
+含めることができますが、<directive module="mod_rewrite">RewriteRule</directive>
+の 3 番目の引数全体を引用符で囲む必要があり、スペースはリストの
+最後の文字にしてはいけません。</p>
+
+<highlight language="config">
+# スペースと疑問符をエスケープ。最後の引数の引用符は
+# スペースが含まれる場合に必要です。
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>この方法でエスケープされる文字を制限するには、<a href="#flag_bne">#flag_bne</a>
+        および <a href="#flag_bctls">#flag_bctls</a> を参照してください</p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus (スペースを + にエスケープしない)</title>
+<p>[BNP] フラグは、バックリファレンス内のスペース文字を '+' ではなく
+%20 にエスケープするよう <directive
+module="mod_rewrite">RewriteRule</directive> に指示します。
+バックリファレンスがクエリ文字列ではなくパスコンポーネントで使用される
+場合に便利です。</p>
+
+<highlight language="config">
+# クエリ文字列経由のフォーム送信で使用される + ではなく、
+# パス内のスペースを %20 にエスケープ
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+<p>このフラグはバージョン 2.4.26 以降で使用可能です。</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>[BCTLS] フラグは [B] フラグに似ていますが、制御文字とスペース文字のみを
+エスケープします。これは、エンコードされずにクエリ文字列にコピーされた
+場合に拒否される文字セットと同じです。</p>
+
+<highlight language="config">
+# 制御文字とスペースをエスケープ
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>このフラグはバージョン 2.5.1 以降で使用可能です。</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>[BNE=...] 内の文字リストは、[B] または [BCTLS] フラグの文字に対する
+除外として扱われます。リストされた文字はエスケープされません。</p>
+
+<highlight language="config">
+# デフォルトの文字をエスケープするが、/ は除外
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>このフラグはバージョン 2.5.1 以降で使用可能です。</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>[C] または [chain] フラグは、<directive
+module="mod_rewrite">RewriteRule</directive> が次のルールに
+チェーンされることを示します。つまり、ルールがマッチすると通常通り
+処理され、制御は次のルールに移ります。しかし、マッチしない場合は、
+次のルールおよびチェーンされたその他のルールがスキップされます。</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>[CO] または [cookie] フラグは、特定の
+<directive module="mod_rewrite">RewriteRule</directive> がマッチした場合に
+cookie を設定できるようにします。引数は 3 つの必須フィールドと
+5 つのオプションフィールドで構成されます。</p>
+
+<p>フラグの完全な構文 (すべての属性を含む) は以下の通りです:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>cookie フィールドのいずれかにリテラルの ':' 文字が必要な場合、
+代替構文が利用可能です。代替構文にオプトインするには、cookie の
+"Name" の前に ';' 文字を付け、フィールドセパレータを ';' として
+指定してください。</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>cookie が設定されるためには、名前、値、およびドメインを宣言する
+必要があります。</p>
+
+<dl>
+<dt>Domain</dt>
+<dd>cookie が有効なドメインです。<code>www.example.com</code> のような
+ホスト名か、<code>.example.com</code> のようなドメインです。
+ドットで区切られた少なくとも 2 つのパートが必要です。つまり、
+単に <code>.com</code> や <code>.net</code> にはできません。
+そのような cookie は cookie セキュリティモデルで禁止されています。</dd>
+</dl>
+
+<p>オプションで以下の値も設定できます:</p>
+
+<dl>
+<dt>Lifetime</dt>
+<dd>cookie が保持される時間 (分単位)。</dd>
+<dd>値が 0 の場合、cookie は現在のブラウザセッションの間のみ保持されます。
+指定されない場合のデフォルト値です。</dd>
+<dd>負の値を指定すると、ブラウザで cookie が削除されます。</dd>
+
+<dt>Path</dt>
+<dd>cookie が有効な現在のウェブサイトのパスです。
+<code>/customers/</code> や <code>/files/download/</code> などです。</dd>
+<dd>デフォルトでは <code>/</code> (ウェブサイト全体) に設定されます。</dd>
+
+<dt>Secure</dt>
+<dd><code>secure</code>、<code>true</code>、または <code>1</code> に
+設定すると、cookie はセキュアな (https) 接続経由でのみ送信が許可されます。</dd>
+
+<dt>httponly</dt>
+<dd><code>HttpOnly</code>、<code>true</code>、または <code>1</code> に
+設定すると、cookie に <code>HttpOnly</code> フラグが設定され、
+この機能をサポートするブラウザでは JavaScript コードから cookie に
+アクセスできなくなります。</dd>
+
+<dt>samesite</dt>
+<dd><code>false</code> または <code>0</code> 以外の値に設定すると、
+<code>SameSite</code> 属性が指定された値に設定されます。典型的な値は
+<code>None</code>、<code>Lax</code>、<code>Strict</code> です。
+2.5.1 以降で使用可能です。</dd>
+</dl>
+
+
+<p>以下の例を考えてみましょう:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>この例では、ルールはリクエストを書き換えません。
+書き換えターゲットの "-" は <module>mod_rewrite</module> にリクエストを
+変更せずに通過させることを意味します。代わりに、'frontdoor' という名前で
+値 'yes' の cookie を設定します。cookie は <code>.example.com</code>
+ドメイン内のすべてのホストに対して有効です。有効期限は 1440 分
+(24 時間) で、すべての URI に対して返されます。</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>DPI フラグは、書き換えた URI の PATH_INFO 部分を破棄します。</p>
+<p>このフラグはバージョン 2.2.12 以降で使用可能です。</p>
+<p>ディレクトリ単位のコンテキストでは、各
+<directive>RewriteRule</directive> が比較する URI は、URI と PATH_INFO の
+現在の値を連結したものです。</p>
+
+<p>現在の URI は、クライアントが要求した初期 URI、
+<module>mod_rewrite</module> の前のラウンドの処理結果、または現在のラウンドの
+<module>mod_rewrite</module> 処理の前のルールの結果である可能性があります。</p>
+
+<p>一方、各ルールの前に URI に追加される PATH_INFO は、この
+<module>mod_rewrite</module> 処理ラウンド前の PATH_INFO の値のみを
+反映します。その結果、URI の大部分が複数の
+<directive>RewriteRule</directive> ディレクティブで置換にマッチおよび
+コピーされ、URI のどの部分が現在の PATH_INFO から来たかを考慮しない場合、
+最終的な URI に PATH_INFO の複数のコピーが追加される可能性があります。</p>
+
+<p>前のマッピングの結果としてのこのリクエストの PATH_INFO が不要な
+置換にはこのフラグを使用してください。このフラグは、この
+<module>mod_rewrite</module> 処理ラウンドの開始前に確立された PATH_INFO を
+永続的に破棄します。PATH_INFO は、現在の <module>mod_rewrite</module>
+処理ラウンドが完了するまで再計算されません。このラウンド中の
+後続のルールは、PATH_INFO が追加されていない置換の直接の結果のみを
+参照します。</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>[E] または [env] フラグを使用すると、環境変数の値を設定できます。
+一部の環境変数はルールの実行後に設定される可能性があり、設定した値が
+上書きされることがあることに注意してください。環境変数の動作の詳細は
+<a href="../env.html">環境変数ドキュメント</a>を参照してください。</p>
+
+<p>このフラグの完全な構文は以下の通りです:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code> には展開されるバックリファレンス (<code>$N</code> や
+<code>%N</code>) を含めることができます。</p>
+
+<p>短い形式</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p>を使用すると、<code>VAR</code> という名前の環境変数を空の値に
+設定できます。</p>
+
+<p>以下の形式</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>で、以前に設定された <code>VAR</code> という名前の環境変数を
+削除できます。</p>
+
+<p>環境変数は CGI プログラム、他の RewriteRule ディレクティブ、
+CustomLog ディレクティブなど、さまざまなコンテキストで使用できます。</p>
+
+<p>以下の例は、リクエストされた URI が画像ファイルの場合、'image' という
+環境変数を値 '1' に設定します。その後、その環境変数を使用して、
+それらのリクエストをアクセスログから除外します。</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>この効果は <directive module="mod_setenvif">SetEnvIf</directive> を
+使用しても得られることに注意してください。このテクニックは推奨としてではなく、
+例として提供されています。</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>[END] フラグを使用すると、([L] のように) 現在の書き換え処理ラウンドを
+終了するだけでなく、ディレクトリ単位 (htaccess) コンテキストでの
+以降の書き換え処理も防止します。</p>
+
+<p>これは外部リダイレクトによる新しいリクエストには適用されません。</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>[F] フラグを使用すると、サーバはクライアントに 403 Forbidden
+ステータスコードを返します。同じ動作は
+<directive module="mod_access_compat">Deny</directive> ディレクティブでも
+実現できますが、このフラグの方が Forbidden ステータスの割り当てに
+柔軟性があります。</p>
+
+<p>以下のルールは、サーバから <code>.exe</code> ファイルのダウンロードを
+禁止します。</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>この例は書き換えターゲットに "-" 構文を使用しており、リクエスト URI は
+変更されません。リクエストを禁止するのであれば、別の URI に書き換える
+理由はありません。</p>
+
+<p>[F] を使用すると [L] が暗黙的に含まれます - つまり、レスポンスが
+直ちに返され、後続のルールは評価されません。</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>[G] フラグは、サーバにレスポンスとして 410 Gone ステータスを
+返すよう強制します。これは、リソースがかつて利用可能であったが、
+もはや利用できないことを示します。</p>
+
+<p>[F] フラグと同様に、[G] フラグを使用する場合は通常書き換えターゲットに
+"-" 構文を使用します:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>[G] を使用すると [L] が暗黙的に含まれます - つまり、レスポンスが
+直ちに返され、後続のルールは評価されません。</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>結果のリクエストを指定されたハンドラで処理するよう強制します。
+例えば、ファイル拡張子のないすべてのファイルを php ハンドラで
+解析させるために使用できます:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+上記の正規表現 - <code>!\.</code> - は、リテラルの <code>.</code>
+文字を含まないすべてのリクエストにマッチします。
+</p>
+
+<p>これは条件に基づいてハンドラを強制するためにも使用できます。
+例えば、以下のスニペットをサーバ単位のコンテキストで使用すると、
+<code>.php</code> ファイルが <code>.phps</code> 拡張子でリクエスト
+された場合に <code>mod_php</code> によって<em>表示</em>されます:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>上記の正規表現 - <code>^(/source/.+\.php)s$</code> - は
+<code>/source/</code> で始まり、1 文字以上の任意の文字が続き、
+リテラルの <code>.phps</code> で終わるリクエストにマッチします。
+バックリファレンス $1 は正規表現の括弧内のキャプチャされたマッチを
+参照します。</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>[L] フラグは <module>mod_rewrite</module> にルールセットの処理を
+停止させます。ほとんどのコンテキストで、ルールがマッチした場合、
+以降のルールは処理されなくなります。これは Perl の <code>last</code>
+コマンドや C の <code>break</code> コマンドに相当します。
+このフラグは、後続のルールを考慮せずに現在のルールを直ちに適用
+すべきことを示すために使用します。</p>
+
+<p><code>.htaccess</code> ファイルまたは
+<directive type="section" module="core">Directory</directive>
+セクションで <directive module="mod_rewrite">RewriteRule</directive>
+を使用している場合、ルールがどのように処理されるかについてある程度の
+理解が重要です。簡略化すると、ルールが処理された後、書き換えられた
+リクエストは URL 解析エンジンに渡されます。書き換えられたリクエストが
+処理される際に、<code>.htaccess</code> ファイルまたは
+<directive type="section" module="core">Directory</directive> セクションが
+再び検出され、ルールセットが最初から再実行される可能性があります。
+これは最も一般的に、ルールの 1 つが (内部または外部の) リダイレクトを
+引き起こし、リクエスト処理が最初からやり直される場合に発生します。</p>
+
+<p>したがって、これらのコンテキストで <directive
+module="mod_rewrite">RewriteRule</directive> ディレクティブを使用する場合、
+ルールのループを避けるための明示的な対策を取り、一連のルールの実行
+終了を [L] フラグだけに頼らないことが重要です。以下に示す通りです。</p>
+
+<p>代替フラグ [END] は、現在の書き換え処理ラウンドを終了するだけでなく、
+ディレクトリ単位 (htaccess) コンテキストでの以降の書き換え処理も
+防止するために使用できます。これは外部リダイレクトによる新しい
+リクエストには適用されません。</p>
+
+<p>ここに示す例は、すべてのリクエストを <code>index.php</code> に
+書き換え、元のリクエストを <code>index.php</code> へのクエリ文字列
+引数として渡しますが、<directive module="mod_rewrite">RewriteCond</directive>
+により、リクエストが既に <code>index.php</code> に対するものである場合は
+<directive module="mod_rewrite">RewriteRule</directive> がスキップされます。</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+[N] フラグは、それまでのルールセットの結果を出発点として、ルールセットを
+最初からやり直します。ループを引き起こす可能性があるため、
+極めて慎重に使用してください。
+</p>
+<p>
+[Next] フラグは、例えばリクエスト内の特定の文字列や文字を繰り返し
+置換したい場合に使用できます。ここに示す例は、リクエスト内のすべての
+A を B に置換し、置換すべき A がなくなるまで続けます。
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>これは <code>while</code> ループと考えることができます: このパターンが
+まだマッチする間 (つまり、URI にまだ <code>A</code> が含まれている間)、
+この置換を実行します (つまり、<code>A</code> を <code>B</code> に
+置換します)。</p>
+
+<p>2.5.0 以降では、意図しないループを防ぐため、10,000 回の反復後に
+エラーを返します。N フラグに追加することで、代替の最大反復回数を
+指定できます。</p>
+<highlight language="config">
+# ループの各パスで 1 文字を置換
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ... または、10 ループ後に諦める
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>[NC] フラグを使用すると、<directive
+module="mod_rewrite">RewriteRule</directive> は大文字小文字を
+区別せずにマッチします。つまり、マッチする URI で文字が大文字か
+小文字かを気にしません。</p>
+
+<p>以下の例では、画像ファイルのリクエストは専用の画像サーバに
+プロキシされます。マッチは大文字小文字を区別しないため、例えば
+<code>.jpg</code> と <code>.JPG</code> ファイルの両方が受け入れられます。</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>デフォルトでは、<directive module="mod_rewrite">RewriteRule</directive>
+が外部リダイレクトをもたらす場合、出力内の以下の安全なセット以外の文字は
+16 進コード (パーセントエンコード) に変換されます:</p>
+
+<ul>
+  <li>英数字: <code>A-Z</code>、<code>a-z</code>、
+  <code>0-9</code></li>
+  <li>特殊文字: <code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>例えば、<code>#</code> は <code>%23</code> に、<code>?</code> は
+<code>%3F</code> に変換されます。<code>%</code> 文字もエスケープされ
+(<code>%25</code> に)、これにより置換に既に存在するパーセントエンコーディングが
+二重エンコードされることを意味します。</p>
+
+<p>[NE] フラグを使用すると、このエスケープが防止され、<code>#</code> や
+<code>?</code> などの文字がそのままリダイレクト URL に渡されます。</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+上記の例は <code>/anchor/xyz</code> を <code>/bigpage.html#xyz</code> に
+リダイレクトします。[NE] を省略すると、# が 16 進コード相当の
+<code>%23</code> に変換され、404 Not Found エラーが発生します。
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>[NS] フラグを使用すると、サブリクエストでのルールの使用が
+防止されます。例えば、SSI (Server Side Include) を使用して
+インクルードされたページはサブリクエストであり、それらのサブリクエストで
+書き換えが行われないようにしたい場合があります。また、
+<module>mod_dir</module> がディレクトリのデフォルトファイル
+(<code>index.html</code> ファイルなど) の情報を調べようとする場合も
+内部サブリクエストであり、そのようなサブリクエストでの書き換えを
+避けたい場合が多くあります。サブリクエストでは、ルールの完全なセットが
+適用されると有用でない場合やエラーを引き起こす場合があります。
+問題のあるルールを除外するためにこのフラグを使用してください。</p>
+
+<p>このルールを使用するかどうかを決定するには: CGI スクリプトで
+URL をプレフィックスし、CGI スクリプトで処理させるようにしている場合、
+サブリクエストで問題 (または大きなオーバーヘッド) が発生する
+可能性があります。そのような場合はこのフラグを使用してください。</p>
+
+<p>
+HTML ページの一部として読み込まれる画像、JavaScript ファイル、
+CSS ファイルはサブリクエストではありません - ブラウザがそれらを
+別の HTTP リクエストとしてリクエストします。
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>[P] フラグを使用すると、リクエストは <module>mod_proxy</module> によって
+処理され、プロキシリクエストとして扱われます。例えば、すべての画像
+リクエストをバックエンド画像サーバで処理したい場合、以下のようにします:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>[P] フラグの使用は [L] を暗黙的に含みます - つまり、リクエストは
+直ちにプロキシに送られ、後続のルールは考慮されません。</p>
+
+<p>
+置換文字列が <module>mod_proxy</module> で処理できる有効な URI
+(通常 <code>http://</code><em>hostname</em> で始まる) であることを
+確認する必要があります。そうでない場合、プロキシモジュールからエラーが
+発生します。このフラグは、<directive module="mod_proxy">ProxyPass</directive>
+ディレクティブのより強力な実装を実現し、リモートコンテンツをローカル
+サーバのネームスペースにマッピングするために使用します。</p>
+
+<note type="warning">
+<title>セキュリティ警告</title>
+<p>ルールのターゲット URL を構築する際には、サーバがプロキシとして
+動作する URL のセットに対するクライアントの影響のセキュリティ上の
+影響を考慮してください。URL のスキームとホスト名の部分が固定されているか、
+クライアントに過度の影響を与えないことを確認してください。</p>
+</note>
+
+<note type="warning">
+<title>パフォーマンス警告</title>
+<p>このフラグを使用すると、デフォルトワーカーが使用されるため、
+永続的な接続が処理されない <module>mod_proxy</module> の使用がトリガー
+されます。接続プーリング/再利用が処理されません。</p>
+<p>永続的な接続を使用するには、少なくともターゲット URL のスキームと
+ホスト部分に対する <directive module="mod_proxy">Proxy</directive>
+ブロックを設定し、例えばタイムアウトを設定する
+<directive module="mod_proxy">ProxySet</directive> ディレクティブを
+含めてください。</p>
+<p><directive module="mod_proxy">ProxyPass</directive> または
+<directive module="mod_proxy">ProxyPassMatch</directive> で設定すると、
+永続的な接続が自動的に使用されます。</p>
+</note>
+
+<p>注: このフラグを使用するには <module>mod_proxy</module> が
+有効になっている必要があります。</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+RewriteRule のターゲット (置換文字列) はデフォルトではファイルパスと
+想定されます。[PT] フラグを使用すると、代わりに URI として扱われます。
+つまり、[PT] フラグを使用すると、<directive
+module="mod_rewrite">RewriteRule</directive> の結果が URL マッピングに
+戻され、<directive module="mod_alias">Alias</directive>、<directive
+module="mod_alias">Redirect</directive>、<directive
+module="mod_alias">ScriptAlias</directive> などの場所ベースのマッピングが
+効果を発揮する機会が与えられます。
+</p>
+
+<p>
+例えば、/icons に対する <directive module="mod_alias">Alias</directive> があり、
+そこを指す <directive module="mod_rewrite">RewriteRule</directive> がある
+場合、<directive module="mod_alias">Alias</directive> が評価されるように
+[PT] フラグを使用する必要があります。
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+この場合に [PT] フラグを省略すると、Alias が無視され、
+'File not found' エラーが返されます。
+</p>
+
+<p><code>PT</code> フラグは <code>L</code> フラグを暗黙的に含みます:
+リクエストを処理の次のフェーズに渡すために書き換えが停止されます。</p>
+
+<p><code>PT</code> フラグは、
+<directive type="section" module="core">Directory</directive> セクションや
+<code>.htaccess</code> ファイルなどのディレクトリ単位のコンテキストでは
+暗黙的に含まれることに注意してください。これを回避する唯一の方法は、
+<code>-</code> に書き換えることです。</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+置換 URI にクエリ文字列が含まれる場合、
+<directive module="mod_rewrite">RewriteRule</directive> のデフォルト動作は
+既存のクエリ文字列を破棄し、新しく生成されたもので置き換えることです。
+[QSA] フラグを使用すると、クエリ文字列が結合されます。
+</p>
+
+<p>以下のルールを考えてみましょう:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>[QSA] フラグがある場合、<code>/pages/123?one=two</code> へのリクエストは
+<code>/page.php?page=123&amp;one=two</code> にマッピングされます。
+[QSA] フラグがない場合、同じリクエストは <code>/page.php?page=123</code>
+にマッピングされます - つまり、既存のクエリ文字列は破棄されます。
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+リクエストされた URI にクエリ文字列が含まれ、ターゲット URI に含まれない
+場合、<directive module="mod_rewrite">RewriteRule</directive> のデフォルト
+動作はそのクエリ文字列をターゲット URI にコピーすることです。
+[QSD] フラグを使用すると、クエリ文字列が破棄されます。
+</p>
+
+<p>このフラグはバージョン 2.4.0 以降で使用可能です。</p>
+
+<p>
+[QSD] と [QSA] を一緒に使用すると、[QSD] が優先されます。
+</p>
+
+<p>
+ターゲット URI にクエリ文字列がある場合は、デフォルトの動作が
+観察されます - つまり、元のクエリ文字列は破棄され、
+<code>RewriteRule</code> ターゲット URI のクエリ文字列に
+置き換えられます。
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+デフォルトでは、置換内の最初の (左端の) 疑問符がパスとクエリ文字列を
+区切ります。[QSL] フラグを使用すると、代わりに最後の (右端の) 疑問符で
+2 つのコンポーネントを分割するよう
+<directive module="mod_rewrite">RewriteRule</directive> に指示します。</p>
+
+<p>
+これは、ファイル名にリテラルの疑問符が含まれるファイルへのマッピング時に
+便利です。置換でクエリ文字列が使用されない場合、このフラグと組み合わせて
+疑問符を追加できます。</p>
+
+<p>このフラグはバージョン 2.4.19 以降で使用可能です。</p>
+
+</section>
+
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+[R] フラグを使用すると、ブラウザに HTTP リダイレクトが発行されます。
+完全修飾 URL (つまり <code>http://servername/</code> を含む) が指定された
+場合、その場所へのリダイレクトが発行されます。それ以外の場合は、
+現在のプロトコル、サーバ名、ポート番号がリダイレクトで送信される
+URL の生成に使用されます。
+</p>
+
+<p>
+[R=305] のような構文を使用して、任意の有効な HTTP レスポンスステータス
+コードを指定できます。指定されない場合、デフォルトの 302 ステータスコードが
+使用されます。指定されたステータスコードは必ずしもリダイレクト (3xx)
+ステータスコードである必要はありません。ただし、リダイレクト範囲 (300-399)
+外のステータスコードの場合、置換文字列は完全に破棄され、<code>L</code>
+が使用されたかのように書き換えが停止されます。</p>
+
+<p>レスポンスステータスコードに加えて、シンボリック名を使用して
+リダイレクトステータスを指定することもできます: <code>temp</code>
+(デフォルト)、<code>permanent</code>、または <code>seeother</code>。</p>
+
+<p>
+[R] フラグはほぼ常に [L] と組み合わせて使用します (つまり [R,L])。
+[R] フラグ単独では、URI に <code>http://thishost[:thisport]</code> を
+前置しますが、これをルールセットの次のルールに渡すため、しばしば
+'Invalid URI in request' 警告が発生します。
+</p>
+
+<p>注: httpd は HTTP 仕様に含まれるステータスコードのみをサポートします。
+認識されないステータスコードを使用すると、500 エラーとエラーログ
+メッセージが発生します。</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>[S] フラグは、実行したくないルールをスキップするために使用されます。
+スキップフラグの構文は [S=<em>N</em>] で、<em>N</em> はスキップする
+ルールの数を表します (<directive module="mod_rewrite">RewriteRule</directive>
+と先行する <directive module="mod_rewrite">RewriteCond</directive>
+ディレクティブがマッチする場合)。これは書き換えルールセット内の
+<code>goto</code> 文と考えることができます。以下の例では、リクエストされた
+URI が実際のファイルに対応しない場合にのみ
+<directive module="mod_rewrite">RewriteRule</directive> を実行したいとします。</p>
+
+<highlight language="config">
+# Is the request for a non-existent file?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# If so, skip these two RewriteRules
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>このテクニックが有用なのは、<directive
+module="mod_rewrite">RewriteCond</directive> は直後の
+<directive module="mod_rewrite">RewriteRule</directive> にのみ適用されるため
+です。複数の <code>RewriteRule</code> に <code>RewriteCond</code> を
+適用したい場合の一つの方法は、条件を否定して [Skip] フラグ付きの
+<code>RewriteRule</code> を追加することです。これを使用して疑似的な
+if-then-else 構造を作成できます: then 節の最後のルールが
+<code>skip=N</code> となり、N は else 節のルール数です:</p>
+<highlight language="config">
+# Does the file exist?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Create an if-then-else construct by skipping 3 lines if we meant to go to the &quot;else&quot; stanza.
+RewriteRule ".?"                  "-" [S=3]
+
+# IF the file exists, then:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # Skip past the &quot;else&quot; stanza.
+    RewriteRule ".?"         "-" [S=1]
+# ELSE...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# END
+</highlight>
+
+<p>この種の設定は、代わりに <directive type="section">If</directive>、
+<directive type="section">ElseIf</directive>、<directive
+type="section">Else</directive> ディレクティブを使用する方が
+おそらく簡単でしょう。</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>結果のレスポンスが送信される MIME タイプを設定します。
+これは <directive module="mod_mime">AddType</directive> ディレクティブと
+同じ効果を持ちます。</p>
+
+<p>例えば、特定の方法でリクエストされた場合に Perl ソースコードを
+プレーンテキストとして提供するために、以下のテクニックを使用できます:</p>
+
+<highlight language="config">
+# .pl ファイルをプレーンテキストとして提供
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>あるいは、ファイル拡張子のない jpeg 画像を生成するカメラがある場合、
+ファイル名によって正しい MIME タイプで画像を提供するよう強制できます:</p>
+
+<highlight language="config">
+# 名前に 'IMG' を含むファイルは jpg 画像
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>これは簡単な例であり、代わりに
+<directive type="section" module="core">FilesMatch</directive> を使用する
+方が良いことに注意してください。問題に対する代替の解決策を常に検討して
+から書き換えに頼ってください。書き換えは常に代替手段よりも
+効率が悪くなります。</p>
+
+<p>
+ディレクトリ単位のコンテキストで使用する場合は、
+<module>mod_rewrite</module> 処理の<em>全ラウンド</em>の置換として
+<code>-</code> (ダッシュ) のみを使用してください。そうしないと、
+内部的な再処理 (<module>mod_rewrite</module> 処理の後続ラウンドを含む)
+により、このフラグで設定された MIME タイプが失われます。
+<em>現在の</em> <module>mod_rewrite</module> 処理ラウンドを終了するために
+<code>L</code> フラグが有用です。</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>このフラグを設定すると、書き換え対象の HTTP リクエストに
+    エンコードされた疑問符 '%3f' が含まれ、書き換え結果の置換に
+    '?' がある場合でも書き換えを続行できます。これは、悪意のある
+    URL がエンコードされた疑問符のキャプチャと再置換を利用するのを
+    防止します。</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>このフラグを設定すると、サーバスコープの置換が変数や
+    バックリファレンスで始まり、ファイルシステムパスに解決される場合に
+    必要です。これらの置換にはドキュメントルートがプレフィックスとして
+    付加されません。これは、悪意のある URL が展開された置換を
+    予期しないファイルシステムの場所にマッピングさせるのを防止します。</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>このフラグを設定すると、Windows UNC パスで使用される複数の
+    先頭スラッシュのマージが防止されます。ルールの置換がリテラルの
+    複数スラッシュで始まる場合、このフラグは不要です。</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/flags.xml.ko b/docs/manual/rewrite/flags.xml.ko
new file mode 100644 (file)
index 0000000..bb322d5
--- /dev/null
@@ -0,0 +1,930 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>RewriteRule 플래그</title>
+
+<summary>
+<p>이 문서는 <directive module="mod_rewrite">RewriteRule</directive>
+지시어에 사용할 수 있는 플래그를 논의하며, 자세한 설명과
+예제를 제공합니다.</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="introduction"><title>소개</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>의
+동작은 하나 이상의 플래그로 수정할 수 있습니다. 플래그는
+규칙 끝에 대괄호 안에 포함되며, 여러 플래그는 쉼표로
+구분됩니다.</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>각 플래그는 (몇 가지 예외를 제외하고) <code>CO</code>와
+같은 짧은 형태와 <code>cookie</code>와 같은 긴 형태를
+가집니다. 짧은 형태를 사용하는 것이 가장 일반적이지만,
+각 플래그가 무엇을 하는지 기억하기 위해 긴 형태에
+익숙해지는 것이 좋습니다. 일부 플래그는 하나 이상의
+인수를 취합니다. 플래그는 대소문자를 구분하지 않습니다.</p>
+
+<p>요청과 관련된 메타데이터를 변경하는 플래그(T=, H=, E=)는
+디렉토리별 및 htaccess 컨텍스트에서 동일한 재작성 처리
+라운드 중에 ('-' 이외의) 치환이 수행될 때 효과가 없습니다.
+</p>
+
+<p>여기에서는 사용 가능한 각 플래그와 함께 사용 방법의
+예제가 제시됩니다.</p>
+</section>
+
+<section id="flag_b"><title>B (역참조 이스케이프)</title>
+<p>[B] 플래그는 <directive module="mod_rewrite">RewriteRule</directive>에
+변환을 적용하기 전에 영숫자가 아닌 문자를 이스케이프하도록
+지시합니다.</p>
+
+<p><module>mod_rewrite</module>는 URL을 매핑하기 전에
+이스케이프를 해제해야 하므로, 역참조는 적용될 때
+이스케이프가 해제됩니다. B 플래그를 사용하면 역참조의
+영숫자가 아닌 문자가 이스케이프됩니다.
+예를 들어, 다음 규칙을 고려하십시오:</p>
+
+<p>서버 변수의 유사한 이스케이프에 대해서는
+    "escape" <a href="#mapfunc">매핑 함수</a>를 참조하십시오</p>
+
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>검색어가 'x &amp; y/z'인 경우 브라우저는 이를
+'x%20%26%20y%2Fz'로 인코딩하여 'search/x%20%26%20y%2Fz'
+요청을 만듭니다. B 플래그 없이 이 재작성 규칙은
+'search.php?term=x &amp; y/z'로 매핑되며, 이는 유효한
+URL이 아니므로 <code>search.php?term=x%20&amp;y%2Fz=</code>로
+인코딩되어 의도한 것과 다릅니다.</p>
+
+<p>동일한 규칙에 B 플래그를 설정하면 매개변수가 출력 URL에
+전달되기 전에 다시 인코딩되어
+<code>/search.php?term=x%20%26%20y%2Fz</code>로 올바르게
+매핑됩니다.</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>이 특정 예제가 작동하려면
+<directive module="core">AllowEncodedSlashes</directive>를
+<code>On</code>으로 설정해야 할 수도 있습니다. httpd는
+URL에서 인코딩된 슬래시를 허용하지 않고 하나를 보면
+404를 반환하기 때문입니다.</p>
+
+<p>이 이스케이프는 특히 프록시 상황에서 필요합니다.
+백엔드가 이스케이프되지 않은 URL을 제시받으면 중단될 수
+있기 때문입니다.</p>
+
+<p>이 플래그의 대안은 <directive module="mod_rewrite"
+>RewriteCond</directive>를 사용하여 %{THE_REQUEST}에 대해
+캡처하는 것이며, 이는 인코딩된 형태의 문자열을
+캡처합니다.</p>
+
+<p>2.4.26 이상에서는 역참조에서 이스케이프할 특정 문자를
+나열하여 제한할 수 있습니다: <code>[B=#?;]</code>.
+참고: 이스케이프할 문자 목록에 공백 문자를 사용할 수
+있지만 <directive module="mod_rewrite">RewriteRule</directive>의
+전체 세 번째 인수를 인용해야 하며 공백이 목록의 마지막
+문자가 되어서는 안 됩니다.</p>
+
+<highlight language="config">
+# 공백과 물음표를 이스케이프합니다. 공백이 포함된 경우
+# 최종 인수 주위의 따옴표가 필요합니다.
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>이 방식으로 이스케이프되는 문자를 제한하려면
+<a href="#flag_bne">#flag_bne</a>와
+<a href="#flag_bctls">#flag_bctls</a>를 참조하십시오</p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus (공백을 +로 이스케이프하지 않음)</title>
+<p>[BNP] 플래그는 <directive module="mod_rewrite">RewriteRule</directive>에
+역참조에서 공백 문자를 '+' 대신 %20으로 이스케이프하도록
+지시합니다. 역참조가 쿼리 문자열이 아닌 경로 구성 요소에서
+사용될 때 유용합니다.</p>
+
+<highlight language="config">
+# 쿼리 문자열을 통한 양식 제출에 사용되는 + 대신
+# 경로에서 공백을 %20으로 이스케이프
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+
+<p>이 플래그는 버전 2.4.26 이상에서 사용할 수 있습니다.</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>[BCTLS] 플래그는 [B] 플래그와 유사하지만 제어 문자와
+공백 문자만 이스케이프합니다. 이것은 인코딩되지 않은 채
+쿼리 문자열로 복사될 때 거부되는 동일한 문자 세트입니다.
+</p>
+
+<highlight language="config">
+# 제어 문자와 공백을 이스케이프
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>이 플래그는 버전 2.5.1 이상에서 사용할 수 있습니다.</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>[BNE=...]의 문자 목록은 [B] 또는 [BCTLS] 플래그의
+문자에 대한 제외로 처리됩니다. 나열된 문자는 이스케이프되지
+않습니다.
+</p>
+
+<highlight language="config">
+# 기본 문자를 이스케이프하되 /는 남김
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>이 플래그는 버전 2.5.1 이상에서 사용할 수 있습니다.</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>[C] 또는 [chain] 플래그는 <directive
+module="mod_rewrite">RewriteRule</directive>이 다음 규칙에
+체인되어 있음을 나타냅니다. 즉, 규칙이 일치하면 평소와
+같이 처리되고 제어가 다음 규칙으로 이동합니다. 그러나
+일치하지 않으면 다음 규칙과 함께 체인된 다른 모든 규칙이
+건너뛰어집니다.</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>[CO] 또는 [cookie] 플래그를 사용하면 특정
+<directive module="mod_rewrite">RewriteRule</directive>이
+일치할 때 쿠키를 설정할 수 있습니다. 인수는 세 개의
+필수 필드와 다섯 개의 선택적 필드로 구성됩니다.</p>
+
+<p>플래그의 전체 구문은 모든 속성을 포함하여
+다음과 같습니다:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>쿠키 필드에 리터럴 ':' 문자가 필요한 경우 대체 구문을
+사용할 수 있습니다. 대체 구문을 선택하려면 쿠키 "Name" 앞에
+';' 문자를 붙이고 필드 구분자를 ';'로 지정해야 합니다.</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>쿠키를 설정하려면 이름, 값 및 도메인을 선언해야
+합니다.</p>
+
+<dl>
+<dt>Domain</dt>
+<dd>쿠키가 유효한 도메인입니다. <code>www.example.com</code>과
+같은 호스트명이거나 <code>.example.com</code>과 같은
+도메인일 수 있습니다. 점으로 구분된 최소 두 부분이어야
+합니다. 즉, 단순히 <code>.com</code>이나
+<code>.net</code>일 수 없습니다. 이러한 종류의 쿠키는
+쿠키 보안 모델에 의해 금지됩니다.</dd>
+</dl>
+
+<p>선택적으로 다음 값도 설정할 수 있습니다:</p>
+
+<dl>
+<dt>Lifetime</dt>
+<dd>쿠키가 지속되는 시간(분)입니다.</dd>
+<dd>값이 0이면 쿠키가 현재 브라우저 세션 동안만 지속됩니다.
+지정하지 않으면 이것이 기본값입니다.</dd>
+<dd>음수 값은 브라우저에서 쿠키를 삭제합니다.</dd>
+
+<dt>Path</dt>
+<dd>현재 웹사이트에서 쿠키가 유효한 경로입니다.
+예: <code>/customers/</code> 또는
+<code>/files/download/</code>.</dd>
+<dd>기본적으로 <code>/</code>로 설정됩니다 - 즉,
+전체 웹사이트입니다.</dd>
+
+<dt>Secure</dt>
+<dd><code>secure</code>, <code>true</code> 또는
+<code>1</code>로 설정하면 쿠키는 보안(https) 연결을
+통해서만 전달됩니다.</dd>
+
+<dt>httponly</dt>
+<dd><code>HttpOnly</code>, <code>true</code> 또는
+<code>1</code>로 설정하면 쿠키에
+<code>HttpOnly</code> 플래그가 설정되며, 이는 이 기능을
+지원하는 브라우저에서 쿠키가 JavaScript 코드로 접근할 수
+없음을 의미합니다.</dd>
+
+<dt>samesite</dt>
+<dd><code>false</code> 또는 <code>0</code> 이외의 값으로
+설정하면 <code>SameSite</code> 속성이 지정된 값으로
+설정됩니다. 일반적인 값은 <code>None</code>,
+<code>Lax</code> 및 <code>Strict</code>입니다.
+2.5.1 이상에서 사용할 수 있습니다.</dd>
+</dl>
+
+
+<p>다음 예제를 고려하십시오:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>주어진 예제에서 규칙은 요청을 재작성하지 않습니다.
+"-" 재작성 대상은 <module>mod_rewrite</module>에게 요청을
+변경 없이 통과시키도록 지시합니다. 대신 'frontdoor'라는
+쿠키를 'yes' 값으로 설정합니다. 쿠키는
+<code>.example.com</code> 도메인의 모든 호스트에 유효합니다.
+1440분(24시간) 후에 만료되도록 설정되며 모든 URI에 대해
+반환됩니다.</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>DPI 플래그는 재작성된 URI의 PATH_INFO 부분을
+버립니다.</p>
+<p>이 플래그는 버전 2.2.12 이상에서 사용할 수 있습니다.</p>
+<p>디렉토리별 컨텍스트에서 각
+<directive>RewriteRule</directive>이 비교하는 URI는 URI와
+PATH_INFO의 현재 값의 연결입니다.</p>
+
+<p>현재 URI는 클라이언트가 요청한 초기 URI이거나,
+이전 <module>mod_rewrite</module> 처리 라운드의 결과이거나,
+현재 <module>mod_rewrite</module> 처리 라운드에서 이전
+규칙의 결과일 수 있습니다.</p>
+
+<p>반면, 각 규칙 전에 URI에 추가되는 PATH_INFO는
+이 <module>mod_rewrite</module> 처리 라운드 전의 PATH_INFO
+값만 반영합니다. 결과적으로 URI의 큰 부분이 여러
+<directive>RewriteRule</directive> 지시어에서 치환으로
+일치되고 복사될 때, URI의 어느 부분이 현재 PATH_INFO에서
+왔는지 고려하지 않으면 최종 URI에 PATH_INFO의 여러 복사본이
+추가될 수 있습니다.</p>
+
+<p>이전 요청의 파일 시스템 매핑에서 생성된 PATH_INFO가
+관심 없는 치환에 이 플래그를 사용하십시오. 이 플래그는
+이 <module>mod_rewrite</module> 처리 라운드 전에 설정된
+PATH_INFO를 영구적으로 잊습니다. PATH_INFO는 현재
+<module>mod_rewrite</module> 처리 라운드가 완료될 때까지
+다시 계산되지 않습니다. 이 처리 라운드 중 후속 규칙은
+PATH_INFO가 추가되지 않은 치환의 직접적인 결과만 봅니다.</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>[E] 또는 [env] 플래그를 사용하면 환경 변수의 값을
+설정할 수 있습니다. 일부 환경 변수는 규칙이 실행된 후에
+설정될 수 있으므로, 설정한 것을 해제할 수 있다는 점에
+유의하십시오. 환경 변수의 작동 방식에 대한 자세한 내용은
+<a href="../env.html">환경 변수 문서</a>를 참조하십시오.</p>
+
+<p>이 플래그의 전체 구문은 다음과 같습니다:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code>에는 확장되는 역참조(<code>$N</code>
+또는 <code>%N</code>)가 포함될 수 있습니다.</p>
+
+<p>짧은 형태를 사용하여</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p><code>VAR</code>이라는 환경 변수를 빈 값으로 설정할 수
+있습니다.</p>
+
+<p>다음 형태</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>를 사용하면 이전에 설정된 <code>VAR</code>이라는
+환경 변수를 해제할 수 있습니다.</p>
+
+<p>환경 변수는 CGI 프로그램, 다른 RewriteRule 지시어 또는
+CustomLog 지시어를 포함한 다양한 컨텍스트에서 사용할 수
+있습니다.</p>
+
+<p>다음 예제는 요청된 URI가 이미지 파일인 경우
+'image'라는 환경 변수를 '1' 값으로 설정합니다. 그런 다음
+해당 환경 변수를 사용하여 접근 로그에서 해당 요청을
+제외합니다.</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>이 동일한 효과는 <directive
+module="mod_setenvif">SetEnvIf</directive>를 사용하여 얻을 수
+있습니다. 이 기술은 권장 사항이 아닌 예제로 제공됩니다.</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>[END] 플래그를 사용하면 ([L]과 같이) 현재 재작성 처리
+라운드를 종료할 뿐만 아니라 디렉토리별(htaccess)
+컨텍스트에서 후속 재작성 처리가 발생하는 것도
+방지합니다.</p>
+
+<p>이것은 외부 리다이렉트로 인한 새 요청에는 적용되지
+않습니다.</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>[F] 플래그를 사용하면 서버가 클라이언트에 403 Forbidden
+상태 코드를 반환합니다. <directive
+module="mod_access_compat">Deny</directive> 지시어를
+사용하여 동일한 동작을 수행할 수 있지만, 이것은 Forbidden
+상태를 할당하는 데 더 많은 유연성을 제공합니다.</p>
+
+<p>다음 규칙은 서버에서 <code>.exe</code> 파일의
+다운로드를 금지합니다.</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>이 예제는 재작성 대상에 "-" 구문을 사용하며, 요청된
+URI가 수정되지 않음을 의미합니다. 요청을 금지하려는 경우
+다른 URI로 재작성할 이유가 없습니다.</p>
+
+<p>[F]를 사용할 때 [L]이 암시됩니다 - 즉, 응답이 즉시
+반환되고 추가 규칙은 평가되지 않습니다.</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>[G] 플래그는 서버가 응답과 함께 410 Gone 상태를
+반환하도록 강제합니다. 이것은 자원이 이전에 사용
+가능했지만 더 이상 사용할 수 없음을 나타냅니다.</p>
+
+<p>[F] 플래그와 마찬가지로 [G] 플래그를 사용할 때는
+일반적으로 재작성 대상에 "-" 구문을 사용합니다:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>[G]를 사용할 때 [L]이 암시됩니다 - 즉, 응답이 즉시
+반환되고 추가 규칙은 평가되지 않습니다.</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>결과 요청이 지정된 핸들러로 처리되도록 강제합니다.
+예를 들어, 파일 확장자가 없는 모든 파일을 php 핸들러로
+파싱하도록 강제할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+위의 정규 표현식 - <code>!\.</code> - 은 리터럴 <code>.</code>
+문자를 포함하지 않는 모든 요청과 일치합니다.
+</p>
+
+<p>이것은 일부 조건에 따라 핸들러를 강제하는 데에도
+사용할 수 있습니다. 예를 들어, 서버별 컨텍스트에서 사용되는
+다음 스니펫은 <code>.phps</code> 확장자로 요청된 경우
+<code>.php</code> 파일을 <code>mod_php</code>에 의해
+<em>표시</em>되도록 합니다:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>위의 정규 표현식 - <code>^(/source/.+\.php)s$</code> -
+은 <code>/source/</code>로 시작하고 1개 이상의 문자가 뒤따르고
+리터럴 <code>.phps</code>가 뒤따르는 모든 요청과 일치합니다.
+역참조 $1은 정규 표현식의 괄호 안의 캡처된 일치를
+참조합니다.</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>[L] 플래그는 <module>mod_rewrite</module>가 규칙 세트의
+처리를 중지하도록 합니다. 대부분의 컨텍스트에서 이것은
+규칙이 일치하면 더 이상 규칙이 처리되지 않음을 의미합니다.
+이것은 Perl의 <code>last</code> 명령이나 C의
+<code>break</code> 명령에 해당합니다. 이 플래그를 사용하여
+현재 규칙이 추가 규칙을 고려하지 않고 즉시 적용되어야
+함을 나타냅니다.</p>
+
+<p><code>.htaccess</code> 파일이나
+<directive type="section" module="core">Directory</directive>
+섹션에서 <directive module="mod_rewrite">RewriteRule</directive>을
+사용하는 경우 규칙이 처리되는 방식에 대한 이해가 중요합니다.
+이것의 간단한 형태는 규칙이 처리되면 재작성된 요청이
+URL 파싱 엔진에 다시 전달되어 처리된다는 것입니다.
+재작성된 요청이 처리될 때 <code>.htaccess</code> 파일이나
+<directive type="section" module="core">Directory</directive>
+섹션이 다시 만나질 수 있으며, 따라서 규칙 세트가 처음부터
+다시 실행될 수 있습니다. 가장 일반적으로 이것은 규칙 중
+하나가 내부 또는 외부 리다이렉트를 일으켜 요청 처리가
+다시 시작되는 경우에 발생합니다.</p>
+
+<p>따라서 이러한 컨텍스트 중 하나에서 <directive
+module="mod_rewrite">RewriteRule</directive> 지시어를
+사용하는 경우 규칙의 루핑을 피하기 위한 명시적 조치를
+취하고, 아래에 표시된 대로 일련의 규칙의 실행을 종료하기
+위해 [L] 플래그에만 의존하지 않는 것이 중요합니다.</p>
+
+<p>대안 플래그인 [END]는 현재 재작성 처리 라운드를
+종료할 뿐만 아니라 디렉토리별(htaccess) 컨텍스트에서
+후속 재작성 처리가 발생하는 것도 방지합니다. 이것은
+외부 리다이렉트로 인한 새 요청에는 적용되지 않습니다.</p>
+
+<p>여기 주어진 예제는 모든 요청을 <code>index.php</code>로
+재작성하며, 원래 요청을 <code>index.php</code>에 쿼리 문자열
+인수로 제공합니다. 그러나
+<directive module="mod_rewrite">RewriteCond</directive>는
+요청이 이미 <code>index.php</code>에 대한 것인 경우
+<directive module="mod_rewrite">RewriteRule</directive>이
+건너뛰어지도록 합니다.</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+[N] 플래그는 규칙 세트를 지금까지의 규칙 세트 결과를
+시작점으로 사용하여 처음부터 다시 시작하도록 합니다.
+루프를 초래할 수 있으므로 극도의 주의를 기울여
+사용하십시오.
+</p>
+<p>
+[Next] 플래그는 예를 들어, 요청에서 특정 문자열이나
+문자를 반복적으로 대체하려는 경우에 사용할 수 있습니다.
+여기 표시된 예제는 요청의 모든 곳에서 A를 B로 대체하며
+더 이상 대체할 A가 없을 때까지 계속합니다.
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>이것을 <code>while</code> 루프로 생각할 수 있습니다:
+이 패턴이 여전히 일치하는 동안(즉, URI에 여전히
+<code>A</code>가 포함되어 있는 동안) 이 치환을
+수행합니다(즉, <code>A</code>를 <code>B</code>로
+대체합니다).</p>
+
+<p>2.5.0 이상에서 이 모듈은 의도하지 않은 루핑으로부터
+보호하기 위해 10,000번의 반복 후에 오류를 반환합니다.
+N 플래그에 추가하여 대안적인 최대 반복 횟수를 지정할 수
+있습니다.</p>
+<highlight language="config">
+# 루프의 각 패스에서 1개의 문자를 대체할 의향
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ... 또는 10번 루프 후 포기
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>[NC] 플래그를 사용하면
+<directive module="mod_rewrite">RewriteRule</directive>이
+대소문자를 구분하지 않는 방식으로 일치됩니다. 즉,
+일치하는 URI에서 문자가 대문자인지 소문자인지 상관하지
+않습니다.</p>
+
+<p>아래 예제에서 이미지 파일에 대한 모든 요청은 전용
+이미지 서버로 프록시됩니다. 일치는 대소문자를 구분하지
+않으므로, 예를 들어 <code>.jpg</code>와 <code>.JPG</code>
+파일 모두 허용됩니다.</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>기본적으로 <directive module="mod_rewrite">RewriteRule</directive>이
+외부 리다이렉트로 이어질 때, 출력에서 다음 안전 세트에 포함되지
+않는 모든 문자는 16진수 코드(퍼센트 인코딩)로 변환됩니다:</p>
+
+<ul>
+  <li>영숫자 문자: <code>A-Z</code>, <code>a-z</code>,
+  <code>0-9</code></li>
+  <li>특수 문자: <code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>예를 들어, <code>#</code>은 <code>%23</code>으로,
+<code>?</code>는 <code>%3F</code>로 변환됩니다.
+<code>%</code> 문자도 (<code>%25</code>로) 이스케이프되므로
+치환에 이미 존재하는 퍼센트 인코딩이 이중 인코딩됩니다.</p>
+
+<p>[NE] 플래그를 사용하면 이 이스케이프를 방지하여
+<code>#</code>과 <code>?</code>와 같은 문자가 수정되지 않고
+리다이렉트 URL로 전달됩니다.</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+위의 예제는 <code>/anchor/xyz</code>를
+<code>/bigpage.html#xyz</code>로 리다이렉트합니다.
+[NE]를 생략하면 #이 16진수 코드인 <code>%23</code>으로
+변환되어 404 Not Found 오류 조건이 발생합니다.
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>[NS] 플래그를 사용하면 서브요청에서 규칙이 사용되는 것을
+방지합니다. 예를 들어, SSI(Server Side Include)를 사용하여
+포함된 페이지는 서브요청이며, 해당 서브요청에서 재작성이
+발생하는 것을 피하고 싶을 수 있습니다. 또한
+<module>mod_dir</module>이 가능한 디렉토리 기본 파일(예:
+<code>index.html</code> 파일)에 대한 정보를 찾으려 할 때
+이것은 내부 서브요청이며, 종종 이러한 서브요청에서
+재작성을 피하고 싶을 것입니다. 서브요청에서는 전체
+규칙 세트가 적용되는 것이 항상 유용하지 않으며 오류를
+일으킬 수도 있습니다. 이 플래그를 사용하여 문제가 되는
+규칙을 제외하십시오.</p>
+
+<p>이 규칙을 사용할지 여부를 결정하려면: CGI 스크립트로
+URL에 접두사를 붙여 CGI 스크립트에 의해 처리되도록 강제하는
+경우, 서브요청에서 문제(또는 상당한 오버헤드)가 발생할
+가능성이 있습니다. 이러한 경우 이 플래그를
+사용하십시오.</p>
+
+<p>
+HTML 페이지의 일부로 로드되는 이미지, 자바스크립트 파일
+또는 CSS 파일은 서브요청이 아닙니다 - 브라우저는 이를
+별도의 HTTP 요청으로 요청합니다.
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>[P] 플래그를 사용하면 요청이
+<module>mod_proxy</module>에 의해 처리되고 프록시 요청을
+통해 처리됩니다. 예를 들어, 모든 이미지 요청이 백엔드
+이미지 서버에 의해 처리되도록 하려면 다음과 같이 할 수
+있습니다:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>[P] 플래그를 사용하면 [L]이 암시됩니다 - 즉, 요청이
+즉시 프록시를 통해 전달되고 이후의 규칙은 고려되지
+않습니다.</p>
+
+<p>
+치환 문자열이 <module>mod_proxy</module>가 처리할 수 있는
+유효한 URI(일반적으로 <code>http://</code><em>hostname</em>으로
+시작)인지 확인해야 합니다. 그렇지 않으면 프록시 모듈에서
+오류가 발생합니다. 이 플래그를 사용하여 로컬 서버의 네임스페이스에
+원격 콘텐츠를 매핑하는
+<directive module="mod_proxy">ProxyPass</directive> 지시어의
+더 강력한 구현을 달성합니다.</p>
+
+<note type="warning">
+<title>보안 경고</title>
+<p>규칙의 대상 URL을 구성할 때, 서버가 프록시로 작동할
+URL 세트에 대한 클라이언트의 영향으로 인한 보안 영향을
+고려하여 주의하십시오. URL의 스키마 및 호스트명 부분이
+고정되어 있거나 클라이언트에게 부당한 영향을 주지
+않도록 하십시오.</p>
+</note>
+
+<note type="warning">
+<title>성능 경고</title>
+<p>이 플래그를 사용하면 <module>mod_proxy</module>의 사용이
+트리거되며, 이 경우 기본 워커가 사용되어 연결
+풀링/재사용을 처리하지 않으므로 영구 연결을 처리하지
+않습니다.</p>
+<p>영구 연결을 사용하려면 대상 URL의 스키마 및 호스트
+부분에 대한 <directive module="mod_proxy">Proxy</directive>
+블록을 최소한 설정하고 예를 들어 타임아웃을 설정하는
+<directive module="mod_proxy">ProxySet</directive> 지시어를
+포함해야 합니다.</p>
+<p><directive module="mod_proxy">ProxyPass</directive> 또는
+<directive module="mod_proxy">ProxyPassMatch</directive>로
+설정하면 영구 연결이 자동으로 사용됩니다.</p>
+</note>
+
+<p>참고: 이 플래그를 사용하려면
+<module>mod_proxy</module>가 활성화되어 있어야 합니다.</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+RewriteRule의 대상(또는 치환 문자열)은 기본적으로 파일
+경로로 간주됩니다. [PT] 플래그를 사용하면 대신 URI로
+처리됩니다. 즉, [PT] 플래그를 사용하면
+<directive module="mod_rewrite">RewriteRule</directive>의
+결과가 URL 매핑을 통해 다시 전달되므로,
+<directive module="mod_alias">Alias</directive>,
+<directive module="mod_alias">Redirect</directive> 또는
+<directive module="mod_alias">ScriptAlias</directive>와 같은
+위치 기반 매핑이 효과를 발휘할 기회를 가집니다.
+</p>
+
+<p>
+예를 들어, /icons에 대한
+<directive module="mod_alias">Alias</directive>가 있고
+거기를 가리키는 <directive module="mod_rewrite">RewriteRule</directive>이
+있다면 <directive module="mod_alias">Alias</directive>가
+평가되도록 [PT] 플래그를 사용해야 합니다.
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+이 경우 [PT] 플래그를 생략하면 Alias가 무시되어
+'File not found' 오류가 반환됩니다.
+</p>
+
+<p><code>PT</code> 플래그는 <code>L</code> 플래그를
+암시합니다: 요청을 처리의 다음 단계로 전달하기 위해
+재작성이 중지됩니다.</p>
+
+<p><code>PT</code> 플래그는
+<directive type="section" module="core">Directory</directive>
+섹션이나 <code>.htaccess</code> 파일과 같은 디렉토리별
+컨텍스트에서 암시됩니다. 이를 우회하는 유일한 방법은
+<code>-</code>로 재작성하는 것입니다.</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+대체 URI에 쿼리 문자열이 포함된 경우
+<directive module="mod_rewrite">RewriteRule</directive>의
+기본 동작은 기존 쿼리 문자열을 버리고 새로 생성된 것으로
+대체하는 것입니다. [QSA] 플래그를 사용하면 쿼리 문자열이
+결합됩니다.
+</p>
+
+<p>다음 규칙을 고려하십시오:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>[QSA] 플래그를 사용하면 <code>/pages/123?one=two</code>에
+대한 요청이 <code>/page.php?page=123&amp;one=two</code>로
+매핑됩니다. [QSA] 플래그 없이 동일한 요청은
+<code>/page.php?page=123</code>으로 매핑됩니다 - 즉,
+기존 쿼리 문자열이 버려집니다.
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+요청된 URI에 쿼리 문자열이 포함되어 있고 대상 URI에는
+없는 경우, <directive module="mod_rewrite">RewriteRule</directive>의
+기본 동작은 해당 쿼리 문자열을 대상 URI에 복사하는
+것입니다. [QSD] 플래그를 사용하면 쿼리 문자열이
+버려집니다.
+</p>
+
+<p>이 플래그는 버전 2.4.0 이상에서 사용할 수 있습니다.</p>
+
+<p>
+[QSD]와 [QSA]를 함께 사용하면 [QSD]가 우선합니다.
+</p>
+
+<p>
+대상 URI에 쿼리 문자열이 있는 경우 기본 동작이
+관찰됩니다 - 즉, 원래 쿼리 문자열이 버려지고
+<code>RewriteRule</code> 대상 URI의 쿼리 문자열로
+대체됩니다.
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+기본적으로 치환에서 첫 번째(가장 왼쪽) 물음표가 경로와
+쿼리 문자열을 구분합니다. [QSL] 플래그를 사용하면
+<directive module="mod_rewrite">RewriteRule</directive>이
+대신 마지막(가장 오른쪽) 물음표를 사용하여 두 구성 요소를
+분리합니다.</p>
+
+<p>
+이것은 파일명에 리터럴 물음표가 있는 파일에 매핑할 때
+유용합니다. 치환에 쿼리 문자열이 사용되지 않는 경우
+이 플래그와 함께 물음표를 추가할 수 있습니다.</p>
+
+<p>이 플래그는 버전 2.4.19 이상에서 사용할 수 있습니다.</p>
+
+</section>
+
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+[R] 플래그를 사용하면 브라우저에 HTTP 리다이렉트가
+발행됩니다. 완전한 URL(즉,
+<code>http://servername/</code> 포함)이 지정되면
+해당 위치로 리다이렉트가 발행됩니다. 그렇지 않으면
+현재 프로토콜, 서버명 및 포트 번호가 리다이렉트와
+함께 전송되는 URL을 생성하는 데 사용됩니다.
+</p>
+
+<p>
+유효한 <em>모든</em> HTTP 응답 상태 코드를
+[R=305] 구문으로 지정할 수 있으며, 지정하지 않으면
+302 상태 코드가 기본적으로 사용됩니다. 지정된 상태 코드가
+반드시 리다이렉트(3xx) 상태 코드일 필요는 없습니다.
+그러나 상태 코드가 리다이렉트 범위(300-399) 밖에 있으면
+치환 문자열이 완전히 삭제되고 <code>L</code>이 사용된
+것처럼 재작성이 중지됩니다.</p>
+
+<p>응답 상태 코드 외에도 기호 이름을 사용하여 리다이렉트
+상태를 지정할 수도 있습니다: <code>temp</code>(기본값),
+<code>permanent</code> 또는 <code>seeother</code>.</p>
+
+<p>
+거의 항상 [R]을 [L]과 함께 사용하고 싶을 것입니다(즉,
+[R,L]). [R] 플래그 단독으로는 URI 앞에
+<code>http://thishost[:thisport]</code>를 추가하지만
+이를 규칙 세트의 다음 규칙에 전달하여 종종
+'Invalid URI in request' 경고를 초래합니다.
+</p>
+
+<p>참고: httpd는 HTTP 사양에 포함된 상태 코드만
+지원합니다. 인식할 수 없는 상태 코드를 사용하면
+500 오류와 오류 로그 메시지가 발생합니다.</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>[S] 플래그는 실행하고 싶지 않은 규칙을 건너뛰는 데
+사용됩니다. 건너뛰기 플래그의 구문은 [S=<em>N</em>]이며,
+<em>N</em>은 건너뛸 규칙의 수를 나타냅니다
+(<directive module="mod_rewrite">RewriteRule</directive>과
+선행 <directive module="mod_rewrite">RewriteCond</directive>
+지시어가 일치하는 경우). 이것은 재작성 규칙 세트의
+<code>goto</code> 문으로 생각할 수 있습니다. 다음 예제에서는
+요청된 URI가 실제 파일에 해당하지 않는 경우에만
+<directive module="mod_rewrite">RewriteRule</directive>을
+실행하고자 합니다.</p>
+
+<highlight language="config">
+# Is the request for a non-existent file?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# If so, skip these two RewriteRules
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>이 기술은 <directive module="mod_rewrite">RewriteCond</directive>가
+바로 다음에 오는
+<directive module="mod_rewrite">RewriteRule</directive>에만
+적용되기 때문에 유용합니다. 따라서
+<code>RewriteCond</code>를 여러
+<code>RewriteRule</code>에 적용하려면 가능한 기술 중
+하나는 해당 조건을 부정하고 [Skip] 플래그를 가진
+<code>RewriteRule</code>을 추가하는 것입니다.
+이를 사용하여 유사 if-then-else 구조를 만들 수 있습니다:
+then 절의 마지막 규칙은 <code>skip=N</code>이 되며,
+N은 else 절의 규칙 수입니다:</p>
+<highlight language="config">
+# Does the file exist?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Create an if-then-else construct by skipping 3 lines if we meant to go to the &quot;else&quot; stanza.
+RewriteRule ".?"                  "-" [S=3]
+
+# IF the file exists, then:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # Skip past the &quot;else&quot; stanza.
+    RewriteRule ".?"         "-" [S=1]
+# ELSE...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# END
+</highlight>
+
+<p><directive type="section">If</directive>,
+<directive type="section">ElseIf</directive> 및
+<directive type="section">Else</directive> 지시어를
+대신 사용하면 이러한 종류의 설정을 더 쉽게 달성할 수
+있습니다.</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>결과 응답이 전송될 MIME 유형을 설정합니다. 이것은
+<directive module="mod_mime">AddType</directive> 지시어와
+동일한 효과를 가집니다.</p>
+
+<p>예를 들어, 특정 방식으로 요청된 경우 Perl 소스 코드를
+일반 텍스트로 제공하기 위해 다음 기술을 사용할 수
+있습니다:</p>
+
+<highlight language="config">
+# .pl 파일을 일반 텍스트로 제공
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>또는 파일 확장자 없이 jpeg 이미지를 생성하는 카메라가
+있는 경우 파일 이름을 기준으로 올바른 MIME 유형으로
+해당 이미지가 제공되도록 강제할 수 있습니다:</p>
+
+<highlight language="config">
+# 이름에 'IMG'가 포함된 파일은 jpg 이미지입니다.
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>이것은 간단한 예제이며 대신
+<directive type="section" module="core">FilesMatch</directive>를
+사용하여 더 잘 수행할 수 있다는 점에 유의하십시오.
+재작성에 의존하기 전에 항상 문제에 대한 대안 솔루션을
+고려하십시오. 재작성은 대안보다 항상 덜 효율적인
+솔루션이 됩니다.</p>
+
+<p>
+디렉토리별 컨텍스트에서 사용하는 경우 <em>전체
+<module>mod_rewrite</module> 처리 라운드에 대해</em>
+치환으로 <code>-</code>(대시)만 사용하십시오.
+그렇지 않으면 내부 재처리(후속
+<module>mod_rewrite</module> 처리 라운드 포함)로 인해
+이 플래그로 설정된 MIME 유형이 손실됩니다.
+<code>L</code> 플래그는 이 컨텍스트에서
+<module>mod_rewrite</module> 처리의 <em>현재</em> 라운드를
+종료하는 데 유용할 수 있습니다.</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>작성 중인 HTTP 요청에 인코딩된 물음표 '%3f'가 있고
+    재작성 결과의 치환에 '?'가 있는 경우 재작성이 계속되도록
+    허용하려면 이 플래그를 설정해야 합니다. 이는 인코딩된
+    물음표의 캡처 및 재치환을 이용하는 악의적인 URL로부터
+    보호합니다.</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>서버 범위의 치환이 변수나 역참조로 시작하고 파일 시스템
+    경로로 해석되는 경우 이 플래그를 설정해야 합니다.
+    이러한 치환은 문서 루트로 접두사가 붙지 않습니다.
+    이는 확장된 치환이 예상치 못한 파일 시스템 위치에
+    매핑되는 악의적인 URL로부터 보호합니다.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>이 플래그를 설정하면 Windows UNC 경로에서 사용되는
+    여러 선행 슬래시의 병합을 방지합니다. 규칙의 치환이
+    여러 리터럴 슬래시로 시작하는 경우 이 플래그는
+    필요하지 않습니다.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
index 912229af035fb274402498f5449e79893fcdc4f0..97d7b5dd8059152cdcbae67b90cb33e373c9b475 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/flags.xml.tr b/docs/manual/rewrite/flags.xml.tr
new file mode 100644 (file)
index 0000000..9e0fdb6
--- /dev/null
@@ -0,0 +1,918 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>RewriteRule Bayrakları</title>
+
+<summary>
+<p>Bu belge, <directive module="mod_rewrite">RewriteRule</directive>
+yönergesinde kullanılabilecek bayrakları ayrıntılı açıklamalar ve
+örneklerle açıklar.</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="introduction"><title>Giriş</title>
+<p>Bir <directive module="mod_rewrite">RewriteRule</directive>
+yönergesinin davranışı bir veya daha fazla bayrakla
+değiştirilebilir. Bayraklar kuralın sonunda köşeli parantez içinde
+belirtilir ve birden fazla bayrak virgülle ayrılır.</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>Her bayrağın (birkaç istisna dışında) <code>CO</code> gibi kısa bir
+biçimi ve <code>cookie</code> gibi uzun bir biçimi vardır. Kısa biçim
+en yaygın olarak kullanılsa da, her bayrağın ne yapması gerektiğini
+hatırlamanız için uzun biçime aşina olmanız önerilir. Bazı bayraklar
+bir veya daha fazla argüman alır. Bayraklar büyük/küçük harf
+duyarsızdır.</p>
+
+<p>İstekle ilişkili üstveriyi değiştiren bayraklar (T=, H=, E=), bir
+değiştirme ('-' dışında) aynı yeniden yazma işleme turunda
+gerçekleştirildiğinde dizin başına ve htaccess bağlamında etkili
+olmaz.</p>
+
+<p>Burada mevcut bayrakların her biri, nasıl kullanabileceğinize dair
+bir örnekle birlikte sunulmaktadır.</p>
+</section>
+
+<section id="flag_b"><title>B (geri başvuruları kodla)</title>
+<p>[B] bayrağı, <directive module="mod_rewrite">RewriteRule</directive>
+yönergesine dönüşümü uygulamadan önce alfasayısal olmayan karakterleri
+kodlamasını söyler.</p>
+
+<p><module>mod_rewrite</module> URL'leri eşlemeden önce kodlarını
+çözmek zorundadır, bu nedenle geri başvurular uygulandığında kodları
+çözülmüş olur. B bayrağı kullanıldığında, geri başvurulardaki
+alfasayısal olmayan karakterler kodlanır. Örneğin, şu kuralı ele
+alalım:</p>
+
+<p>Sunucu değişkenlerinin benzer şekilde kodlanması için
+    "escape" <a href="#mapfunc">eşleme işlevine</a> bakın</p>
+
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>Arama terimi 'x &amp; y/z' olduğunda, tarayıcı bunu
+'x%20%26%20y%2Fz' olarak kodlar ve istek 'search/x%20%26%20y%2Fz'
+olur. B bayrağı olmadan bu yeniden yazma kuralı 'search.php?term=x
+&amp; y/z' ile eşleşir ki bu geçerli bir URL değildir ve
+<code>search.php?term=x%20&amp;y%2Fz=</code> olarak kodlanır, bu da
+amaçlanan değildir.</p>
+
+<p>Aynı kuralda B bayrağı ayarlandığında, parametreler çıktı URL'sine
+geçirilmeden önce yeniden kodlanır ve doğru bir eşleme olan
+<code>/search.php?term=x%20%26%20y%2Fz</code> elde edilir.</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>Bu belirli örneğin çalışması için <directive
+module="core">AllowEncodedSlashes</directive> yönergesini
+<code>On</code> olarak ayarlamanız gerekebileceğini unutmayın; çünkü
+httpd URL'lerde kodlanmış eğik çizgilere izin vermez ve bir tane
+görürse 404 döndürür.</p>
+
+<p>Bu kodlama özellikle vekil durumunda gereklidir; arka uç, kodları
+çözülmüş bir URL ile karşılaşırsa bozulabilir.</p>
+
+<p>Bu bayrağa bir alternatif, %{THE_REQUEST} değerine karşı yakalama
+yapan bir <directive module="mod_rewrite">RewriteCond</directive>
+kullanmaktır; bu, dizgeleri kodlanmış biçimde yakalar.</p>
+
+<p>2.4.26 ve sonrasında, geri başvurulardaki kodlamayı belirli
+karakterlerle sınırlayabilirsiniz: <code>[B=#?;]</code>. Not: Boşluk
+karakteri kodlanacak karakterler listesinde kullanılabilir, ancak
+<directive module="mod_rewrite">RewriteRule</directive> yönergesinin
+üçüncü argümanının tamamını tırnak içine almanız ve boşluğun listenin
+son karakteri olmaması gerekir.</p>
+
+<highlight language="config">
+# Boşlukları ve soru işaretlerini kodla. Son argüman etrafındaki
+# tırnak işaretleri, boşluk dahil edildiğinde gereklidir.
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>Bu şekilde kodlanan karakterleri sınırlamak için <a
+href="#flag_bne">#flag_bne</a> ve <a
+href="#flag_bctls">#flag_bctls</a> bayraklarına bakın</p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus (boşluğu +'ya kodlama)</title>
+<p>[BNP] bayrağı, <directive module="mod_rewrite">RewriteRule</directive>
+yönergesine geri başvurulardaki boşluk karakterini '+' yerine %20
+olarak kodlamasını söyler. Geri başvuru sorgu dizgesi yerine yol
+bileşeninde kullanılacaksa yararlıdır.</p>
+
+<highlight language="config">
+# Form gönderimi yoluyla sorgu dizgesinde kullanılan + yerine yolda
+# boşlukları %20 olarak kodla
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+
+<p>Bu bayrak 2.4.26 ve sonraki sürümlerde mevcuttur.</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>[BCTLS] bayrağı [B] bayrağına benzer, ancak yalnızca kontrol
+karakterlerini ve boşluk karakterini kodlar. Bu, sorgu dizgesine
+kodlanmadan kopyalandıklarında reddedilen karakter kümesiyle
+aynıdır.</p>
+
+<highlight language="config">
+# Kontrol karakterlerini ve boşlukları kodla
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>Bu bayrak 2.5.1 ve sonraki sürümlerde mevcuttur.</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>[BNE=...] içindeki karakter listesi, [B] veya [BCTLS] bayraklarının
+karakterlerinden istisna olarak değerlendirilir. Listelenen karakterler
+kodlanmayacaktır.</p>
+
+<highlight language="config">
+# Öntanımlı karakterleri kodla, ancak / karakterini bırak
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>Bu bayrak 2.5.1 ve sonraki sürümlerde mevcuttur.</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>[C] veya [chain] bayrağı, <directive
+module="mod_rewrite">RewriteRule</directive> yönergesinin bir sonraki
+kurala zincirleneceğini belirtir. Yani, kural eşleşirse her zamanki
+gibi işlenir ve denetim bir sonraki kurala geçer. Ancak eşleşmezse bir
+sonraki kural ve birlikte zincirlenen diğer kurallar atlanır.</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>[CO] veya [cookie] bayrağı, belirli bir <directive
+module="mod_rewrite">RewriteRule</directive> eşleştiğinde bir çerez
+ayarlamanıza olanak tanır. Argüman üç zorunlu ve beş isteğe bağlı
+alandan oluşur.</p>
+
+<p>Bayrağın tüm öznitelikler dahil tam sözdizimi şöyledir:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>Çerez alanlarından herhangi birinde birebir ':' karakterine ihtiyaç
+duyulursa, alternatif bir sözdizimi mevcuttur. Alternatif sözdizimini
+etkinleştirmek için çerez "Name" alanının önüne ';' karakteri
+konulmalı ve alan ayırıcıları ';' olarak belirtilmelidir.</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>Çerezin ayarlanması için bir ad, bir değer ve bir alan adı
+bildirmelisiniz.</p>
+
+<dl>
+<dt>Alan Adı (Domain)</dt>
+<dd>Çerezin geçerli olmasını istediğiniz alan adı. Bu,
+<code>www.example.com</code> gibi bir konak adı veya
+<code>.example.com</code> gibi bir alan adı olabilir. En az iki
+parçadan oluşmalı ve bir nokta ile ayrılmalıdır. Yani yalnızca
+<code>.com</code> veya <code>.net</code> olamaz. Bu tür çerezler
+çerez güvenlik modeli tarafından yasaklanmıştır.</dd>
+</dl>
+
+<p>İsteğe bağlı olarak aşağıdaki değerleri de ayarlayabilirsiniz:</p>
+
+<dl>
+<dt>Ömür (Lifetime)</dt>
+<dd>Çerezin kalıcı olacağı süre, dakika cinsinden.</dd>
+<dd>0 değeri, çerezin yalnızca geçerli tarayıcı oturumu süresince
+kalıcı olacağını belirtir. Hiçbir değer belirtilmezse bu öntanımlı
+değerdir.</dd>
+<dd>Negatif bir değer, çerezin tarayıcıda silinmesine neden olur.</dd>
+
+<dt>Yol (Path)</dt>
+<dd>Geçerli web sitesinde çerezin geçerli olduğu yol;
+<code>/customers/</code> veya <code>/files/download/</code> gibi.</dd>
+<dd>Öntanımlı olarak <code>/</code> olarak ayarlanır - yani web
+sitesinin tamamı.</dd>
+
+<dt>Güvenli (Secure)</dt>
+<dd><code>secure</code>, <code>true</code> veya <code>1</code> olarak
+ayarlanırsa, çerez yalnızca güvenli (https) bağlantılar üzerinden
+aktarılabilir.</dd>
+
+<dt>httponly</dt>
+<dd><code>HttpOnly</code>, <code>true</code> veya <code>1</code>
+olarak ayarlanırsa, çerez <code>HttpOnly</code> bayrağıyla
+ayarlanır; bu, çerezin bu özelliği destekleyen tarayıcılarda
+JavaScript koduna erişilemez olduğu anlamına gelir.</dd>
+
+<dt>samesite</dt>
+<dd><code>false</code> veya <code>0</code> dışında bir değere
+ayarlanırsa, <code>SameSite</code> özniteliği belirtilen değere
+ayarlanır. Tipik değerler <code>None</code>, <code>Lax</code> ve
+<code>Strict</code>'tir. 2.5.1 ve sonrasında mevcuttur.</dd>
+</dl>
+
+
+<p>Şu örneği ele alalım:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>Verilen örnekte, kural isteği yeniden yazmaz. "-" yeniden yazma
+hedefi, <module>mod_rewrite</module> modülüne isteği değiştirmeden
+geçirmesini söyler. Bunun yerine, 'frontdoor' adlı bir çerezi 'yes'
+değeriyle ayarlar. Çerez <code>.example.com</code> alan adındaki
+herhangi bir konak için geçerlidir. 1440 dakika (24 saat) sonra sona
+erecek şekilde ayarlanır ve tüm URI'ler için döndürülür.</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>DPI bayrağı, yeniden yazılmış URI'nin PATH_INFO bölümünün
+atılmasına neden olur.</p>
+<p>Bu bayrak 2.2.12 ve sonraki sürümlerde mevcuttur.</p>
+<p>Dizin başına bağlamda, her <directive>RewriteRule</directive>
+yönergesinin karşılaştırdığı URI, URI'nin ve PATH_INFO'nun geçerli
+değerlerinin birleşimidir.</p>
+
+<p>Geçerli URI, istemcinin istediği ilk URI, önceki bir
+<module>mod_rewrite</module> işleme turunun sonucu veya geçerli
+<module>mod_rewrite</module> işleme turundaki önceki bir kuralın
+sonucu olabilir.</p>
+
+<p>Buna karşılık, her kuraldan önce URI'ye eklenen PATH_INFO yalnızca
+bu <module>mod_rewrite</module> işleme turundan önceki PATH_INFO
+değerini yansıtır. Sonuç olarak, URI'nin büyük bölümleri birden fazla
+<directive>RewriteRule</directive> yönergesinde bir değiştirmeye
+eşlenip kopyalanırsa ve URI'nin hangi bölümlerinin geçerli
+PATH_INFO'dan geldiğine dikkat edilmezse, son URI'ye PATH_INFO'nun
+birden fazla kopyası eklenebilir.</p>
+
+<p>Bu bayrağı, önceki dosya sistemi eşlemesinden kaynaklanan
+PATH_INFO'nun ilgilendirmediği herhangi bir değiştirmede kullanın. Bu
+bayrak, bu <module>mod_rewrite</module> işleme turu başlamadan önce
+oluşturulan PATH_INFO'yu kalıcı olarak unutur. PATH_INFO, geçerli
+<module>mod_rewrite</module> işleme turu tamamlanana kadar yeniden
+hesaplanmaz. Bu tur boyunca sonraki kurallar, yalnızca değiştirmelerin
+doğrudan sonucunu görür; eklenmiş bir PATH_INFO olmaz.</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>[E] veya [env] bayrağıyla bir ortam değişkeninin değerini
+ayarlayabilirsiniz. Bazı ortam değişkenlerinin kural çalıştıktan sonra
+ayarlanabileceğini ve böylece ayarladığınız değeri geçersiz
+kılabileceğini unutmayın. Ortam değişkenlerinin nasıl çalıştığı
+hakkında daha fazla ayrıntı için <a href="../env.html">Ortam
+Değişkenleri belgesine</a> bakın.</p>
+
+<p>Bu bayrağın tam sözdizimi şöyledir:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code>, genişletilen geri başvurular (<code>$N</code>
+veya <code>%N</code>) içerebilir.</p>
+
+<p>Kısa biçimi kullanarak</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p><code>VAR</code> adlı ortam değişkenini boş bir değere
+ayarlayabilirsiniz.</p>
+
+<p>Şu biçim</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>daha önce ayarlanmış <code>VAR</code> adlı ortam değişkeninin
+silinmesine olanak tanır.</p>
+
+<p>Ortam değişkenleri daha sonra CGI programları, diğer RewriteRule
+yönergeleri veya CustomLog yönergeleri dahil olmak üzere çeşitli
+bağlamlarda kullanılabilir.</p>
+
+<p>Aşağıdaki örnek, istenen URI bir resim dosyasıysa 'image' adlı bir
+ortam değişkenini '1' değerine ayarlar. Daha sonra bu ortam değişkeni,
+bu istekleri erişim günlüğünden dışlamak için kullanılır.</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>Aynı etkinin <directive module="mod_setenvif">SetEnvIf</directive>
+kullanılarak elde edilebileceğini unutmayın. Bu teknik bir öneri olarak
+değil, bir örnek olarak sunulmuştur.</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>[END] bayrağı kullanmak, yalnızca geçerli yeniden yazma işleme
+turunu durdurmakla kalmaz ([L] gibi), aynı zamanda dizin başına
+(htaccess) bağlamda sonraki yeniden yazma işlemlerinin de
+gerçekleşmesini engeller.</p>
+
+<p>Bu, harici yönlendirmelerden kaynaklanan yeni istekler için
+geçerli değildir.</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>[F] bayrağı kullanmak, sunucunun istemciye 403 Yasak durum kodu
+döndürmesine neden olur. Aynı davranış <directive
+module="mod_access_compat">Deny</directive> yönergesiyle de
+gerçekleştirilebilir ancak bu, Yasak durumu atamada daha fazla esneklik
+sağlar.</p>
+
+<p>Aşağıdaki kural, <code>.exe</code> dosyalarının sunucunuzdan
+indirilmesini yasaklar.</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>Bu örnek, yeniden yazma hedefi için "-" sözdizimini kullanır; bu,
+istenen URI'nin değiştirilmediği anlamına gelir. İsteği yasaklayacaksanız
+başka bir URI'ye yeniden yazmanın bir nedeni yoktur.</p>
+
+<p>[F] kullanıldığında, [L] zımnen uygulanır - yani yanıt hemen
+döndürülür ve başka kural değerlendirilmez.</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>[G] bayrağı, sunucuyu yanıtla birlikte 410 Kalktı durum kodu
+döndürmeye zorlar. Bu, bir kaynağın eskiden mevcut olduğunu ancak
+artık mevcut olmadığını belirtir.</p>
+
+<p>[F] bayrağında olduğu gibi, [G] bayrağını kullanırken genellikle
+yeniden yazma hedefi için "-" sözdizimini kullanırsınız:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>[G] kullanıldığında, [L] zımnen uygulanır - yani yanıt hemen
+döndürülür ve başka kural değerlendirilmez.</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>Elde edilen isteğin belirtilen işleyici ile işlenmesini zorlar.
+Örneğin, dosya uzantısı olmayan tüm dosyaların php işleyicisi
+tarafından çözümlenmesini zorlamak için kullanılabilir:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+Yukarıdaki düzenli ifade - <code>!\.</code> - birebir <code>.</code>
+karakterini içermeyen herhangi bir istekle eşleşir.
+</p>
+
+<p>Bu, bazı koşullara dayalı olarak işleyiciyi zorlamak için de
+kullanılabilir. Örneğin, sunucu bağlamında kullanılan aşağıdaki
+kod parçası, <code>.phps</code> uzantısıyla istendiğinde
+<code>.php</code> dosyalarının <code>mod_php</code> tarafından
+<em>görüntülenmesini</em> sağlar:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>Yukarıdaki düzenli ifade - <code>^(/source/.+\.php)s$</code> -
+<code>/source/</code> ile başlayan, ardından 1 veya n karakter gelen
+ve birebir <code>.phps</code> ile biten herhangi bir istekle eşleşir.
+$1 geri başvurusu, düzenli ifadenin parantez içindeki yakalanan
+eşleşmeye referans verir.</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>[L] bayrağı, <module>mod_rewrite</module> modülünün kural kümesini
+işlemeyi durdurmasına neden olur. Çoğu bağlamda, kural eşleşirse başka
+kural işlenmeyeceği anlamına gelir. Bu, Perl'deki <code>last</code>
+komutuna veya C'deki <code>break</code> komutuna karşılık gelir. Bu
+bayrağı, geçerli kuralın diğer kurallar dikkate alınmadan hemen
+uygulanması gerektiğini belirtmek için kullanın.</p>
+
+<p><directive module="mod_rewrite">RewriteRule</directive> yönergesini
+<code>.htaccess</code> dosyalarında veya <directive type="section"
+module="core">Directory</directive> bölümlerinde kullanıyorsanız,
+kuralların nasıl işlendiğini anlamanız önemlidir. Bunun basitleştirilmiş
+biçimi, kurallar işlendikten sonra yeniden yazılmış isteğin URL
+çözümleme motoruna geri verildiğidir. Yeniden yazılmış istek
+işlenirken <code>.htaccess</code> dosyası veya <directive type="section"
+module="core">Directory</directive> bölümüyle tekrar karşılaşılması
+ve kural kümesinin baştan çalıştırılması mümkündür. En yaygın olarak
+bu, kurallardan birinin dahili veya harici bir yönlendirmeye neden
+olması durumunda olur ve istek sürecinin yeniden başlamasına yol
+açar.</p>
+
+<p>Bu nedenle, <directive module="mod_rewrite">RewriteRule</directive>
+yönergelerini bu bağlamlardan birinde kullanıyorsanız, kuralların
+döngüye girmesinden kaçınmak için açık adımlar atmanız ve bir dizi
+kuralın yürütülmesini sonlandırmak için yalnızca [L] bayrağına
+güvenmemeniz önemlidir; aşağıda gösterildiği gibi.</p>
+
+<p>Alternatif bir bayrak olan [END], yalnızca geçerli yeniden yazma
+işleme turunu sonlandırmak için değil, aynı zamanda dizin başına
+(htaccess) bağlamda sonraki yeniden yazma işlemlerinin de
+gerçekleşmesini engellemek için kullanılabilir. Bu, harici
+yönlendirmelerden kaynaklanan yeni istekler için geçerli değildir.</p>
+
+<p>Burada verilen örnek, herhangi bir isteği <code>index.php</code>'ye
+yeniden yazar ve orijinal isteği <code>index.php</code>'ye sorgu
+dizgesi argümanı olarak verir; ancak <directive
+module="mod_rewrite">RewriteCond</directive>, istek zaten
+<code>index.php</code> için ise <directive
+module="mod_rewrite">RewriteRule</directive> yönergesinin
+atlanmasını sağlar.</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+[N] bayrağı, kural kümesinin şimdiye kadarki sonucu başlangıç noktası
+olarak kullanarak en baştan yeniden başlamasına neden olur. Döngüye
+neden olabileceğinden son derece dikkatli kullanın.
+</p>
+<p>
+[Next] bayrağı, örneğin bir istekteki belirli bir dizgeyi veya harfi
+tekrar tekrar değiştirmek istediğinizde kullanılabilir. Burada
+gösterilen örnek, bir istekteki her yerde A'yı B ile değiştirecek ve
+değiştirilecek A kalmayana kadar bunu yapmaya devam edecektir.
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>Bunu bir <code>while</code> döngüsü olarak düşünebilirsiniz: Bu
+kalıp hâlâ eşleştiği sürece (yani URI hâlâ bir <code>A</code>
+içerdiği sürece), bu değiştirmeyi yap (yani <code>A</code>'yı
+<code>B</code> ile değiştir).</p>
+
+<p>2.5.0 ve sonrasında, bu modül istenmeyen döngülere karşı koruma
+sağlamak için 10.000 yinelemeden sonra hata döndürür. N bayrağına
+eklenerek alternatif bir maksimum yineleme sayısı belirtilebilir.</p>
+<highlight language="config">
+# Döngünün her geçişinde 1 karakter değiştirmeye razı ol
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ... veya 10 döngüden sonra vazgeç
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>[NC] bayrağının kullanımı, <directive
+module="mod_rewrite">RewriteRule</directive> yönergesinin büyük/küçük
+harf duyarsız biçimde eşleştirilmesine neden olur. Yani eşleşen
+URI'de harflerin büyük veya küçük harf olarak görünüp görünmediği
+önemli değildir.</p>
+
+<p>Aşağıdaki örnekte, herhangi bir resim dosyası isteği özel resim
+sunucunuza vekil olarak iletilir. Eşleşme büyük/küçük harf
+duyarsızdır; bu nedenle örneğin hem <code>.jpg</code> hem de
+<code>.JPG</code> dosyaları kabul edilir.</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>Öntanımlı olarak, bir <directive
+module="mod_rewrite">RewriteRule</directive> harici yönlendirmeyle
+sonuçlandığında, çıktıda aşağıdaki güvenli küme dışında kalan
+karakterler onaltılık kod (yüzde kodlu) eşdeğerlerine
+dönüştürülür:</p>
+
+<ul>
+  <li>Alfasayısal karakterler: <code>A-Z</code>, <code>a-z</code>,
+  <code>0-9</code></li>
+  <li>Özel karakterler: <code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>Örneğin, <code>#</code> karakteri <code>%23</code>'e ve
+<code>?</code> karakteri <code>%3F</code>'e dönüştürülür.
+<code>%</code> karakteri de kodlanır (<code>%25</code>'e), bu da
+değiştirmede zaten mevcut olan yüzde kodlamanın çift kodlanacağı
+anlamına gelir.</p>
+
+<p>[NE] bayrağı kullanmak bu kodlamayı engeller ve <code>#</code> ile
+<code>?</code> gibi karakterlerin yönlendirme URL'sine
+değiştirilmeden geçmesine olanak tanır.</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+Yukarıdaki örnek <code>/anchor/xyz</code> adresini
+<code>/bigpage.html#xyz</code> adresine yönlendirecektir. [NE]
+kullanılmazsa # karakteri onaltılık kod eşdeğeri olan
+<code>%23</code>'e dönüştürülür ve bu da 404 Bulunamadı hata durumuna
+yol açar.
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>[NS] bayrağının kullanımı, kuralın alt isteklerde kullanılmasını
+engeller. Örneğin, SSI (Sunucu Tarafı Dahil Etme) kullanılarak dahil
+edilen bir sayfa bir alt istektir ve bu alt isteklerde yeniden
+yazmaların gerçekleşmesini engellemek isteyebilirsiniz. Ayrıca,
+<module>mod_dir</module> olası dizin öntanımlı dosyaları (örneğin
+<code>index.html</code> dosyaları) hakkında bilgi edinmeye
+çalıştığında, bu bir dahili alt istektir ve genellikle bu tür alt
+isteklerde yeniden yazmaları engellemek istersiniz. Alt isteklerde,
+kuralların tamamının uygulanması her zaman yararlı olmaz ve hatalara
+bile neden olabilir. Sorunlu kuralları dışlamak için bu bayrağı
+kullanın.</p>
+
+<p>Bu kuralı kullanıp kullanmamaya karar vermek için: URL'leri CGI
+betikleriyle ön ekliyorsanız ve bunların CGI betiği tarafından
+işlenmesini zorluyorsanız, alt isteklerde sorunlarla (veya önemli ek
+yükle) karşılaşmanız olasıdır. Bu durumlarda bu bayrağı kullanın.</p>
+
+<p>
+Bir HTML sayfasının parçası olarak yüklenen resimler, javascript
+dosyaları veya css dosyaları alt istek değildir - tarayıcı bunları
+ayrı HTTP istekleri olarak ister.
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>[P] bayrağının kullanımı, isteğin <module>mod_proxy</module>
+tarafından işlenmesine ve bir vekil isteği üzerinden ele alınmasına
+neden olur. Örneğin, tüm resim isteklerinin bir arka uç resim
+sunucusu tarafından işlenmesini istiyorsanız, şöyle bir şey
+yapabilirsiniz:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>[P] bayrağının kullanımı [L] anlamına gelir - yani istek hemen
+vekil üzerinden iletilir ve sonraki kurallar dikkate alınmaz.</p>
+
+<p>
+Değiştirme dizgesinin <module>mod_proxy</module> tarafından
+işlenebilecek geçerli bir URI olduğundan (genellikle
+<code>http://</code><em>konakadı</em> ile başlayan) emin olmalısınız.
+Değilse, vekil modülünden bir hata alırsınız. Bu bayrağı, uzak
+içeriği yerel sunucunun ad alanına eşlemek için <directive
+module="mod_proxy">ProxyPass</directive> yönergesinin daha güçlü
+bir uygulamasını gerçekleştirmek için kullanın.</p>
+
+<note type="warning">
+<title>Güvenlik Uyarısı</title>
+<p>Kuralın hedef URL'sini oluştururken, istemcinin sunucunuzun vekil
+olarak davranacağı URL kümesi üzerindeki etkisinin güvenlik
+sonuçlarını dikkate alın. URL'nin şema ve konak adı bölümünün ya sabit
+olduğundan ya da istemciye gereksiz etki izni vermediğinden emin
+olun.</p>
+</note>
+
+<note type="warning">
+<title>Performans uyarısı</title>
+<p>Bu bayrağı kullanmak, kalıcı bağlantıları yönetmeyen öntanımlı
+işçi bu durumda kullanıldığından bağlantı havuzlama/yeniden kullanımı
+olmaksızın <module>mod_proxy</module> kullanımını tetikler.</p>
+<p>Kalıcı bağlantıları kullanmak için en azından hedef URL'nin şema
+ve konak bölümü için örneğin bir zaman aşımı ayarladığınız
+<directive module="mod_proxy">ProxySet</directive> yönergesi içeren
+bir <directive module="mod_proxy">Proxy</directive> bloğu
+kurmalısınız.</p>
+<p><directive module="mod_proxy">ProxyPass</directive> veya
+<directive module="mod_proxy">ProxyPassMatch</directive> ile
+kurarsanız kalıcı bağlantılar otomatik olarak kullanılacaktır.</p>
+</note>
+
+<p>Not: Bu bayrağı kullanmak için <module>mod_proxy</module>
+etkinleştirilmiş olmalıdır.</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+Bir RewriteRule'daki hedef (veya değiştirme dizgesi) öntanımlı olarak
+bir dosya yolu olarak kabul edilir. [PT] bayrağının kullanılması,
+bunun yerine bir URI olarak işlenmesine neden olur. Yani, [PT]
+bayrağının kullanılması, <directive
+module="mod_rewrite">RewriteRule</directive> sonucunun, <directive
+module="mod_alias">Alias</directive>, <directive
+module="mod_alias">Redirect</directive> veya <directive
+module="mod_alias">ScriptAlias</directive> gibi konum tabanlı
+eşlemelerin etki edebilmesi için URL eşlemesine geri iletilmesine
+neden olur.
+</p>
+
+<p>
+Örneğin, /icons için bir <directive
+module="mod_alias">Alias</directive> tanımınız varsa ve oraya
+işaret eden bir <directive
+module="mod_rewrite">RewriteRule</directive> varsa, <directive
+module="mod_alias">Alias</directive> yönergesinin
+değerlendirilmesini sağlamak için [PT] bayrağını kullanmalısınız.
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+Bu durumda [PT] bayrağının atlanması, Alias'ın yok sayılmasına neden
+olur ve 'Dosya bulunamadı' hatası döndürülür.
+</p>
+
+<p><code>PT</code> bayrağı <code>L</code> bayrağını ima eder:
+isteği bir sonraki işleme aşamasına geçirmek için yeniden yazma
+durdurulur.</p>
+
+<p><code>PT</code> bayrağının <directive type="section"
+module="core">Directory</directive> bölümleri veya
+<code>.htaccess</code> dosyaları gibi dizin başına bağlamlarda
+zımnen uygulandığını unutmayın. Bundan kaçınmanın tek yolu
+<code>-</code>'ye yeniden yazmaktır.</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+Değiştirme URI'si bir sorgu dizgesi içerdiğinde, <directive
+module="mod_rewrite">RewriteRule</directive> yönergesinin öntanımlı
+davranışı mevcut sorgu dizgesini atıp yeni oluşturulanla
+değiştirmektir. [QSA] bayrağı kullanmak sorgu dizgelerinin
+birleştirilmesine neden olur.
+</p>
+
+<p>Şu kuralı ele alalım:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>[QSA] bayrağıyla, <code>/pages/123?one=two</code> isteği
+<code>/page.php?page=123&amp;one=two</code> ile eşlenir. [QSA]
+bayrağı olmadan, aynı istek
+<code>/page.php?page=123</code> ile eşlenir - yani mevcut sorgu
+dizgesi atılır.
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+İstenen URI bir sorgu dizgesi içerdiğinde ve hedef URI içermediğinde,
+<directive module="mod_rewrite">RewriteRule</directive> yönergesinin
+öntanımlı davranışı o sorgu dizgesini hedef URI'ye kopyalamaktır.
+[QSD] bayrağı kullanmak sorgu dizgesinin atılmasına neden olur.
+</p>
+
+<p>Bu bayrak 2.4.0 ve sonraki sürümlerde mevcuttur.</p>
+
+<p>
+[QSD] ve [QSA] birlikte kullanıldığında [QSD] öncelikli olur.
+</p>
+
+<p>
+Hedef URI bir sorgu dizgesine sahipse, öntanımlı davranış
+gözlemlenir - yani orijinal sorgu dizgesi atılır ve
+<code>RewriteRule</code> hedef URI'sindeki sorgu dizgesiyle
+değiştirilir.
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+Öntanımlı olarak, değiştirmedeki ilk (en soldaki) soru işareti yolu
+sorgu dizgesinden ayırır. [QSL] bayrağı kullanmak, <directive
+module="mod_rewrite">RewriteRule</directive> yönergesine iki bileşeni
+son (en sağdaki) soru işaretini kullanarak ayırmasını söyler.</p>
+
+<p>
+Bu, dosya adlarında birebir soru işaretleri bulunan dosyalara eşleme
+yaparken yararlıdır. Değiştirmede sorgu dizgesi kullanılmıyorsa, bu
+bayrakla birlikte sonuna bir soru işareti eklenebilir.</p>
+
+<p>Bu bayrak 2.4.19 ve sonraki sürümlerde mevcuttur.</p>
+
+</section>
+
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+[R] bayrağı kullanmak, tarayıcıya bir HTTP yönlendirmesi
+verilmesine neden olur. Tam nitelikli bir URL belirtilmişse (yani
+<code>http://sunucuadı/</code> dahil), o konuma bir yönlendirme
+verilir. Aksi takdirde, yönlendirmeyle gönderilen URL'yi oluşturmak
+için geçerli protokol, sunucu adı ve bağlantı noktası numarası
+kullanılır.
+</p>
+
+<p>
+[R=305] sözdizimi kullanılarak geçerli herhangi bir HTTP yanıt durum
+kodu belirtilebilir; hiçbiri belirtilmezse öntanımlı olarak 302 durum
+kodu kullanılır. Belirtilen durum kodunun mutlaka bir yönlendirme
+(3xx) durum kodu olması gerekmez. Ancak durum kodu yönlendirme
+aralığının (300-399) dışındaysa değiştirme dizgesi tamamen atılır ve
+<code>L</code> kullanılmış gibi yeniden yazma durdurulur.</p>
+
+<p>Yanıt durum kodlarına ek olarak, yönlendirme durumunu sembolik
+adlarıyla da belirtebilirsiniz: <code>temp</code> (öntanımlı),
+<code>permanent</code> veya <code>seeother</code>.</p>
+
+<p>
+[R] bayrağını neredeyse her zaman [L] ile birlikte kullanmak
+istersiniz (yani [R,L] kullanın); çünkü [R] bayrağı tek başına
+URI'nin önüne <code>http://bukonak[:buport]</code> ekler ancak bunu
+kural kümesindeki bir sonraki kurala geçirir ve bu da çoğu zaman
+'İstekte Geçersiz URI' uyarılarına neden olabilir.
+</p>
+
+<p>Not: httpd yalnızca HTTP belirtiminde bulunan durum kodlarını
+destekler. Tanınmayan bir durum kodu kullanmak 500 hatasına ve hata
+günlüğü mesajına neden olacaktır.</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>[S] bayrağı, çalıştırmak istemediğiniz kuralları atlamak için
+kullanılır. Atlama bayrağının sözdizimi [S=<em>N</em>]'dir; burada
+<em>N</em> atlanacak kural sayısını belirtir (<directive
+module="mod_rewrite">RewriteRule</directive> ve ondan önceki
+<directive module="mod_rewrite">RewriteCond</directive> yönergeleri
+eşleştiği takdirde). Bu, yeniden yazma kural kümenizde bir
+<code>goto</code> deyimi olarak düşünülebilir. Aşağıdaki örnekte,
+<directive module="mod_rewrite">RewriteRule</directive> yönergesini
+yalnızca istenen URI gerçek bir dosyaya karşılık gelmiyorsa
+çalıştırmak istiyoruz.</p>
+
+<highlight language="config">
+# İstek var olmayan bir dosya için mi?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Öyleyse, bu iki RewriteRule'u atla
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>Bu teknik yararlıdır; çünkü bir <directive
+module="mod_rewrite">RewriteCond</directive> yalnızca hemen ardından
+gelen <directive module="mod_rewrite">RewriteRule</directive> için
+geçerlidir. Bu nedenle, bir <code>RewriteCond</code>'un birkaç
+<code>RewriteRule</code> için geçerli olmasını istiyorsanız, olası
+bir teknik bu koşulları olumsuzlamak ve [Skip] bayrağıyla bir
+<code>RewriteRule</code> eklemektir. Bunu, sözde if-then-else
+yapıları oluşturmak için kullanabilirsiniz: then yan tümcesinin son
+kuralı <code>skip=N</code> olur; burada N, else yan tümcesindeki
+kural sayısıdır:</p>
+<highlight language="config">
+# Dosya var mı?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# &quot;else&quot; kısmına gitmek istiyorsak 3 satır atlayarak bir if-then-else yapısı oluştur.
+RewriteRule ".?"                  "-" [S=3]
+
+# EĞER dosya varsa:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # &quot;else&quot; kısmını atla.
+    RewriteRule ".?"         "-" [S=1]
+# DEĞİLSE...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# SON
+</highlight>
+
+<p>Bu tür yapılandırmayı, bunun yerine <directive
+type="section">If</directive>, <directive
+type="section">ElseIf</directive> ve <directive
+type="section">Else</directive> yönergelerini kullanarak
+gerçekleştirmek muhtemelen daha kolaydır.</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>Elde edilen yanıtın gönderileceği MIME türünü ayarlar. Bu,
+<directive module="mod_mime">AddType</directive> yönergesiyle aynı
+etkiye sahiptir.</p>
+
+<p>Örneğin, Perl kaynak kodunu belirli bir şekilde istendiğinde düz
+metin olarak sunmak için aşağıdaki tekniği kullanabilirsiniz:</p>
+
+<highlight language="config">
+# .pl dosyalarını düz metin olarak sun
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>Veya dosya uzantısı olmayan jpeg resimleri üreten bir kameranız
+varsa, bu resimlerin dosya adlarına bakarak doğru MIME türüyle
+sunulmasını zorlayabilirsiniz:</p>
+
+<highlight language="config">
+# Adında 'IMG' bulunan dosyalar jpg resimlerdir.
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>Bunun önemsiz bir örnek olduğunu ve bunun yerine <directive
+type="section" module="core">FilesMatch</directive> kullanılarak
+daha iyi yapılabileceğini lütfen unutmayın. Yeniden yazmaya
+başvurmadan önce her zaman bir soruna alternatif çözümleri
+düşünün; yeniden yazma her zaman alternatiflerden daha az verimli
+bir çözüm olacaktır.</p>
+
+<p>
+Dizin başına bağlamda kullanılıyorsa, <em><module>mod_rewrite</module>
+işlemesinin tüm turu boyunca</em> değiştirme olarak yalnızca
+<code>-</code> (tire) kullanın; aksi takdirde dahili yeniden
+işleme (sonraki <module>mod_rewrite</module> işleme turları dahil)
+nedeniyle bu bayrakla ayarlanan MIME türü kaybolur.
+<code>L</code> bayrağı bu bağlamda <module>mod_rewrite</module>
+işlemesinin <em>geçerli</em> turunu sonlandırmak için yararlı
+olabilir.</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>Yazılmakta olan HTTP isteğinde kodlanmış bir soru işareti
+    '%3f' varsa ve yeniden yazılmış sonucun değiştirmesinde '?' varsa,
+    yeniden yazmanın devam etmesine izin vermek için bu bayrağın
+    ayarlanması gereklidir. Bu, kodlanmış soru işaretinin yakalanması
+    ve yeniden değiştirilmesinden yararlanan kötü niyetli bir URL'ye
+    karşı koruma sağlar.</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>Sunucu kapsamlı değiştirmeler bir değişken veya geri başvuru
+    ile başlayıp bir dosya sistemi yoluna çözümlendiğinde bu bayrağın
+    ayarlanması gereklidir. Bu değiştirmeler belge kökü ile
+    öneklenmez. Bu, genişletilmiş değiştirmenin beklenmeyen bir dosya
+    sistemi konumuna eşlenmesine neden olan kötü niyetli bir URL'ye
+    karşı koruma sağlar.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>Bu bayrağın ayarlanması, Windows UNC yollarında kullanıldığı
+    gibi birden fazla baştaki eğik çizginin birleştirilmesini engeller.
+    Kural değiştirmesi birden fazla birebir eğik çizgi ile
+    başladığında bayrak gerekli değildir.</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/flags.xml.zh-cn b/docs/manual/rewrite/flags.xml.zh-cn
new file mode 100644 (file)
index 0000000..f8a0c81
--- /dev/null
@@ -0,0 +1,801 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933062 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="flags.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>RewriteRule 标志</title>
+
+<summary>
+<p>本文档讨论了 <directive module="mod_rewrite">RewriteRule</directive>
+指令可用的标志,并提供了详细的说明和示例。</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="introduction"><title>介绍</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>
+的行为可以通过一个或多个标志来修改。标志包含在规则末尾的方括号中,
+多个标志之间用逗号分隔。</p>
+<highlight language="config">
+RewriteRule pattern target [Flag1,Flag2,Flag3]
+</highlight>
+
+<p>每个标志(除少数例外)都有一个缩写形式,如 <code>CO</code>,
+以及一个较长的形式,如 <code>cookie</code>。虽然最常用的是缩写形式,
+但建议你熟悉长形式,以便记住每个标志的作用。
+某些标志接受一个或多个参数。标志不区分大小写。</p>
+
+<p>修改与请求关联的元数据的标志(T=、H=、E=)在目录级和 htaccess
+上下文中,当在同一轮重写处理中执行了替换(非 '-')时不会生效。
+</p>
+
+<p>下面逐一介绍每个可用的标志,并给出使用示例。</p>
+</section>
+
+<section id="flag_b"><title>B(转义反向引用)</title>
+<p>[B] 标志指示 <directive
+module="mod_rewrite">RewriteRule</directive>
+在应用转换之前转义非字母数字字符。</p>
+
+<p><module>mod_rewrite</module> 在映射 URL 之前必须对其进行反转义,
+因此反向引用在应用时是未转义的。使用 B 标志,反向引用中的非字母数字字符将被转义。
+例如,考虑以下规则:</p>
+
+<p>有关类似的服务器变量转义,请参阅
+    "escape" <a href="#mapfunc">映射函数</a></p>
+
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1"
+</highlight>
+
+<p>给定搜索词 'x &amp; y/z',浏览器会将其编码为
+'x%20%26%20y%2Fz',发出请求 'search/x%20%26%20y%2Fz'。不使用 B
+标志时,此重写规则将映射为 'search.php?term=x &amp; y/z',
+这不是一个有效的 URL,因此会被编码为
+<code>search.php?term=x%20&amp;y%2Fz=</code>,这不是预期的结果。</p>
+
+<p>在同一规则上设置 B 标志后,参数会在传递到输出 URL 之前重新编码,
+从而正确映射到
+<code>/search.php?term=x%20%26%20y%2Fz</code>。</p>
+
+<highlight language="config">
+RewriteRule "^search/(.*)$" "/search.php?term=$1" [B,PT]
+</highlight>
+
+<p>请注意,你可能还需要将 <directive
+module="core">AllowEncodedSlashes</directive> 设置为 <code>On</code>
+才能使此特定示例正常工作,因为 httpd 不允许 URL 中包含编码的斜杠,
+如果发现编码斜杠则返回 404。</p>
+
+<p>在代理场景中,这种转义尤其必要,
+因为后端如果收到未转义的 URL 可能会出错。</p>
+
+<p>此标志的替代方案是使用 <directive module="mod_rewrite"
+>RewriteCond</directive> 对 %{THE_REQUEST} 进行捕获,
+这将以编码形式捕获字符串。</p>
+
+<p>在 2.4.26 及更高版本中,你可以通过列出字符来限制反向引用中要转义的特定字符:
+<code>[B=#?;]</code>。注意:空格字符可以包含在要转义的字符列表中,
+但你必须引用 <directive module="mod_rewrite">RewriteRule</directive>
+的整个第三个参数,并且空格不能是列表中的最后一个字符。</p>
+
+<highlight language="config">
+# 转义空格和问号。最后一个参数周围的引号
+# 在包含空格时是必需的。
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B= ?]"
+</highlight>
+
+<p>要限制以这种方式转义的字符,请参阅 <a href="#flag_bne">#flag_bne</a>
+        和 <a href="#flag_bctls">#flag_bctls</a></p>
+</section>
+
+<section id="flag_bnp"><title>BNP|backrefnoplus(不将空格转义为 +)</title>
+<p>[BNP] 标志指示 <directive
+module="mod_rewrite">RewriteRule</directive> 将反向引用中的空格字符
+转义为 %20 而不是 '+'。当反向引用将用于路径部分而不是查询字符串时很有用。</p>
+
+<highlight language="config">
+# 在路径中将空格转义为 %20,而不是表单提交中通过
+# 查询字符串使用的 +
+RewriteRule "^search/(.*)$" "/search.php/$1" "[B,BNP]"
+</highlight>
+
+
+<p>此标志在 2.4.26 及更高版本中可用。</p>
+</section>
+
+<section id="flag_bctls"><title>BCTLS</title>
+<p>[BCTLS] 标志类似于 [B] 标志,但只转义控制字符和空格字符。
+这与未编码复制到查询字符串时被拒绝的字符集相同。
+</p>
+
+<highlight language="config">
+# 转义控制字符和空格
+RewriteRule "^search/(.*)$" "/search.php/$1" "[BCTLS]"
+</highlight>
+
+<p>此标志在 2.5.1 及更高版本中可用。</p>
+
+</section>
+
+<section id="flag_bne"><title>BNE</title>
+<p>[BNE=...] 中的字符列表被视为 [B] 或 [BCTLS] 标志的排除项。
+列出的字符将不会被转义。
+</p>
+
+<highlight language="config">
+# 转义默认字符,但保留 /
+RewriteRule "^search/(.*)$" "/search.php?term=$1" "[B,BNE=/]"
+</highlight>
+
+<p>此标志在 2.5.1 及更高版本中可用。</p>
+</section>
+
+<section id="flag_c"><title>C|chain</title>
+<p>[C] 或 [chain] 标志表示该 <directive
+module="mod_rewrite">RewriteRule</directive>
+与下一条规则链接在一起。也就是说,如果该规则匹配,则照常处理,
+控制继续传递到下一条规则。但如果不匹配,
+则跳过下一条规则以及所有链接在一起的其他规则。</p>
+
+</section>
+
+<section id="flag_co"><title>CO|cookie</title>
+<p>[CO] 或 [cookie] 标志允许你在特定的
+<directive module="mod_rewrite">RewriteRule</directive>
+匹配时设置 cookie。参数由三个必需字段和五个可选字段组成。</p>
+
+<p>该标志的完整语法(包括所有属性)如下:</p>
+
+<example>
+[CO=NAME:VALUE:DOMAIN:lifetime:path:secure:httponly:samesite]
+</example>
+
+<p>如果任何 cookie 字段中需要使用字面量 ':' 字符,
+可以使用替代语法。要选择替代语法,cookie 的 "Name"
+前应加 ';' 字符,字段分隔符也应指定为 ';'。</p>
+
+<example>
+[CO=;NAME;VALUE:MOREVALUE;DOMAIN;lifetime;path;secure;httponly;samesite]
+</example>
+
+<p>你必须声明 cookie 的名称、值和域才能设置 cookie。</p>
+
+<dl>
+<dt>Domain</dt>
+<dd>你希望 cookie 有效的域。这可以是主机名,
+如 <code>www.example.com</code>,也可以是域名,
+如 <code>.example.com</code>。它必须至少包含两个由点分隔的部分。
+也就是说,不能仅为 <code>.com</code> 或 <code>.net</code>。
+cookie 安全模型禁止这类 cookie。</dd>
+</dl>
+
+<p>你还可以选择设置以下值:</p>
+
+<dl>
+<dt>Lifetime</dt>
+<dd>cookie 的持续时间,以分钟为单位。</dd>
+<dd>值为 0 表示 cookie 仅在当前浏览器会话期间持续存在。
+如果未指定,这是默认值。</dd>
+<dd>负值会导致浏览器中的 cookie 被取消设置。</dd>
+
+<dt>Path</dt>
+<dd>当前网站上 cookie 有效的路径,
+如 <code>/customers/</code> 或 <code>/files/download/</code>。</dd>
+<dd>默认设置为 <code>/</code>——即整个网站。</dd>
+
+<dt>Secure</dt>
+<dd>如果设置为 <code>secure</code>、<code>true</code> 或 <code>1</code>,
+则 cookie 只允许通过安全(https)连接传输。</dd>
+
+<dt>httponly</dt>
+<dd>如果设置为 <code>HttpOnly</code>、<code>true</code> 或
+<code>1</code>,cookie 将设置 <code>HttpOnly</code> 标记,
+这意味着在支持此功能的浏览器上,JavaScript 代码无法访问该 cookie。</dd>
+
+<dt>samesite</dt>
+<dd>如果设置为 <code>false</code> 或 <code>0</code> 以外的任何值,
+<code>SameSite</code> 属性将被设置为指定的值。
+典型值为 <code>None</code>、<code>Lax</code> 和 <code>Strict</code>。
+在 2.5.1 及更高版本中可用。</dd>
+</dl>
+
+
+<p>请看以下示例:</p>
+
+<highlight language="config">
+RewriteEngine On
+RewriteRule   "^/index\.html"   "-" [CO=frontdoor:yes:.example.com:1440:/]
+</highlight>
+
+<p>在此示例中,规则不会重写请求。"-" 重写目标告诉
+<module>mod_rewrite</module> 不做修改地传递请求。
+相反,它设置了一个名为 'frontdoor'、值为 'yes' 的 cookie。
+该 cookie 对 <code>.example.com</code> 域中的所有主机有效。
+它被设置为在 1440 分钟(24 小时)后过期,并对所有 URI 返回。</p>
+
+</section>
+
+<section id="flag_dpi"><title>DPI|discardpath</title>
+<p>DPI 标志使重写后 URI 的 PATH_INFO 部分被丢弃。</p>
+<p>此标志在 2.2.12 及更高版本中可用。</p>
+<p>在目录级上下文中,每个 <directive>RewriteRule</directive>
+比较的 URI 是 URI 当前值和 PATH_INFO 的拼接。</p>
+
+<p>当前 URI 可以是客户端最初请求的 URI、
+<module>mod_rewrite</module> 前一轮处理的结果,
+或当前轮 <module>mod_rewrite</module> 处理中先前规则的结果。</p>
+
+<p>相比之下,在每条规则之前附加到 URI 的 PATH_INFO
+仅反映本轮 <module>mod_rewrite</module> 处理之前的 PATH_INFO 值。
+因此,如果 URI 的大部分内容在多个 <directive>RewriteRule</directive>
+指令中被匹配并复制到替换中,而不考虑 URI 的哪些部分来自当前的
+PATH_INFO,则最终 URI 可能会附加多个 PATH_INFO 副本。</p>
+
+<p>在任何替换中使用此标志,如果从此请求先前映射到文件系统所产生的
+PATH_INFO 不需要的话。此标志会永久忘记本轮
+<module>mod_rewrite</module> 处理开始之前建立的 PATH_INFO。
+在当前轮 <module>mod_rewrite</module> 处理完成之前,PATH_INFO
+不会被重新计算。此轮处理中的后续规则将只看到替换的直接结果,
+而不会附加任何 PATH_INFO。</p>
+</section>
+
+<section id="flag_e"><title>E|env</title>
+<p>使用 [E] 或 [env] 标志,你可以设置环境变量的值。
+请注意,某些环境变量可能在规则运行后被设置,
+从而取消你所设置的值。有关环境变量工作方式的更多详细信息,
+请参阅<a href="../env.html">环境变量文档</a>。</p>
+
+<p>此标志的完整语法为:</p>
+
+<highlight language="config">
+[E=VAR:VAL]
+[E=!VAR]
+</highlight>
+
+<p><code>VAL</code> 可以包含会被展开的反向引用(<code>$N</code> 或
+<code>%N</code>)。</p>
+
+<p>使用缩写形式</p>
+
+<example>
+[E=VAR]
+</example>
+
+<p>你可以将名为 <code>VAR</code> 的环境变量设置为空值。</p>
+
+<p>使用以下形式</p>
+
+<example>
+[E=!VAR]
+</example>
+
+<p>可以取消设置先前设置的名为 <code>VAR</code> 的环境变量。</p>
+
+<p>环境变量随后可以在多种上下文中使用,
+包括 CGI 程序、其他 RewriteRule 指令或 CustomLog 指令。</p>
+
+<p>以下示例在请求的 URI 是图像文件时将名为 'image' 的环境变量设置为 '1'。
+然后,该环境变量用于将这些请求从访问日志中排除。</p>
+
+<highlight language="config">
+RewriteRule "\.(png|gif|jpg)$"   "-" [E=image:1]
+CustomLog   "logs/access_log"    combined env=!image
+</highlight>
+
+<p>请注意,使用 <directive
+module="mod_setenvif">SetEnvIf</directive>
+也可以达到相同的效果。此处提供此技术作为示例,而非建议。</p>
+</section>
+
+<section id="flag_end"><title>END</title>
+<p>使用 [END] 标志不仅会终止当前轮的重写处理(如 [L]),
+还会阻止在目录级(htaccess)上下文中发生任何后续的重写处理。</p>
+
+<p>这不适用于由外部重定向产生的新请求。</p>
+</section>
+
+<section id="flag_f"><title>F|forbidden</title>
+<p>使用 [F] 标志会导致服务器向客户端返回 403 Forbidden 状态码。
+虽然使用 <directive module="mod_access_compat">Deny</directive>
+指令也可以实现相同的行为,但这种方式在分配 Forbidden 状态时更加灵活。</p>
+
+<p>以下规则将禁止从你的服务器下载 <code>.exe</code> 文件。</p>
+
+<highlight language="config">
+RewriteRule "\.exe"   "-" [F]
+</highlight>
+
+<p>此示例使用 "-" 语法作为重写目标,这意味着请求的 URI 不会被修改。
+如果你打算禁止请求,就没有理由将其重写到另一个 URI。</p>
+
+<p>使用 [F] 时,会隐含 [L]——也就是说,响应会立即返回,
+不会再评估后续规则。</p>
+
+</section>
+
+<section id="flag_g"><title>G|gone</title>
+<p>[G] 标志强制服务器在响应中返回 410 Gone 状态。
+这表示资源曾经可用,但现在已不再可用。</p>
+
+<p>与 [F] 标志一样,使用 [G] 标志时通常使用 "-" 语法作为重写目标:</p>
+
+<highlight language="config">
+RewriteRule "oldproduct"   "-" [G,NC]
+</highlight>
+
+<p>使用 [G] 时,会隐含 [L]——也就是说,响应会立即返回,
+不会再评估后续规则。</p>
+
+</section>
+
+<section id="flag_h"><title>H|handler</title>
+<p>强制使用指定的处理器来处理结果请求。例如,
+可以使用此标志强制所有没有文件扩展名的文件由 php 处理器解析:</p>
+
+<highlight language="config">
+RewriteRule "!\."  "-" [H=application/x-httpd-php]
+</highlight>
+
+<p>
+上面的正则表达式——<code>!\.</code>——将匹配任何不包含字面量
+<code>.</code> 字符的请求。
+</p>
+
+<p>这也可以用于根据某些条件强制使用处理器。例如,
+以下代码片段在服务器级上下文中使用时,
+允许以 <code>.phps</code> 扩展名请求的 <code>.php</code>
+文件由 <code>mod_php</code> <em>显示</em>其源代码:</p>
+
+<highlight language="config">
+RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]
+</highlight>
+
+<p>上面的正则表达式——<code>^(/source/.+\.php)s$</code>——将匹配任何以
+<code>/source/</code> 开头,后跟 1 个或多个字符,
+再后跟 <code>.phps</code> 的请求。反向引用
+$1 引用正则表达式括号内捕获的匹配内容。</p>
+</section>
+
+<section id="flag_l"><title>L|last</title>
+<p>[L] 标志使 <module>mod_rewrite</module>
+停止处理规则集。在大多数上下文中,这意味着如果规则匹配,
+将不再处理后续规则。这对应于 Perl 中的 <code>last</code>
+命令或 C 中的 <code>break</code> 命令。使用此标志表示当前规则应立即应用,
+而不考虑后续规则。</p>
+
+<p>如果你在 <code>.htaccess</code> 文件或
+<directive type="section" module="core">Directory</directive>
+配置段中使用 <directive module="mod_rewrite">RewriteRule</directive>,
+理解规则的处理方式非常重要。简化来说,一旦规则处理完毕,
+重写后的请求会被交回 URL 解析引擎进行后续处理。在处理重写后的请求时,
+可能会再次遇到 <code>.htaccess</code> 文件或
+<directive type="section" module="core">Directory</directive> 配置段,
+从而规则集可能会从头开始重新运行。最常见的情况是某条规则导致了重定向——
+无论是内部还是外部重定向——使请求处理重新开始。</p>
+
+<p>因此,如果你在这些上下文中使用
+<directive module="mod_rewrite">RewriteRule</directive>
+指令,采取明确措施避免规则循环非常重要,
+不要仅依赖 [L] 标志来终止一系列规则的执行,如下所示。</p>
+
+<p>替代标志 [END] 可用于终止当前轮的重写处理,
+并阻止在目录级(htaccess)上下文中发生任何后续的重写处理。
+这不适用于由外部重定向产生的新请求。</p>
+
+<p>此处给出的示例将把所有请求重写到 <code>index.php</code>,
+将原始请求作为查询字符串参数传递给 <code>index.php</code>,
+但 <directive module="mod_rewrite">RewriteCond</directive>
+确保如果请求已经是 <code>index.php</code>,
+则 <directive module="mod_rewrite">RewriteRule</directive> 将被跳过。</p>
+
+<highlight language="config">
+RewriteBase "/"
+RewriteCond "%{REQUEST_URI}" !=/index.php
+RewriteRule "^(.*)"          "/index.php?req=$1" [L,PT]
+</highlight>
+</section>
+
+<section id="flag_n"><title>N|next</title>
+<p>
+[N] 标志使规则集从头开始重新运行,使用到目前为止的规则集结果作为起点。
+请极其谨慎地使用,因为它可能导致循环。
+</p>
+<p>
+例如,如果你想在请求中重复替换某个字符串或字母,可以使用 [Next] 标志。
+下面的示例将请求中所有的 A 替换为 B,并持续执行直到没有更多的 A 需要替换。
+</p>
+<highlight language="config">
+RewriteRule "(.*)A(.*)" "$1B$2" [N]
+</highlight>
+<p>你可以将此看作 <code>while</code> 循环:当此模式仍然匹配时
+(即 URI 仍然包含 <code>A</code>),执行此替换
+(即将 <code>A</code> 替换为 <code>B</code>)。</p>
+
+<p>在 2.5.0 及更高版本中,此模块在 10,000 次迭代后返回错误,
+以防止意外循环。可以通过向 N 标志添加参数来指定替代的最大迭代次数。</p>
+<highlight language="config">
+# 每次循环替换 1 个字符
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=32000]
+# ……或者,10 次循环后放弃
+RewriteRule "(.+)[&gt;&lt;;]$" "$1" [N=10]
+</highlight>
+
+</section>
+
+<section id="flag_nc"><title>NC|nocase</title>
+<p>使用 [NC] 标志使 <directive module="mod_rewrite">RewriteRule</directive>
+以不区分大小写的方式进行匹配。也就是说,
+匹配的 URI 中字母是大写还是小写都无所谓。</p>
+
+<p>在下面的示例中,任何图像文件请求将被代理到你的专用图像服务器。
+匹配不区分大小写,因此 <code>.jpg</code> 和 <code>.JPG</code>
+文件都可以接受。</p>
+
+<highlight language="config">
+RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC]
+</highlight>
+</section>
+
+<section id="flag_ne"><title>NE|noescape</title>
+<p>默认情况下,当 <directive module="mod_rewrite">RewriteRule</directive>
+导致外部重定向时,输出中不在以下安全集中的字符将被转换为其十六进制编码
+(百分比编码)等价物:</p>
+
+<ul>
+  <li>字母数字字符:<code>A-Z</code>、<code>a-z</code>、
+  <code>0-9</code></li>
+  <li>特殊字符:<code>$-_.+!*'(),:;@&amp;=/~</code></li>
+</ul>
+
+<p>例如,<code>#</code> 将被转换为 <code>%23</code>,
+<code>?</code> 转换为 <code>%3F</code>。<code>%</code>
+字符也会被转义(为 <code>%25</code>),这意味着替换中已有的百分比编码
+将被双重编码。</p>
+
+<p>使用 [NE] 标志可防止此转义,允许
+<code>#</code> 和 <code>?</code> 等字符不经修改地传递到重定向 URL。</p>
+
+<highlight language="config">
+RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R]
+</highlight>
+
+<p>
+上面的示例将 <code>/anchor/xyz</code> 重定向到
+<code>/bigpage.html#xyz</code>。省略 [NE] 将导致 #
+被转换为其十六进制等价物 <code>%23</code>,
+从而导致 404 Not Found 错误。
+</p>
+
+</section>
+
+<section id="flag_ns"><title>NS|nosubreq</title>
+<p>使用 [NS] 标志可防止规则被用于子请求。例如,
+使用 SSI(服务器端包含)包含的页面是子请求,
+你可能希望避免在这些子请求上发生重写。此外,
+当 <module>mod_dir</module>
+尝试查找可能的目录默认文件(如 <code>index.html</code> 文件)的信息时,
+这是一个内部子请求,你通常希望避免在此类子请求上进行重写。
+在子请求上,应用完整的规则集并不总是有用的,甚至可能导致错误。
+使用此标志排除有问题的规则。</p>
+
+<p>要决定是否使用此规则:如果你使用 CGI 脚本为 URL 添加前缀,
+强制它们由 CGI 脚本处理,那么在子请求上你很可能会遇到问题
+(或显著的性能开销)。在这些情况下,请使用此标志。</p>
+
+<p>
+作为 HTML 页面一部分加载的图像、JavaScript 文件或 CSS 文件不是子请求——
+浏览器将它们作为单独的 HTTP 请求发出。
+</p>
+</section>
+
+<section id="flag_p"><title>P|proxy</title>
+<p>使用 [P] 标志使请求由 <module>mod_proxy</module>
+处理,并通过代理请求进行处理。例如,
+如果你想让所有图像请求由后端图像服务器处理,可以这样做:</p>
+
+<highlight language="config">
+RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P]
+</highlight>
+
+<p>使用 [P] 标志隐含 [L]——也就是说,请求会立即通过代理推送,
+后续规则将不被考虑。</p>
+
+<p>
+你必须确保替换字符串是有效的 URI
+(通常以 <code>http://</code><em>hostname</em> 开头),
+可以由 <module>mod_proxy</module> 处理。如果不是,你将从代理模块收到错误。
+使用此标志可以实现比 <directive
+module="mod_proxy">ProxyPass</directive>
+指令更强大的远程内容到本地服务器命名空间的映射。</p>
+
+<note type="warning">
+<title>安全警告</title>
+<p>构造规则的目标 URL 时要小心,考虑允许客户端影响你的服务器将作为代理的
+URL 集的安全影响。确保 URL 的方案和主机名部分是固定的,
+或者不允许客户端过度影响。</p>
+</note>
+
+<note type="warning">
+<title>性能警告</title>
+<p>使用此标志会触发 <module>mod_proxy</module> 的使用,
+在这种情况下使用默认 worker,不处理持久连接,
+因为默认 worker 不处理连接池/重用。</p>
+<p>要使用持久连接,你需要至少为目标 URL 的方案和主机部分设置一个
+<directive module="mod_proxy">Proxy</directive> 块,
+其中包含一个 <directive module="mod_proxy">ProxySet</directive>
+指令,例如设置超时时间。</p>
+<p>如果使用 <directive module="mod_proxy">ProxyPass</directive> 或
+<directive module="mod_proxy">ProxyPassMatch</directive>
+进行设置,将自动使用持久连接。</p>
+</note>
+
+<p>注意:必须启用 <module>mod_proxy</module> 才能使用此标志。</p>
+
+</section>
+
+<section id="flag_pt"><title>PT|passthrough</title>
+
+<p>
+RewriteRule 中的目标(或替换字符串)默认被假定为文件路径。
+使用 [PT] 标志使其被视为 URI。也就是说,
+使用 [PT] 标志会使 <directive
+module="mod_rewrite">RewriteRule</directive> 的结果
+被传回到 URL 映射中,从而基于位置的映射,如
+<directive module="mod_alias">Alias</directive>、
+<directive module="mod_alias">Redirect</directive> 或
+<directive module="mod_alias">ScriptAlias</directive>
+等,有机会生效。
+</p>
+
+<p>
+例如,如果你有一个 <directive module="mod_alias">Alias</directive>
+指向 /icons,并且有一个 <directive
+module="mod_rewrite">RewriteRule</directive> 指向那里,
+你应该使用 [PT] 标志以确保
+<directive module="mod_alias">Alias</directive> 被正确评估。
+</p>
+
+<highlight language="config">
+Alias "/icons" "/usr/local/apache/icons"
+RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]
+</highlight>
+
+<p>
+在这种情况下省略 [PT] 标志会导致 Alias 被忽略,
+从而返回"文件未找到"错误。
+</p>
+
+<p><code>PT</code> 标志隐含 <code>L</code> 标志:
+重写将停止以便将请求传递给下一个处理阶段。</p>
+
+<p>请注意,<code>PT</code> 标志在目录级上下文中是隐含的,
+例如 <directive type="section" module="core">Directory</directive>
+配置段或 <code>.htaccess</code> 文件中。规避此行为的唯一方法是重写为
+<code>-</code>。</p>
+
+</section>
+
+<section id="flag_qsa"><title>QSA|qsappend</title>
+<p>
+当替换 URI 包含查询字符串时,
+<directive module="mod_rewrite">RewriteRule</directive>
+的默认行为是丢弃现有的查询字符串,并用新生成的替换。
+使用 [QSA] 标志可以将查询字符串合并。
+</p>
+
+<p>请看以下规则:</p>
+
+<highlight language="config">
+RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA]
+</highlight>
+
+<p>使用 [QSA] 标志,对 <code>/pages/123?one=two</code> 的请求将被映射到
+<code>/page.php?page=123&amp;one=two</code>。不使用 [QSA]
+标志时,同一请求将被映射到
+<code>/page.php?page=123</code>——也就是说,现有的查询字符串将被丢弃。
+</p>
+</section>
+
+<section id="flag_qsd"><title>QSD|qsdiscard</title>
+<p>
+当请求的 URI 包含查询字符串而目标 URI 不包含时,
+<directive module="mod_rewrite">RewriteRule</directive>
+的默认行为是将该查询字符串复制到目标 URI。
+使用 [QSD] 标志可以丢弃查询字符串。
+</p>
+
+<p>此标志在 2.4.0 及更高版本中可用。</p>
+
+<p>
+同时使用 [QSD] 和 [QSA] 将导致 [QSD] 优先。
+</p>
+
+<p>
+如果目标 URI 有查询字符串,将执行默认行为——
+也就是说,原始查询字符串将被丢弃并替换为 <code>RewriteRule</code>
+目标 URI 中的查询字符串。
+</p>
+
+</section>
+
+<section id="flag_qsl"><title>QSL|qslast</title>
+<p>
+默认情况下,替换中第一个(最左边的)问号将路径与查询字符串分开。
+使用 [QSL] 标志指示
+<directive module="mod_rewrite">RewriteRule</directive>
+改为使用最后一个(最右边的)问号来分隔两个组件。</p>
+
+<p>
+当映射到文件名中包含字面量问号的文件时,这很有用。
+如果替换中未使用查询字符串,可以结合此标志在替换后附加一个问号。</p>
+
+<p>此标志在 2.4.19 及更高版本中可用。</p>
+
+</section>
+
+
+<section id="flag_r"><title>R|redirect</title>
+<p>
+使用 [R] 标志会导致向浏览器发出 HTTP 重定向。
+如果指定了完全限定的 URL(即包含 <code>http://servername/</code>),
+则将重定向到该位置。否则,将使用当前协议、服务器名称和端口号
+来生成与重定向一起发送的 URL。
+</p>
+
+<p>
+可以使用 [R=305] 语法指定<em>任何</em>有效的 HTTP 响应状态码,
+如果未指定则默认使用 302 状态码。指定的状态码不一定必须是重定向(3xx)状态码。
+但是,如果状态码超出重定向范围(300-399),替换字符串将被完全丢弃,
+重写将像使用了 <code>L</code> 一样停止。</p>
+
+<p>除了响应状态码外,你还可以使用它们的符号名称指定重定向状态:
+<code>temp</code>(默认)、<code>permanent</code> 或 <code>seeother</code>。</p>
+
+<p>
+你几乎总是希望将 [R] 与 [L] 结合使用(即使用 [R,L]),
+因为 [R] 标志本身只是在 URI 前面添加
+<code>http://thishost[:thisport]</code>,然后将其传递给规则集中的下一条规则,
+这通常会导致"请求中的 URI 无效"警告。
+</p>
+
+<p>注意:httpd 仅支持 HTTP 规范中包含的状态码。
+使用无法识别的状态码将导致 500 错误和错误日志消息。</p>
+
+</section>
+
+<section id="flag_s"><title>S|skip</title>
+<p>[S] 标志用于跳过你不想运行的规则。
+跳过标志的语法为 [S=<em>N</em>],其中 <em>N</em>
+表示要跳过的规则数(前提是
+<directive module="mod_rewrite">RewriteRule</directive> 及其前面的
+<directive module="mod_rewrite">RewriteCond</directive>
+指令匹配)。这可以看作是重写规则集中的 <code>goto</code> 语句。
+在以下示例中,我们只想在请求的 URI
+不对应实际文件时才运行 <directive module="mod_rewrite">RewriteRule</directive>。</p>
+
+<highlight language="config">
+# Is the request for a non-existent file?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# If so, skip these two RewriteRules
+RewriteRule ".?"                  "-" [S=2]
+
+RewriteRule "(.*\.gif)"           "images.php?$1"
+RewriteRule "(.*\.html)"          "docs.php?$1"
+</highlight>
+
+<p>此技术很有用,因为 <directive
+module="mod_rewrite">RewriteCond</directive> 只应用于紧随其后的
+<directive module="mod_rewrite">RewriteRule</directive>。
+因此,如果你想让一个 <code>RewriteCond</code> 应用于多个
+<code>RewriteRule</code>,一种可能的技术是否定这些条件并添加一个带有
+[Skip] 标志的 <code>RewriteRule</code>。你可以用此构造伪
+if-then-else 结构:then 子句的最后一条规则变为
+<code>skip=N</code>,其中 N 是 else 子句中的规则数:</p>
+<highlight language="config">
+# Does the file exist?
+RewriteCond "%{REQUEST_FILENAME}" !-f
+RewriteCond "%{REQUEST_FILENAME}" !-d
+# Create an if-then-else construct by skipping 3 lines if we meant to go to the &quot;else&quot; stanza.
+RewriteRule ".?"                  "-" [S=3]
+
+# IF the file exists, then:
+    RewriteRule "(.*\.gif)"  "images.php?$1"
+    RewriteRule "(.*\.html)" "docs.php?$1"
+    # Skip past the &quot;else&quot; stanza.
+    RewriteRule ".?"         "-" [S=1]
+# ELSE...
+    RewriteRule "(.*)"       "404.php?file=$1"
+# END
+</highlight>
+
+<p>使用 <directive type="section">If</directive>、<directive
+type="section">ElseIf</directive> 和 <directive
+type="section">Else</directive> 指令可能更容易实现这种配置。</p>
+
+</section>
+
+<section id="flag_t"><title>T|type</title>
+<p>设置响应将以何种 MIME 类型发送。这与 <directive
+module="mod_mime">AddType</directive> 指令的效果相同。</p>
+
+<p>例如,你可以使用以下技术在以特定方式请求时将 Perl 源代码作为纯文本提供:</p>
+
+<highlight language="config">
+# 将 .pl 文件作为纯文本提供
+RewriteRule "\.pl$"  "-" [T=text/plain]
+</highlight>
+
+<p>或者,如果你有一台相机生成没有文件扩展名的 jpeg 图像,
+你可以根据文件名强制使用正确的 MIME 类型来提供这些图像:</p>
+
+<highlight language="config">
+# 文件名中包含 'IMG' 的是 jpg 图像。
+RewriteRule "IMG"  "-" [T=image/jpg]
+</highlight>
+
+<p>请注意,这是一个简单的示例,使用
+<directive type="section" module="core">FilesMatch</directive>
+可以更好地完成。在使用重写之前,始终考虑问题的替代解决方案,
+因为重写总是比替代方案效率更低。</p>
+
+<p>
+如果在目录级上下文中使用,在<em>整轮 <module>mod_rewrite</module>
+处理过程中</em>仅使用 <code>-</code>(破折号)作为替换,
+否则使用此标志设置的 MIME 类型将由于内部重新处理
+(包括后续轮次的 <module>mod_rewrite</module> 处理)而丢失。
+<code>L</code> 标志在此上下文中可用于结束<em>当前</em>轮的
+<module>mod_rewrite</module> 处理。</p>
+</section>
+
+<section id="flag_unsafe_allow_3f"><title>UnsafeAllow3F</title>
+    <p>如果被重写的 HTTP 请求包含编码的问号 '%3f',
+    且重写结果的替换中包含 '?',则需要设置此标志才能允许重写继续。
+    这可以防止恶意 URL 利用捕获和重新替换编码的问号。</p>
+</section>
+<section id="flag_unsafe_prefix_stat"><title>UnsafePrefixStat</title>
+    <p>当服务器范围内的替换以变量或反向引用开头并解析为文件系统路径时,
+    需要设置此标志。这些替换不会以文档根目录为前缀。
+    这可以防止恶意 URL 导致展开的替换映射到意外的文件系统位置。</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+<section id="flag_unc"><title>UNC</title>
+    <p>设置此标志可防止合并多个前导斜杠,
+    如 Windows UNC 路径中使用的那样。当规则替换以多个字面量斜杠开头时,
+    不需要此标志。</p>
+
+    <p><since>2.5.1</since></p>
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/htaccess.xml.de b/docs/manual/rewrite/htaccess.xml.de
new file mode 100644 (file)
index 0000000..dfec6d9
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite und .htaccess-Dateien</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt,
+wie sich die Regeln ändern, wenn Sie <module>mod_rewrite</module> in
+.htaccess-Dateien verwenden, und wie Sie mit diesen Änderungen umgehen.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<!-- <seealso><a href="access.html">Zugriffskontrolle</a></seealso> -->
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/htaccess.xml.es b/docs/manual/rewrite/htaccess.xml.es
new file mode 100644 (file)
index 0000000..59d2522
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite y archivos .htaccess</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+la forma en que las reglas cambian cuando usa <module>mod_rewrite</module> en archivos .htaccess,
+y cómo lidiar con estos cambios.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<!-- <seealso><a href="access.html">Control de acceso</a></seealso> -->
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+</manualpage>
diff --git a/docs/manual/rewrite/htaccess.xml.ja b/docs/manual/rewrite/htaccess.xml.ja
new file mode 100644 (file)
index 0000000..446389f
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite と .htaccess ファイル</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+.htaccess ファイルで <module>mod_rewrite</module> を使用する際のルールの変更点と、
+それらの変更への対処方法について説明します。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<!-- <seealso><a href="access.html">アクセス制御</a></seealso> -->
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+</manualpage>
diff --git a/docs/manual/rewrite/htaccess.xml.ko b/docs/manual/rewrite/htaccess.xml.ko
new file mode 100644 (file)
index 0000000..0c98417
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite와 .htaccess 파일</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+.htaccess 파일에서 <module>mod_rewrite</module>를 사용할 때
+규칙이 변경되는 방식과 이러한 변경 사항을 처리하는 방법을
+설명합니다.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<!-- <seealso><a href="access.html">접근 제어</a></seealso> -->
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+</manualpage>
index 00ee9a1c1e2cfbe9a197e729dd6839ae5e1b6eab..04d01a385358f7199472b81c36b3fcd58d6869b1 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/htaccess.xml.tr b/docs/manual/rewrite/htaccess.xml.tr
new file mode 100644 (file)
index 0000000..245b20d
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite ve .htaccess dosyaları</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+<module>mod_rewrite</module> modülünü .htaccess dosyalarında
+kullandığınızda kuralların nasıl değiştiğini ve bu değişikliklerle
+nasıl başa çıkacağınızı açıklar.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<!-- <seealso><a href="access.html">Erişim denetimi</a></seealso> -->
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+</manualpage>
diff --git a/docs/manual/rewrite/htaccess.xml.zh-cn b/docs/manual/rewrite/htaccess.xml.zh-cn
new file mode 100644 (file)
index 0000000..0031a20
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="htaccess.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite 和 .htaccess 文件</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了在
+.htaccess 文件中使用 <module>mod_rewrite</module> 时规则的变化方式,
+以及如何处理这些变化。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<!-- <seealso><a href="access.html">访问控制</a></seealso> -->
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+</manualpage>
diff --git a/docs/manual/rewrite/index.xml.de b/docs/manual/rewrite/index.xml.de
new file mode 100644 (file)
index 0000000..cfcb854
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="index.xml.meta">
+<parentdocument href="../"/>
+
+  <title>Apache mod_rewrite</title>
+
+<summary>
+
+    <p><module>mod_rewrite</module> bietet eine Möglichkeit, eingehende
+    URL-Anfragen dynamisch zu modifizieren, basierend auf Regeln mit
+    <a href="intro.html#regex">regulären Ausdrücken</a>. Dies ermöglicht
+    es Ihnen, beliebige URLs auf Ihre interne URL-Struktur in jeder
+    gewünschten Weise abzubilden.</p>
+
+      <p>Es unterstützt eine unbegrenzte Anzahl von Regeln und eine
+      unbegrenzte Anzahl angehängter Regelbedingungen für jede Regel,
+      um einen wirklich flexiblen und leistungsfähigen Mechanismus zur
+      URL-Manipulation bereitzustellen. Die URL-Manipulationen können
+      von verschiedenen Tests abhängen: Servervariablen, Umgebungsvariablen,
+      HTTP-Header, Zeitstempel, externe Datenbankabfragen und verschiedene
+      andere externe Programme oder Handler können verwendet werden, um
+      eine granulare URL-Zuordnung zu erreichen.</p>
+
+      <p>Umschreibungsregeln können auf vollständige URLs angewendet werden,
+      einschließlich des Pfadinfo- und Query-String-Teils, und können im
+      Server-Kontext (<code>httpd.conf</code>), im VirtualHost-Kontext
+      (<directive type="section" module="core">VirtualHost</directive>-Blöcke)
+      oder im Verzeichniskontext (<code>.htaccess</code>-Dateien und
+      <directive type="section" module="core">Directory</directive>-Blöcke)
+      verwendet werden. Das umgeschriebene Ergebnis kann zu weiteren Regeln,
+      interner Unterverarbeitung, externer Anfrage-Umleitung oder
+      Proxy-Weiterleitung führen, abhängig davon, welche
+      <a href="flags.html">Flags</a> Sie an die Regeln anhängen.</p>
+
+      <p>Da <module>mod_rewrite</module> so leistungsfähig ist, kann es
+      tatsächlich recht komplex sein. Dieses Dokument ergänzt die
+      <a href="../mod/mod_rewrite.html">Referenzdokumentation</a> und
+      versucht, einen Teil dieser Komplexität zu mildern und hochgradig
+      kommentierte Beispiele für gängige Szenarien bereitzustellen, die Sie
+      mit <module>mod_rewrite</module> bewältigen können. Wir versuchen aber
+      auch zu zeigen, wann Sie <module>mod_rewrite</module> nicht verwenden
+      sollten, und stattdessen andere Standard-Apache-Funktionen nutzen
+      sollten, um diese unnötige Komplexität zu vermeiden.</p>
+
+<ul>
+<li><a href="../mod/mod_rewrite.html">mod_rewrite-Referenzdokumentation</a></li>
+<li><a href="intro.html">Einführung in reguläre Ausdrücke und mod_rewrite</a></li>
+<li><a href="flags.html">RewriteRule-Flags</a></li>
+<li><a href="rewritemap.html">Verwendung von RewriteMap</a></li>
+<li><a href="avoid.html">Wann man mod_rewrite <strong>NICHT</strong> verwenden sollte</a></li>
+<li><a href="remapping.html">Verwendung von mod_rewrite zur Umleitung und Neuzuordnung von URLs</a></li>
+<li><a href="access.html">Verwendung von mod_rewrite zur Zugriffskontrolle</a></li>
+<li><a href="vhosts.html">Dynamische virtuelle Hosts mit mod_rewrite</a></li>
+<li><a href="proxy.html">Dynamisches Proxying mit mod_rewrite</a></li>
+<li><a href="advanced.html">Fortgeschrittene Techniken</a></li>
+<li><a href="tech.html">Technische Details</a></li>
+</ul>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">mod_rewrite-Referenzdokumentation</a></seealso>
+<seealso><a href="../urlmapping.html">URLs dem Dateisystem zuordnen</a></seealso>
+<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite-Wiki</a></seealso>
+<seealso><a href="../glossary.html">Glossar</a></seealso>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/index.xml.es b/docs/manual/rewrite/index.xml.es
new file mode 100644 (file)
index 0000000..54eea16
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="index.xml.meta">
+<parentdocument href="../"/>
+
+  <title>Apache mod_rewrite</title>
+
+<summary>
+
+    <p><module>mod_rewrite</module> proporciona una forma de modificar las
+    solicitudes de URL entrantes, dinámicamente, basándose en reglas de <a href="intro.html#regex">expresiones
+    regulares</a>. Esto le permite mapear URLs arbitrarias a
+    su estructura interna de URLs de la forma que desee.</p>
+
+      <p>Soporta un número ilimitado de reglas y un
+      número ilimitado de condiciones de regla adjuntas para cada regla, para
+      proporcionar un mecanismo de manipulación de URLs realmente flexible y potente.
+      Las manipulaciones de URL pueden depender de varias pruebas:
+      variables del servidor, variables de entorno, cabeceras HTTP,
+      marcas de tiempo, consultas a bases de datos externas, y varios otros
+      programas externos o manejadores, pueden usarse para lograr una coincidencia
+      de URL granular.</p>
+
+      <p>Las reglas de reescritura pueden operar sobre las URLs completas, incluyendo las partes
+      de path-info y cadena de consulta, y pueden usarse en contexto per-servidor
+      (<code>httpd.conf</code>), contexto per-virtualhost (bloques <directive
+      type="section" module="core">VirtualHost</directive>), o
+      contexto per-directorio (archivos <code>.htaccess</code> y bloques <directive
+      type="section" module="core">Directory</directive>). El
+      resultado reescrito puede llevar a más reglas, sub-procesamiento
+      interno, redirección de solicitud externa, o paso a través de
+      proxy, dependiendo de qué <a href="flags.html">banderas</a>
+      adjunte a las reglas.</p>
+
+      <p>Dado que <module>mod_rewrite</module> es tan potente, puede ser bastante
+      complejo. Este documento complementa la <a
+      href="../mod/mod_rewrite.html">documentación de referencia</a>, e
+      intenta aliviar algo de esa complejidad, y proporcionar ejemplos altamente
+      anotados de escenarios comunes que puede manejar con
+      <module>mod_rewrite</module>. Pero también intentamos mostrarle cuándo no debería
+      usar <module>mod_rewrite</module>, y usar otras características estándar de Apache en su lugar,
+      evitando así esta complejidad innecesaria.</p>
+
+
+<ul>
+<li><a href="../mod/mod_rewrite.html">Documentación de referencia de
+mod_rewrite</a></li>
+<li><a href="intro.html">Introducción a las expresiones regulares y mod_rewrite</a></li>
+<li><a href="flags.html">Banderas de RewriteRule</a></li>
+<li><a href="rewritemap.html">Uso de RewriteMap</a></li>
+<li><a href="avoid.html">Cuándo <strong>NO</strong> usar mod_rewrite</a></li>
+<li><a href="remapping.html">Uso de mod_rewrite para redirección y remapeo de URLs</a></li>
+<li><a href="access.html">Uso de mod_rewrite para control de acceso</a></li>
+<li><a href="vhosts.html">Hosts virtuales dinámicos con mod_rewrite</a></li>
+<li><a href="proxy.html">Proxy dinámico con mod_rewrite</a></li>
+<li><a href="advanced.html">Técnicas avanzadas</a></li>
+<li><a href="tech.html">Detalles técnicos</a></li>
+</ul>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Documentación de referencia de
+mod_rewrite</a></seealso>
+<seealso><a href="../urlmapping.html">Mapeo de URLs al sistema de archivos</a></seealso>
+<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">Wiki de
+mod_rewrite</a></seealso>
+<seealso><a href="../glossary.html">Glosario</a></seealso>
+
+
+</manualpage>
index 081ea84775dfca154b4a3394a0bf886e036fb3fe..6169ca070a65dacb62c0fa7d621e40d4ae9de071 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1719571:1933438 (outdated) -->
+<!-- English Revision: 1933438 -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
 
 <summary>
 
-       <p><module>mod_rewrite</module> permet de modifier les requ&ecirc;tes
-       entrantes dynamiquement, en fonction de r&egrave;gles manipulant des <a
+       <p><module>mod_rewrite</module> permet de modifier les requêtes
+       entrantes dynamiquement, en fonction de règles manipulant des <a
        href="intro.html#regex">expressions rationnelles</a>. Vous pouvez
-       ainsi relier des URLs arbitraires &agrave; votre propre structure d'URLs
+       ainsi relier des URLs arbitraires à votre propre structure d'URLs
        interne comme vous le souhaitez.</p>
 
       <p>Il fournit un
-      m&eacute;canisme de manipulation d'URL particuli&egrave;rement souple et
-      puissant en supportant un nombre illimit&eacute; de r&egrave;gles et de
-      conditions attach&eacute;es &agrave; chaque r&egrave;gle. Les manipulations d'URLs
-      peuvent d&eacute;pendre de tests vari&eacute;s : les URLs peuvent
-      &ecirc;tre finement caract&eacute;ris&eacute;es en fonction de variables du serveur,
-      de variables d'environnement, d'en-t&ecirc;tes HTTP, de rep&egrave;res
-      temporels, de recherches dans des bases de donn&eacute;es
-      externes, ou m&ecirc;me de requ&ecirc;tes vers des bases de donn&eacute;es externes
-      et de diff&eacute;rents gestionnaires ou programmes externes.</p>
+      mécanisme de manipulation d'URL particulièrement souple et
+      puissant en supportant un nombre illimité de règles et de
+      conditions attachées à chaque règle. Les manipulations d'URLs
+      peuvent dépendre de tests variés : les URLs peuvent
+      être finement caractérisées en fonction de variables du serveur,
+      de variables d'environnement, d'en-têtes HTTP, de repères
+      temporels, de recherches dans des bases de données
+      externes, ou même de requêtes vers des bases de données externes
+      et de différents gestionnaires ou programmes externes.</p>
 
-      <p>Les r&egrave;gles de r&eacute;&eacute;criture peuvent agir sur l'ensemble des URLs (la partie chemin
-      et la cha&icirc;ne de param&egrave;tres) et peuvent &ecirc;tre utilis&eacute;es dans le contexte du serveur principal
+      <p>Les règles de réécriture peuvent agir sur l'ensemble des URLs (la partie chemin
+      et la chaîne de paramètres) et peuvent être utilisées dans le contexte du serveur principal
       (<code>httpd.conf</code>), mais aussi dans le contexte des
       serveurs virtuels (sections <directive
       type="section" module="core">VirtualHost</directive>), ou dans le
       contexte des
-      r&eacute;pertoires (fichiers <code>.htaccess</code> et blocs
-      <code>&lt;Directory&gt;</code>. Le r&eacute;sultat
-      r&eacute;&eacute;crit peut conduire vers d'autres r&egrave;gles &agrave; un
-      traitement secondaire interne, une redirection vers une requ&ecirc;te
-      externe ou m&ecirc;me l'envoi vers un serveur mandataire, en fonction
+      répertoires (fichiers <code>.htaccess</code> et blocs
+      <directive type="section" module="core">Directory</directive>). Le résultat
+      réécrit peut conduire vers d'autres règles à un
+      traitement secondaire interne, une redirection vers une requête
+      externe ou même l'envoi vers un serveur mandataire, en fonction
       des  <a href="flags.html">drapeaux</a> que vous attachez aux
-      r&egrave;gles</p>
+      règles</p>
 
-       <p><module>mod_rewrite</module> &eacute;tant tr&egrave;s puissant, il peut par
-       cons&eacute;quent &ecirc;tre tr&egrave;s complexe. Ce document
-       compl&egrave;te la <a
+       <p><module>mod_rewrite</module> étant très puissant, il peut par
+       conséquent être très complexe. Ce document
+       complète la <a
       href="../mod/mod_rewrite.html">documentation de
-      r&eacute;f&eacute;rence du module mod_rewrite</a>, et est sens&eacute; all&eacute;ger un
-      peu cette complexit&eacute;, et pr&eacute;senter des exemples largement
-      comment&eacute;s, ainsi que des situations courantes que vous
+      référence du module mod_rewrite</a>, et est sensé alléger un
+      peu cette complexité, et présenter des exemples largement
+      commentés, ainsi que des situations courantes que vous
       pourrez traiter avec <module>mod_rewrite</module>. Mais nous voulons aussi vous
-      montrer des situations o&ugrave; vous ne devrez pas utiliser
-      <module>mod_rewrite</module>, et lui pr&eacute;f&eacute;rer d'autres
-      fonctionnalit&eacute;s standard d'Apache, &eacute;vitant ainsi
-      d'entrer dans une complexit&eacute; inutile.</p>
+      montrer des situations où vous ne devrez pas utiliser
+      <module>mod_rewrite</module>, et lui préférer d'autres
+      fonctionnalités standard d'Apache, évitant ainsi
+      d'entrer dans une complexité inutile.</p>
 
 <ul>
 <li><a href="../mod/mod_rewrite.html">documentation de
-r&eacute;f&eacute;rence de mod_rewrite</a></li>
-<li><a href="intro.html">Introduction aux expressions rationnelles et &agrave;
+référence de mod_rewrite</a></li>
+<li><a href="intro.html">Introduction aux expressions rationnelles et à
 mod_rewrite</a></li>
-<li><a href="flags.html">Drapeaux de r&eacute;&eacute;criture</a></li>
+<li><a href="flags.html">Drapeaux de réécriture</a></li>
 <li><a href="rewritemap.html">Utilisation de  RewriteMap</a></li>
 <li><a href="avoid.html">Quand <strong>NE PAS</strong> utiliser mod_rewrite</a></li>
 <li><a href="remapping.html">Utilisation de mod_rewrite pour la
-redirection et la remise en correspondance avec le syst&egrave;me de
-fichiers des URLs</a></li>
+redirection et la remise en correspondance des URLs</a></li>
 <li><a href="access.html">Utilisation de mod_rewrite pour le
-contr&ocirc;le d'acc&egrave;s</a></li>
+contrôle d'accès</a></li>
 <li><a href="vhosts.html">Les serveurs virtuels dynamiques avec mod_rewrite</a></li>
 <li><a href="proxy.html">Les serveurs mandataires dynamiques avec mod_rewrite</a></li>
-<li><a href="advanced.html">Techniques avanc&eacute;es</a></li>
-<li><a href="tech.html">D&eacute;tails techniques</a></li>
+<li><a href="advanced.html">Techniques avancées</a></li>
+<li><a href="tech.html">Détails techniques</a></li>
 </ul>
 </summary>
 
 <seealso><a href="../mod/mod_rewrite.html">Documentation de
-r&eacute;f&eacute;rence de mod_rewrite</a></seealso>
+référence de mod_rewrite</a></seealso>
 <seealso><a href="../urlmapping.html">Mise en correspondance des URLs
-avec le syst&egrave;me de fichiers</a></seealso>
+avec le système de fichiers</a></seealso>
 <seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">wiki mod_rewrite
 </a></seealso>
 <seealso><a href="../glossary.html">Glossaire</a></seealso>
 
 </manualpage>
 
-
diff --git a/docs/manual/rewrite/index.xml.ja b/docs/manual/rewrite/index.xml.ja
new file mode 100644 (file)
index 0000000..417b87b
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="index.xml.meta">
+<parentdocument href="../"/>
+
+  <title>Apache mod_rewrite</title>
+
+<summary>
+
+    <p><module>mod_rewrite</module> は、<a href="intro.html#regex">正規表現</a>
+    ルールに基づいて受信 URL リクエストを動的に変更する方法を提供します。
+    これにより、任意の URL を内部 URL 構造に自由にマッピングできます。</p>
+
+      <p>各ルールに対して無制限の数のルールと無制限の数の
+      付随するルール条件をサポートしており、非常に柔軟で強力な URL 操作
+      メカニズムを提供します。URL 操作はさまざまなテストに依存できます:
+      サーバ変数、環境変数、HTTP ヘッダ、タイムスタンプ、外部データベース
+      検索、およびさまざまな他の外部プログラムやハンドラを使用して、
+      きめ細かい URL マッチングを実現できます。</p>
+
+      <p>書き換えルールは、完全な URL (パス情報とクエリ文字列部分を含む)
+      に対して動作でき、サーバ単位のコンテキスト
+      (<code>httpd.conf</code>)、バーチャルホスト単位のコンテキスト
+      (<directive type="section" module="core">VirtualHost</directive> ブロック)、
+      またはディレクトリ単位のコンテキスト (<code>.htaccess</code> ファイルと
+      <directive type="section" module="core">Directory</directive> ブロック)
+      で使用できます。書き換えの結果は、ルールに付加する
+      <a href="flags.html">フラグ</a>に応じて、さらなるルール処理、
+      内部サブ処理、外部リクエストリダイレクト、またはプロキシ
+      パススルーにつながります。</p>
+
+      <p><module>mod_rewrite</module> は非常に強力であるため、かなり
+      複雑になり得ます。このドキュメントは
+      <a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を
+      補足し、その複雑さを軽減し、<module>mod_rewrite</module> で扱う可能性のある
+      一般的なシナリオの詳細な注釈付きの例を提供することを試みます。
+      しかし同時に、<module>mod_rewrite</module> を使用すべきでない場合や、
+      代わりに他の標準的な Apache 機能を使用して不要な複雑さを避けるべき場合も
+      示そうとしています。</p>
+
+
+<ul>
+<li><a href="../mod/mod_rewrite.html">mod_rewrite リファレンスドキュメント</a></li>
+<li><a href="intro.html">正規表現と mod_rewrite の紹介</a></li>
+<li><a href="flags.html">RewriteRule フラグ</a></li>
+<li><a href="rewritemap.html">RewriteMap の使用</a></li>
+<li><a href="avoid.html">mod_rewrite を使う<strong>べきでない</strong>場合</a></li>
+<li><a href="remapping.html">mod_rewrite を使った URL のリダイレクトとリマッピング</a></li>
+<li><a href="access.html">mod_rewrite を使ったアクセス制御</a></li>
+<li><a href="vhosts.html">mod_rewrite を使った動的バーチャルホスト</a></li>
+<li><a href="proxy.html">mod_rewrite を使った動的プロキシ</a></li>
+<li><a href="advanced.html">高度なテクニック</a></li>
+<li><a href="tech.html">技術的詳細</a></li>
+</ul>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">mod_rewrite リファレンスドキュメント</a></seealso>
+<seealso><a href="../urlmapping.html">URL からファイルシステムへのマッピング</a></seealso>
+<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite
+wiki</a></seealso>
+<seealso><a href="../glossary.html">用語集</a></seealso>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/index.xml.ko b/docs/manual/rewrite/index.xml.ko
new file mode 100644 (file)
index 0000000..853184e
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="index.xml.meta">
+<parentdocument href="../"/>
+
+  <title>Apache mod_rewrite</title>
+
+<summary>
+
+    <p><module>mod_rewrite</module>는 <a href="intro.html#regex">정규
+    표현식</a> 규칙에 기반하여 들어오는 URL 요청을 동적으로
+    수정하는 방법을 제공합니다. 이를 통해 임의의 URL을
+    내부 URL 구조에 원하는 방식으로 매핑할 수 있습니다.</p>
+
+      <p>이것은 무제한의 규칙과 각 규칙에 대한 무제한의
+      첨부된 규칙 조건을 지원하여 정말로 유연하고 강력한
+      URL 조작 메커니즘을 제공합니다. URL 조작은 다양한
+      테스트에 의존할 수 있습니다: 서버 변수, 환경 변수,
+      HTTP 헤더, 타임스탬프, 외부 데이터베이스 조회 및
+      다양한 기타 외부 프로그램이나 핸들러를 사용하여
+      세밀한 URL 매칭을 달성할 수 있습니다.</p>
+
+      <p>재작성 규칙은 경로 정보 및 쿼리 문자열 부분을
+      포함한 전체 URL에 대해 작동할 수 있으며, 서버별
+      컨텍스트(<code>httpd.conf</code>), 가상호스트별
+      컨텍스트(<directive type="section"
+      module="core">VirtualHost</directive> 블록) 또는
+      디렉토리별 컨텍스트(<code>.htaccess</code> 파일 및
+      <directive type="section"
+      module="core">Directory</directive> 블록)에서
+      사용할 수 있습니다. 재작성된 결과는 규칙에 첨부하는
+      <a href="flags.html">플래그</a>에 따라 추가 규칙,
+      내부 하위 처리, 외부 요청 리다이렉션 또는 프록시
+      패스스루로 이어질 수 있습니다.</p>
+
+      <p><module>mod_rewrite</module>는 매우 강력하므로
+      상당히 복잡할 수 있습니다. 이 문서는
+      <a href="../mod/mod_rewrite.html">참조 문서</a>를
+      보충하며, 이러한 복잡성을 완화하고
+      <module>mod_rewrite</module>로 처리할 수 있는 일반적인
+      시나리오의 주석이 풍부한 예제를 제공하고자 합니다.
+      하지만 <module>mod_rewrite</module>를 사용하지 말아야 할
+      때도 보여주며, 대신 다른 표준 Apache 기능을 사용하여
+      이러한 불필요한 복잡성을 피하도록 합니다.</p>
+
+
+<ul>
+<li><a href="../mod/mod_rewrite.html">mod_rewrite 참조
+문서</a></li>
+<li><a href="intro.html">정규 표현식과 mod_rewrite 소개</a></li>
+<li><a href="flags.html">RewriteRule 플래그</a></li>
+<li><a href="rewritemap.html">RewriteMap 사용하기</a></li>
+<li><a href="avoid.html">mod_rewrite를 사용하지 <strong>말아야 할</strong> 경우</a></li>
+<li><a href="remapping.html">URL 리다이렉션 및 재매핑을 위한 mod_rewrite 사용</a></li>
+<li><a href="access.html">접근 제어를 위한 mod_rewrite 사용</a></li>
+<li><a href="vhosts.html">mod_rewrite를 사용한 동적 가상 호스트</a></li>
+<li><a href="proxy.html">mod_rewrite를 사용한 동적 프록시</a></li>
+<li><a href="advanced.html">고급 기술</a></li>
+<li><a href="tech.html">기술적 세부 사항</a></li>
+</ul>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">mod_rewrite 참조
+문서</a></seealso>
+<seealso><a href="../urlmapping.html">파일 시스템에 URL 매핑</a></seealso>
+<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite
+위키</a></seealso>
+<seealso><a href="../glossary.html">용어집</a></seealso>
+
+
+</manualpage>
index 96567025f086a6a208ce625d2f5661389b6349c8..d372797c711b331bf5217aa50ee2163bdf357dfb 100644 (file)
@@ -7,8 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant outdated="yes">fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
     <variant outdated="yes">tr</variant>
     <variant outdated="yes">zh-cn</variant>
   </variants>
index 3d6a47b305f8c9d5276b2e6d3ef240921ffcc35e..4fbe73fad21d210bc201c79183e26c20b70e406c 100644 (file)
@@ -1,11 +1,7 @@
 <?xml version='1.0' encoding='UTF-8' ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
-<!-- English Revision: 1174747:1933438 (outdated) -->
-<!-- =====================================================
- Translated by: Nilgün Belma Bugüner <nilgun belgeler.org>
-   Reviewed by: Orhan Berent <berent belgeler.org>
-========================================================== -->
+<!-- English Revision: 1933438 -->
 
 <!--
  Licensed to the Apache Software Foundation (ASF) under one or more
   <title>Apache mod_rewrite</title>
 
 <summary>
-    <p><module>mod_rewrite</module> modülü gelen URL isteklerinde değişiklik
-      yapabilmek için <a href="intro.html#regex">düzenli ifade</a> kurallarına
-      dayalı, devingen bir yol sunar. Böylece, keyfi URL'leri dahili URL
-      yapınızla kolayca eşleyebilirsiniz.</p>
 
-    <p>Gerçekten esnek ve güçlü bir URL kurgulama mekanizması oluşturmak için
-      sınısız sayıda kural ve her kural için de sınırsız sayıda koşul destekler.
-      URL değişiklikleri çeşitli sınamalara dayanır; sunucu değişkenleri, HTTP
-      başlıkları, ortam değişkenleri, zaman damgaları hatta çeşitli biçimlerde
-      harici veritabanı sorguları bile bu amaçla kullanılabilir.</p>
+    <p><module>mod_rewrite</module>, gelen URL isteklerini <a
+    href="intro.html#regex">düzenli ifade</a> kurallarına dayalı olarak
+    devingen bir şekilde değiştirmek için bir yol sunar. Böylece, keyfi
+    URL'leri istediğiniz şekilde dahili URL yapınıza
+    eşleyebilirsiniz.</p>
 
-    <p>Yeniden yazma kuralları URL’lerin tamamında (path-info kısmı ve sorgu
-      dizgesi dahil) hem sunucu bağlamında (<code>httpd.conf</code>) hem sanal
-      konaklar bağlamında (<directive type="section" module="core"
-      >VirtualHost</directive> bölümleri), hem de dizin bağlamında
-      (<code>.htaccess</code> dosyaları ve <code>&lt;Directory&gt;</code>
-      bölümleri) çalışır ve URL üzerinde sorgu dizgesi bölümleri bile
-      oluşturabilir. Kurallara atadığınız <a href="flags.html">seçeneklere</a>
-      bağlı olarak, yeniden yazılan URL sonuçta dahili işlemlerde, harici
-      yönlendirmelerde ve vekalet işlemlerinde kullanılabilir.</p>
+      <p>Gerçekten esnek ve güçlü bir URL değiştirme mekanizması
+      sağlamak üzere sınırsız sayıda kural ve her kural için sınırsız
+      sayıda ilişkili kural koşulunu destekler. URL değişiklikleri
+      çeşitli sınamalara bağlı olabilir: sunucu değişkenleri, ortam
+      değişkenleri, HTTP başlıkları, zaman damgaları, harici veritabanı
+      sorguları ve çeşitli diğer harici programlar veya işleyiciler,
+      ayrıntılı URL eşleştirme sağlamak için kullanılabilir.</p>
+
+      <p>Yeniden yazma kuralları, yol bilgisi ve sorgu dizgesi
+      bölümleri dahil olmak üzere URL'lerin tamamı üzerinde işlem
+      yapabilir ve sunucu bağlamında (<code>httpd.conf</code>), sanal
+      konak bağlamında (<directive type="section"
+      module="core">VirtualHost</directive> blokları) veya dizin
+      bağlamında (<code>.htaccess</code> dosyaları ve <directive
+      type="section" module="core">Directory</directive> blokları)
+      kullanılabilir. Yeniden yazılmış sonuç, kurallara eklediğiniz
+      <a href="flags.html">bayraklara</a> bağlı olarak başka
+      kurallara, dahili alt işlemeye, harici istek yönlendirmesine veya
+      vekil geçişine yol açabilir.</p>
+
+      <p><module>mod_rewrite</module> çok güçlü olduğundan, gerçekten
+      oldukça karmaşık olabilir. Bu belge, <a
+      href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar
+      ve bu karmaşıklığın bir kısmını gidermeye çalışır,
+      <module>mod_rewrite</module> ile ele alabileceğiniz yaygın
+      senaryoların ayrıntılı açıklamalı örneklerini sunar. Ancak aynı
+      zamanda, <module>mod_rewrite</module> kullanmamanız gereken
+      durumları da göstermeye çalışıyoruz; bunun yerine diğer standart
+      Apache özelliklerini kullanarak bu gereksiz karmaşıklıktan
+      kaçınabilirsiniz.</p>
 
-    <p><module>mod_rewrite</module> modülü çok güçlü olduğundan, gerçekten çok
-      karmaşık olabilir. Bu belge, <a href="../mod/mod_rewrite.html">başvuru
-      belgeleri</a>nin tamamlayıcısı olup karmaşıklığı biraz azaltmaya çalışır
-      ve <module>mod_rewrite</module> ile elde edilebilen ortak senaryoların
-      oldukça açıklamalı örneklerini sağlar. Fakat ayrıca,
-      <module>mod_rewrite</module> modülünü kullanmamanız, yerine standart
-      Apache özelliklerini kullanmanız gereken durumları da göstermeye,
-      böylece gereksiz karmaşıklıktan kurtulmanızı sağlamaya çalıştık.</p>
 
 <ul>
-<li><a href="../mod/mod_rewrite.html">mod_rewrite başvuru belgesi</a></li>
-<li><a href="intro.html">mod_rewrite ve düzenli ifadelere giriş</a></li>
-<li><a href="remapping.html">URL yönlendirme ve yeniden eşlemede mod_rewrite kullanımı</a></li>
-<li><a href="access.html">Erişimi denetlemekte mod_rewrite kullanımı</a></li>
+<li><a href="../mod/mod_rewrite.html">mod_rewrite başvuru
+belgeleri</a></li>
+<li><a href="intro.html">Düzenli ifadelere ve mod_rewrite'a giriş</a></li>
+<li><a href="flags.html">RewriteRule Bayrakları</a></li>
+<li><a href="rewritemap.html">RewriteMap Kullanımı</a></li>
+<li><a href="avoid.html">mod_rewrite <strong>Kullanılmaması</strong> Gereken Durumlar</a></li>
+<li><a href="remapping.html">URL yeniden yönlendirme ve yeniden eşleme için mod_rewrite kullanımı</a></li>
+<li><a href="access.html">Erişim denetimi için mod_rewrite kullanımı</a></li>
 <li><a href="vhosts.html">mod_rewrite ile devingen sanal konaklar</a></li>
-<li><a href="proxy.html">mod_rewrite ile devingen vekalet</a></li>
-<li><a href="rewritemap.html">RewriteMap kullanımı</a></li>
+<li><a href="proxy.html">mod_rewrite ile devingen vekil kullanımı</a></li>
 <li><a href="advanced.html">İleri teknikler</a></li>
-<li><a href="avoid.html">mod_rewrite ne zaman kullanıl<strong>maMA</strong>lı</a></li>
-<li><a href="flags.html">RewriteRule seçenekleri</a></li>
 <li><a href="tech.html">Teknik ayrıntılar</a></li>
 </ul>
 </summary>
 
-<seealso><a href="../mod/mod_rewrite.html">mod_rewrite başvuru belgesi</a>
-</seealso><seealso><a href="../urlmapping.html">URL’lerin Dosya Sistemine Eşlenmesi</a></seealso>
-<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite wiki</a>
-</seealso><seealso><a href="../glossary.html">Terimler</a></seealso>
-
-</manualpage>
+<seealso><a href="../mod/mod_rewrite.html">mod_rewrite başvuru
+belgeleri</a></seealso>
+<seealso><a href="../urlmapping.html">URL'lerin Dosya Sistemine Eşlenmesi</a></seealso>
+<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite
+wiki</a></seealso>
+<seealso><a href="../glossary.html">Terimler</a></seealso>
 
 
+</manualpage>
index 25bec68fe5ac15d2fa76e21b4f4e1dcfab57a611..e8f6bf715deb4b89e3d8625f5c628b48da29c239 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='UTF-8' ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
-<!-- English Revision: 1028730:1933438 (outdated) -->
+<!-- English Revision: 1933438 -->
 
 <!--
  Licensed to the Apache Software Foundation (ASF) under one or more
   <title>Apache mod_rewrite</title>
 
 <summary>
-    <p><module>mod_rewrite</module> 提供了基于<a 
-    href="intro.html#regex">正则表达式</a>规则动态修改传入的请求的 URL 的方法。
-    这允许你以自己喜欢的任意方法映射任意 URL 到你的内部 URL 结构。</p>
 
-    <p>它支持无限的规则,以及为每个规则附加条件,从而提供了一个真正灵活且强大的 URL
-    操作机制。URL 操作可以依赖于各种测试,例如服务器变量,环境变量,HTTP
-    头,时戳,甚至外部数据库查询等,以便完成 URL 单元匹配。</p>
+    <p><module>mod_rewrite</module> 提供了一种基于<a
+    href="intro.html#regex">正则表达式</a>规则动态修改传入 URL
+    请求的方法。这允许你以任意方式将任意 URL 映射到你的内部 URL 结构。</p>
 
-    <p>这个模块在服务器上下文 (<code>httpd.conf</code>),虚拟主机上下文 (<directive
-    type="section" module="core">VirtualHost</directive> 指令块),目录上下文
-    (<code>.htaccess</code> 文件和 <code>&lt;Directory&gt;</code>
-    指令块) 对完整的 URL (包含目录信息部分和查询字符串部分) 操作。
-    重写结果可以导致新的规则处理,内部的后续处理,外部请求重定向,甚至透过内部代理,
-    这取决于你为规则附加的<a href="flags.html">标志</a>。</p>
+      <p>它支持无限数量的规则,并且每条规则可以附加无限数量的规则条件,
+      从而提供了一个真正灵活且强大的 URL 操作机制。URL 操作可以依赖于各种测试:
+      服务器变量、环境变量、HTTP 头、时间戳、外部数据库查询,
+      以及各种其他外部程序或处理程序,都可以用于实现精细的 URL 匹配。</p>
 
-    <p>既然 mod_rewrite 这么强大,它当然是相当复杂。这篇文档作为<a
-    href="../mod/mod_rewrite.html">参考手册</a>的补充,试图减轻一些复杂性,
-    提供你可能使用 mod_rewrite 的常见场景的有充分注释的例子。
-    但是,我们也试图告诉你,在什么时候你不应当使用 mod_rewrite,
-    可以使用其它标准的 Apache 特性来达到目的,以避免无谓的复杂性。</p>
+      <p>重写规则可以操作完整的 URL,包括路径信息和查询字符串部分,
+      并且可以在服务器级上下文(<code>httpd.conf</code>)、
+      虚拟主机级上下文(<directive type="section"
+      module="core">VirtualHost</directive> 块)或目录级上下文
+      (<code>.htaccess</code> 文件和 <directive type="section"
+      module="core">Directory</directive> 块)中使用。
+      重写后的结果可以导向进一步的规则处理、内部子处理、外部请求重定向或代理透传,
+      这取决于你为规则附加的<a href="flags.html">标志</a>。</p>
+
+      <p>由于 <module>mod_rewrite</module> 功能非常强大,它确实可能相当复杂。
+      本文档是<a href="../mod/mod_rewrite.html">参考文档</a>的补充,
+      试图减轻一些复杂性,并提供你可能使用
+      <module>mod_rewrite</module> 处理的常见场景的详细注释示例。
+      但我们也会尝试告诉你何时不应该使用
+      <module>mod_rewrite</module>,而应使用其他标准的 Apache 特性来代替,
+      从而避免不必要的复杂性。</p>
 
 <ul>
-<li><a href="../mod/mod_rewrite.html">mod_rewrite å\8f\82è\80\83æ\89\8bå\86\8c</a></li>
-<li><a href="intro.html">正则表达式与 mod_rewrite 入门</a></li>
-<li><a href="remapping.html">使用 mod_rewrite 重定向和重新映射 URL</a></li>
-<li><a href="access.html">使用 mod_rewrite 控制访问</a></li>
-<li><a href="vhosts.html">动态虚拟主机与 mod_rewrite</a></li>
-<li><a href="proxy.html">动态代理与 mod_rewrite</a></li>
+<li><a href="../mod/mod_rewrite.html">mod_rewrite å\8f\82è\80\83æ\96\87æ¡£</a></li>
+<li><a href="intro.html">mod_rewrite 简介</a></li>
+<li><a href="remapping.html">URL 重映射和重定向</a></li>
+<li><a href="access.html">访问控制</a></li>
+<li><a href="vhosts.html">虚拟主机</a></li>
+<li><a href="proxy.html">代理</a></li>
 <li><a href="rewritemap.html">使用 RewriteMap</a></li>
-<li><a href="advanced.html">高级技术与诀窍</a></li>
-<li><a href="avoid.html">何时 <strong>不要</strong>使用 mod_rewrite</a></li>
+<li><a href="advanced.html">高级技术</a></li>
+<li><a href="avoid.html">何时使用 mod_rewrite</a></li>
 <li><a href="flags.html">RewriteRule 标志</a></li>
 <li><a href="tech.html">技术细节</a></li>
 </ul>
 </summary>
 
-<seealso><a href="../mod/mod_rewrite.html">mod_rewrite 参考手册</a></seealso>
-<seealso><a href="../urlmapping.html">从 URL 映射到文件系统</a></seealso>
-<seealso><a href="https://cwiki.apache.org/confluence/display/httpd/Rewrite">mod_rewrite
-wiki</a></seealso>
-<seealso><a href="../glossary.html">术语</a></seealso>
+<seealso><a href="../mod/mod_rewrite.html">mod_rewrite 参考文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">URL 重映射和重定向</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+<seealso><a href="flags.html">RewriteRule 标志</a></seealso>
+<seealso><a href="tech.html">技术细节</a></seealso>
 
 </manualpage>
diff --git a/docs/manual/rewrite/intro.xml.de b/docs/manual/rewrite/intro.xml.de
new file mode 100644 (file)
index 0000000..a501901
--- /dev/null
@@ -0,0 +1,396 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Einführung in Apache mod_rewrite</title>
+
+<summary>
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es
+beschreibt die grundlegenden Konzepte, die für die Verwendung von
+<module>mod_rewrite</module> notwendig sind. Andere Dokumente gehen
+mehr ins Detail, aber dieses Dokument soll dem Anfänger den Einstieg
+erleichtern.
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<!-- <seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso> -->
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="introduction"><title>Einführung</title>
+<p>Das Apache-Modul <module>mod_rewrite</module> ist ein sehr
+leistungsfähiges und ausgereiftes Modul, das eine Möglichkeit bietet,
+URL-Manipulationen durchzuführen. Damit können Sie nahezu alle Arten von
+URL-Umschreibungen durchführen, die Sie möglicherweise benötigen. Es ist
+jedoch etwas komplex und kann für Anfänger einschüchternd sein. Es besteht
+auch die Tendenz, Umschreibungsregeln als magische Formeln zu behandeln
+und sie zu verwenden, ohne wirklich zu verstehen, was sie tun.</p>
+
+<p>Dieses Dokument versucht, ausreichend Hintergrundwissen zu vermitteln,
+damit das Folgende verstanden und nicht nur blind kopiert wird.
+</p>
+
+<p>Denken Sie daran, dass viele gängige URL-Manipulationsaufgaben nicht
+die volle Leistungsfähigkeit und Komplexität von <module>mod_rewrite</module>
+erfordern. Für einfache Aufgaben siehe <module>mod_alias</module> und die
+Dokumentation zur <a href="../urlmapping.html">Zuordnung von URLs zum
+Dateisystem</a>.</p>
+
+<p>Stellen Sie schließlich vor dem Fortfahren sicher, dass Sie die
+Protokollebene von <module>mod_rewrite</module> mit der
+<directive module="core">LogLevel</directive>-Direktive auf eine der
+Trace-Ebenen konfigurieren. Obwohl dies eine überwältigende Menge an
+Informationen liefern kann, ist es unverzichtbar bei der Fehlersuche in
+der <module>mod_rewrite</module>-Konfiguration, da es Ihnen genau zeigt,
+wie jede Regel verarbeitet wird.</p>
+
+</section>
+
+<section id="regex"><title>Reguläre Ausdrücke</title>
+
+<p><module>mod_rewrite</module> verwendet das Vokabular der <a
+href="http://pcre.org/">Perl-kompatiblen regulären Ausdrücke</a>. In
+diesem Dokument versuchen wir nicht, eine detaillierte Referenz zu
+regulären Ausdrücken zu liefern. Dafür empfehlen wir die <a
+href="http://pcre.org/pcre.txt">PCRE-Manpages</a>, die <a
+href="http://perldoc.perl.org/perlre.html">Perl-Manpage für reguläre
+Ausdrücke</a> und <a
+href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Mastering
+Regular Expressions von Jeffrey Friedl</a> (die dritte Auflage stammt
+von 2006, aber die Syntax regulärer Ausdrücke ist im Wesentlichen
+unverändert, und es bleibt die maßgebliche Referenz zu diesem Thema).</p>
+
+<p>In diesem Dokument versuchen wir, genügend Regex-Vokabular zu
+vermitteln, um Ihnen den Einstieg zu erleichtern, ohne Sie zu
+überfordern, in der Hoffnung, dass <directive module="mod_rewrite"
+>RewriteRule</directive>s wissenschaftliche Formeln sind und keine
+magischen Beschwörungen.</p>
+
+<section id="regexvocab"><title>Regex-Vokabular</title>
+
+<p>Die folgenden sind die minimalen Bausteine, die Sie benötigen, um
+reguläre Ausdrücke und <directive module="mod_rewrite">RewriteRule</directive>s
+zu schreiben. Sie stellen sicherlich kein vollständiges Vokabular für
+reguläre Ausdrücke dar, aber sie sind ein guter Ausgangspunkt und sollten
+Ihnen helfen, grundlegende reguläre Ausdrücke zu lesen und eigene zu
+schreiben.</p>
+
+<table>
+<tr>
+<th>Zeichen</th>
+<th>Bedeutung</th>
+<th>Beispiel</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>Stimmt mit jedem einzelnen Zeichen überein</td>
+    <td><code>c.t</code> stimmt mit <code>cat</code>, <code>cot</code>,
+      <code>cut</code> usw. überein</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>Wiederholt die vorherige Übereinstimmung ein oder mehrmals</td>
+    <td><code>a+</code> stimmt mit <code>a</code>, <code>aa</code>,
+      <code>aaa</code> usw. überein</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>Wiederholt die vorherige Übereinstimmung null oder mehrmals</td>
+    <td><code>a*</code> stimmt mit allem überein, womit auch <code>a+</code>
+      übereinstimmt, aber auch mit einem leeren String</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>Macht die Übereinstimmung optional</td>
+    <td><code>colou?r</code> stimmt mit <code>color</code> und
+    <code>colour</code> überein</td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>Maskiert das nächste Zeichen</td>
+    <td><code>\.</code> stimmt mit <code>.</code> (Punkt) überein und nicht
+    mit <em>jedem einzelnen Zeichen</em>, wie oben erklärt</td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>Als Anker bezeichnet, stimmt mit dem Anfang des Strings überein</td>
+    <td><code>^a</code> stimmt mit einem String überein, der mit <code>a</code> beginnt</td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>Der andere Anker, stimmt mit dem Ende des Strings überein</td>
+    <td><code>a$</code> stimmt mit einem String überein, der mit <code>a</code> endet</td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>Gruppiert mehrere Zeichen zu einer Einheit und erfasst eine
+      Übereinstimmung zur Verwendung als Rückreferenz</td>
+    <td><code>(ab)+</code> stimmt mit <code>ababab</code> überein - das heißt,
+      das <code>+</code> gilt für die Gruppe. Für mehr zu Rückreferenzen
+      siehe <a href="#InternalBackRefs">unten</a></td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>Eine Zeichenklasse - stimmt mit einem der Zeichen überein</td>
+    <td><code>c[uoa]t</code> stimmt mit <code>cut</code>, <code>cot</code> oder
+      <code>cat</code> überein</td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>Negative Zeichenklasse - stimmt mit jedem nicht angegebenen Zeichen überein</td>
+    <td><code>c[^/]t</code> stimmt mit <code>cat</code> oder <code>c=t</code> überein,
+      aber nicht mit <code>c/t</code></td></tr>
+</table>
+
+<p>In <module>mod_rewrite</module> kann das Zeichen <code>!</code> vor
+einem regulären Ausdruck verwendet werden, um ihn zu negieren. Das heißt,
+ein String gilt nur dann als übereinstimmend, wenn er nicht mit dem Rest
+des Ausdrucks übereinstimmt.</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>Verfügbarkeit von Regex-Rückreferenzen</title>
+
+      <p>Hier ist eine wichtige Sache zu beachten: Wann immer Sie
+      Klammern in <em>Pattern</em> oder in einem der
+      <em>CondPattern</em> verwenden, werden intern Rückreferenzen
+      erstellt, die mit den Strings <code>$N</code> und <code>%N</code>
+      (siehe unten) verwendet werden können. Diese stehen für die
+      Erstellung des <em>Substitution</em>-Parameters einer
+      <directive module="mod_rewrite">RewriteRule</directive> oder des
+      <em>TestString</em>-Parameters einer
+      <directive module="mod_rewrite">RewriteCond</directive> zur Verfügung.</p>
+      <p>Erfassungen in den <directive module="mod_rewrite"
+      >RewriteRule</directive>-Mustern stehen (kontraintuitiv) allen
+      vorhergehenden <directive module="mod_rewrite">RewriteCond</directive>-Direktiven
+      zur Verfügung, da der <directive module="mod_rewrite">RewriteRule</directive>-Ausdruck
+      vor den einzelnen Bedingungen ausgewertet wird.</p>
+
+      <p>Abbildung 1 zeigt, an welche Stellen die Rückreferenzen zur
+      Expansion übertragen werden und illustriert den Ablauf der
+      RewriteRule-/RewriteCond-Zuordnung. In den nächsten Kapiteln
+      werden wir erkunden, wie diese Rückreferenzen verwendet werden,
+      also machen Sie sich keine Sorgen, wenn es Ihnen zunächst etwas
+      fremd erscheint.
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="Ablauf der RewriteRule- und RewriteCond-Zuordnung" /><br />
+      <dfn>Abbildung 1:</dfn> Der Rückreferenz-Ablauf durch eine Regel.<br />
+      In diesem Beispiel würde eine Anfrage für <code>/test/1234</code> in <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code> umgewandelt.
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>RewriteRule-Grundlagen</title>
+<p>Eine <directive module="mod_rewrite">RewriteRule</directive> besteht
+aus drei durch Leerzeichen getrennten Argumenten. Die Argumente sind:</p>
+<ol>
+<li><var>Pattern</var>: welche eingehenden URLs von der Regel betroffen sein sollen;</li>
+<li><var>Substitution</var>: wohin die übereinstimmenden Anfragen gesendet werden sollen;</li>
+<li><var>[flags]</var>: Optionen, die die umgeschriebene Anfrage beeinflussen.</li>
+</ol>
+
+<p>Das <var>Pattern</var> ist ein <a href="#regex">regulärer Ausdruck</a>.
+Es wird anfänglich (für die erste Umschreibungsregel oder bis eine Ersetzung
+erfolgt) gegen den URL-Pfad der eingehenden Anfrage abgeglichen (der Teil
+nach dem Hostnamen, aber vor einem Fragezeichen, das den Beginn eines
+Query-Strings anzeigt) oder im Verzeichniskontext gegen den Pfad der
+Anfrage relativ zum Verzeichnis, für das die Regel definiert ist. Sobald
+eine Ersetzung erfolgt ist, werden die folgenden Regeln gegen den
+ersetzten Wert abgeglichen.
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="Syntax der RewriteRule-Direktive" /><br />
+      <dfn>Abbildung 2:</dfn> Syntax der RewriteRule-Direktive.
+</p>
+
+<p>Die <var>Substitution</var> kann selbst eines von drei Dingen sein:</p>
+
+<dl>
+<dt>1. Ein vollständiger Dateisystempfad zu einer Ressource</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>Dies bildet eine Anfrage auf einen beliebigen Ort in Ihrem Dateisystem ab,
+ähnlich wie die <directive module="mod_alias">Alias</directive>-Direktive.</p>
+</dd>
+
+<dt>2. Ein Web-Pfad zu einer Ressource</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p>Wenn <directive module="core">DocumentRoot</directive> auf
+<code>/usr/local/apache2/htdocs</code> gesetzt ist, würde diese Direktive
+Anfragen für <code>http://example.com/games</code> auf den Pfad
+<code>/usr/local/apache2/htdocs/puzzles.html</code> abbilden.</p>
+
+</dd>
+
+<dt>3. Eine absolute URL</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>Dies weist den Client an, eine neue Anfrage für die angegebene URL zu
+stellen.</p>
+</dd>
+</dl>
+
+<note type="warning">Beachten Sie, dass <strong>1</strong> und <strong>2</strong> exakt dieselbe Syntax haben. Der Unterschied besteht darin, dass bei <strong>1</strong> die oberste Ebene des Zielpfads (d.h. <code>/usr/</code>) im Dateisystem existiert, während dies bei <strong>2</strong> nicht der Fall ist (d.h. es gibt kein <code>/bar/</code> als Verzeichnis auf der obersten Ebene im Dateisystem).</note>
+
+<p>Die <var>Substitution</var> kann auch
+<em>Rückreferenzen</em> auf Teile des eingehenden URL-Pfads enthalten,
+die vom <var>Pattern</var> erfasst wurden. Betrachten Sie Folgendes:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p>Die Variable <code>$1</code> wird durch den Text ersetzt, der vom
+Ausdruck innerhalb der Klammern im <var>Pattern</var> erfasst wurde.
+Beispielsweise würde eine Anfrage für
+<code>http://example.com/product/r14df/view</code> auf den Pfad
+<code>/var/web/productdb/r14df</code> abgebildet.</p>
+
+<p>Wenn mehr als ein Ausdruck in Klammern vorhanden ist, stehen sie
+in der Reihenfolge in den Variablen <code>$1</code>, <code>$2</code>,
+<code>$3</code> usw. zur Verfügung.</p>
+
+</section>
+
+<section id="flags"><title>Umschreibungs-Flags</title>
+<p>Das Verhalten einer <directive
+module="mod_rewrite">RewriteRule</directive> kann durch die Anwendung
+eines oder mehrerer Flags am Ende der Regel modifiziert werden.
+Beispielsweise kann das Übereinstimmungsverhalten einer Regel durch
+die Anwendung des <code>[NC]</code>-Flags auf Groß-/Kleinschreibung
+unempfindlich gemacht werden:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>Weitere Details zu den verfügbaren Flags, ihren Bedeutungen und
+Beispiele finden Sie im Dokument <a href="flags.html">Umschreibungs-Flags</a>.</p>
+
+</section>
+
+<section id="rewritecond"><title>Umschreibungsbedingungen</title>
+<p>Eine oder mehrere <directive module="mod_rewrite">RewriteCond</directive>-Direktiven
+können verwendet werden, um die Typen von Anfragen einzuschränken, die der
+nachfolgenden <directive module="mod_rewrite">RewriteRule</directive>
+unterliegen. Das erste Argument ist eine Variable, die eine Eigenschaft
+der Anfrage beschreibt, das zweite Argument ist ein <a href="#regex">regulärer
+Ausdruck</a>, der mit der Variable übereinstimmen muss, und ein optionales
+drittes Argument ist eine Liste von Flags, die die Art der Auswertung
+der Übereinstimmung modifizieren.</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="Syntax der RewriteCond-Direktive" /><br />
+      <dfn>Abbildung 3:</dfn> Syntax der RewriteCond-Direktive
+</p>
+
+<p>Um beispielsweise alle Anfragen von einem bestimmten IP-Bereich an
+einen anderen Server zu senden, könnten Sie Folgendes verwenden:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>Wenn mehr als eine <directive module="mod_rewrite">RewriteCond</directive>
+angegeben wird, müssen alle übereinstimmen, damit die
+<directive module="mod_rewrite">RewriteRule</directive> angewendet wird.
+Um beispielsweise Anfragen abzulehnen, die das Wort "hack" in ihrem
+Query-String enthalten, es sei denn, sie enthalten auch ein Cookie mit
+dem Wort "go", könnten Sie Folgendes verwenden:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>Beachten Sie, dass das Ausrufezeichen eine negative Übereinstimmung
+angibt, sodass die Regel nur angewendet wird, wenn das Cookie nicht "go"
+enthält.</p>
+
+<p>Übereinstimmungen in den regulären Ausdrücken der
+<directive module="mod_rewrite">RewriteCond</directive>s können als Teil
+der <var>Substitution</var> in der
+<directive module="mod_rewrite">RewriteRule</directive> über die Variablen
+<code>%1</code>, <code>%2</code> usw. verwendet werden. Beispielsweise
+leitet Folgendes die Anfrage abhängig vom für den Zugriff auf die Website
+verwendeten Hostnamen in ein anderes Verzeichnis:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p>Wenn die Anfrage für <code>http://example.com/foo/bar</code> war,
+dann enthält <code>%1</code> den Wert <code>example.com</code> und
+<code>$1</code> den Wert <code>foo/bar</code>.</p>
+
+</section>
+
+<section id="rewritemap"><title>Umschreibungs-Maps</title>
+
+<p>Die <directive module="mod_rewrite">RewriteMap</directive>-Direktive
+bietet eine Möglichkeit, sozusagen eine externe Funktion aufzurufen,
+um Ihre Umschreibung durchzuführen. Dies wird im
+<a href="rewritemap.html">ergänzenden RewriteMap-Dokument</a>
+ausführlicher besprochen.</p>
+</section>
+
+<section id="htaccess"><title>.htaccess-Dateien</title>
+
+<p>Umschreibungen werden typischerweise in der Hauptserverkonfiguration
+(außerhalb eines <directive type="section" module="core">Directory</directive>-Abschnitts)
+oder innerhalb von <directive type="section" module="core">VirtualHost</directive>-Containern
+konfiguriert. Dies ist die einfachste Art, Umschreibungen durchzuführen,
+und wird empfohlen. Es ist jedoch möglich, Umschreibungen innerhalb von
+<directive type="section" module="core">Directory</directive>-Abschnitten
+oder <a href="../howto/htaccess.html"><code>.htaccess</code>-Dateien</a>
+auf Kosten zusätzlicher Komplexität durchzuführen. Diese Technik wird
+als verzeichnisbasierte Umschreibung bezeichnet.</p>
+
+<p>Der Hauptunterschied zu serverweiten Umschreibungen besteht darin, dass
+der Pfadpräfix des Verzeichnisses, das die <code>.htaccess</code>-Datei
+enthält, vor dem Abgleich in der <directive module="mod_rewrite">RewriteRule</directive>
+entfernt wird. Zusätzlich sollte <directive module="mod_rewrite">RewriteBase</directive>
+verwendet werden, um sicherzustellen, dass die Anfrage korrekt zugeordnet wird.</p>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/intro.xml.es b/docs/manual/rewrite/intro.xml.es
new file mode 100644 (file)
index 0000000..78e49a2
--- /dev/null
@@ -0,0 +1,394 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Introducción a Apache mod_rewrite</title>
+
+<summary>
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+los conceptos básicos necesarios para el uso de
+<module>mod_rewrite</module>. Otros documentos entran en mayor detalle,
+pero este documento debería ayudar al principiante a mojarse los pies.
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<!-- <seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso> -->
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="introduction"><title>Introducción</title>
+<p>El módulo de Apache <module>mod_rewrite</module> es un módulo muy potente y
+sofisticado que proporciona una forma de hacer manipulaciones de URL. Con
+él, puede hacer casi todos los tipos de reescritura de URL que pueda necesitar. Es,
+sin embargo, algo complejo, y puede ser intimidante para el principiante.
+También hay una tendencia a tratar las reglas de reescritura como encantamientos mágicos,
+usándolas sin realmente entender lo que hacen.</p>
+
+<p>Este documento intenta dar suficiente contexto para que lo que
+sigue sea entendido, en lugar de simplemente copiado a ciegas.
+</p>
+
+<p>Recuerde que muchas tareas comunes de manipulación de URL no requieren la
+potencia y complejidad completas de <module>mod_rewrite</module>. Para tareas
+simples, consulte <module>mod_alias</module> y la documentación
+sobre <a href="../urlmapping.html">mapeo de URLs al
+sistema de archivos</a>.</p>
+
+<p>Finalmente, antes de continuar, asegúrese de configurar
+el nivel de log de <module>mod_rewrite</module> a uno de los niveles de traza usando
+la directiva <directive module="core">LogLevel</directive>. Aunque esto
+puede dar una cantidad abrumadora de información, es indispensable para
+depurar problemas con la configuración de <module>mod_rewrite</module>, ya que
+le dirá exactamente cómo se procesa cada regla.</p>
+
+</section>
+
+<section id="regex"><title>Expresiones Regulares</title>
+
+<p><module>mod_rewrite</module> usa el vocabulario de <a href="http://pcre.org/">Expresiones
+Regulares Compatibles con Perl</a>. En este documento, no intentamos
+proporcionar una referencia detallada de expresiones regulares. Para eso,
+recomendamos las <a href="http://pcre.org/pcre.txt">páginas man de PCRE</a>, la
+<a href="http://perldoc.perl.org/perlre.html">página man de expresiones
+regulares de Perl</a>, y <a
+href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Mastering
+Regular Expressions, de Jeffrey Friedl</a> (la tercera edición es de
+2006, pero la sintaxis de expresiones regulares es esencialmente la misma, y este
+sigue siendo la referencia definitiva sobre el tema).</p>
+
+<p>En este documento, intentamos proporcionar suficiente vocabulario de regex
+para que pueda comenzar, sin ser abrumador, con la esperanza de que
+las <directive module="mod_rewrite">RewriteRule</directive>s sean fórmulas
+científicas, en lugar de encantamientos mágicos.</p>
+
+<section id="regexvocab"><title>Vocabulario de Regex</title>
+
+<p>Los siguientes son los bloques de construcción mínimos que necesitará, para
+escribir expresiones regulares y <directive
+module="mod_rewrite">RewriteRule</directive>s. Ciertamente no
+representan un vocabulario completo de expresiones regulares, pero son un buen
+punto de partida, y deberían ayudarle a leer expresiones regulares básicas, así
+como a escribir las suyas propias.</p>
+
+<table>
+<tr>
+<th>Carácter</th>
+<th>Significado</th>
+<th>Ejemplo</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>Coincide con cualquier carácter individual</td>
+    <td><code>c.t</code> coincidirá con <code>cat</code>, <code>cot</code>,
+      <code>cut</code>, etc</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>Repite la coincidencia anterior una o más veces</td>
+    <td><code>a+</code> coincide con <code>a</code>, <code>aa</code>,
+      <code>aaa</code>, etc</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>Repite la coincidencia anterior cero o más veces</td>
+    <td><code>a*</code> coincide con todo lo mismo que <code>a+</code>,
+      pero también coincidirá con una cadena vacía</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>Hace la coincidencia opcional</td>
+    <td><code>colou?r</code> coincidirá con <code>color</code> y
+    <code>colour</code></td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>Escapa el siguiente carácter</td>
+    <td><code>\.</code> coincidirá con <code>.</code> (punto) y no con <em>cualquier
+    carácter individual</em> como se explicó arriba</td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>Llamado ancla, coincide con el inicio de la cadena</td>
+    <td><code>^a</code> coincide con una cadena que comienza con <code>a</code></td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>La otra ancla, coincide con el final de la cadena</td>
+    <td><code>a$</code> coincide con una cadena que termina con <code>a</code></td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>Agrupa varios caracteres en una sola unidad, y captura una coincidencia
+      para uso en una referencia inversa</td>
+    <td><code>(ab)+</code> coincide con <code>ababab</code> - es decir, el
+      <code>+</code> se aplica al grupo. Para más sobre referencias inversas vea
+      <a href="#InternalBackRefs">más abajo</a></td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>Una clase de caracteres - coincide con uno de los caracteres</td>
+    <td><code>c[uoa]t</code> coincide con <code>cut</code>, <code>cot</code> o
+      <code>cat</code></td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>Clase de caracteres negativa - coincide con cualquier carácter no especificado</td>
+    <td><code>c[^/]t</code> coincide con <code>cat</code> o <code>c=t</code> pero
+      no con <code>c/t</code></td></tr>
+</table>
+
+<p>En <module>mod_rewrite</module> el carácter <code>!</code> puede usarse
+antes de una expresión regular para negarla. Es decir, una cadena se
+considerará que ha coincidido solo si no coincide con el resto de
+la expresión.</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>Disponibilidad de Referencias Inversas de Regex</title>
+
+      <p>Una cosa importante que debe recordarse aquí: Siempre que
+      use paréntesis en <em>Pattern</em> o en uno de los
+      <em>CondPattern</em>, se crean referencias inversas internas
+      que pueden usarse con las cadenas <code>$N</code> y
+      <code>%N</code> (ver más abajo). Estas están disponibles para crear
+      el parámetro <em>Substitution</em> de una
+      <directive module="mod_rewrite">RewriteRule</directive> o
+      el parámetro <em>TestString</em> de una
+      <directive module="mod_rewrite">RewriteCond</directive>.</p>
+      <p>  Las capturas en los patrones de <directive module="mod_rewrite"
+      >RewriteRule</directive> están (contraintuitivamente) disponibles para
+       todas las directivas
+      <directive module="mod_rewrite">RewriteCond</directive> precedentes,
+      porque la expresión de <directive module="mod_rewrite">RewriteRule</directive>
+      se evalúa antes que las condiciones individuales.</p>
+
+      <p>La Figura 1 muestra a qué
+      ubicaciones se transfieren las referencias inversas para expansión, así
+      como ilustra el flujo de la coincidencia de RewriteRule, RewriteCond.
+      En los próximos capítulos, exploraremos cómo usar
+      estas referencias inversas, así que no se preocupe si le parece un poco extraño
+      al principio.
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="Flujo de coincidencia de RewriteRule y RewriteCond" /><br />
+      <dfn>Figura 1:</dfn> El flujo de referencias inversas a través de una regla.<br />
+      En este ejemplo, una solicitud para <code>/test/1234</code> sería transformada en <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code>.
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>Conceptos Básicos de RewriteRule</title>
+<p>Una <directive module="mod_rewrite">RewriteRule</directive> consiste
+en tres argumentos separados por espacios. Los argumentos son</p>
+<ol>
+<li><var>Pattern</var>: qué URLs entrantes deben ser afectadas por la regla;</li>
+<li><var>Substitution</var>: a dónde deben enviarse las solicitudes coincidentes;</li>
+<li><var>[flags]</var>: opciones que afectan a la solicitud reescrita.</li>
+</ol>
+
+<p>El <var>Pattern</var> es una <a href="#regex">expresión regular</a>.
+Se compara inicialmente (para la primera regla de reescritura o hasta que ocurra una sustitución)
+contra la ruta URL de la solicitud entrante (la parte después del
+nombre de host pero antes de cualquier signo de interrogación que indique el inicio de una cadena
+de consulta) o, en contexto per-directorio, contra la ruta de la solicitud relativa
+al directorio para el cual se define la regla. Una vez que ha ocurrido una sustitución,
+las reglas siguientes se comparan contra el valor
+sustituido.
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="Sintaxis de la directiva RewriteRule" /><br />
+      <dfn>Figura 2:</dfn> Sintaxis de la directiva RewriteRule.
+</p>
+
+
+<p>La <var>Substitution</var> puede ser una de tres cosas:</p>
+
+<dl>
+<dt>1. Una ruta completa del sistema de archivos a un recurso</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>Esto mapea una solicitud a una ubicación arbitraria en su sistema de archivos, de forma
+similar a la directiva <directive module="mod_alias">Alias</directive>.</p>
+</dd>
+
+<dt>2. Una ruta web a un recurso</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p>Si <directive module="core">DocumentRoot</directive> está configurado
+como <code>/usr/local/apache2/htdocs</code>, entonces esta directiva
+mapearía solicitudes para <code>http://example.com/games</code> a la
+ruta <code>/usr/local/apache2/htdocs/puzzles.html</code>.</p>
+
+</dd>
+
+<dt>3. Una URL absoluta</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>Esto le dice al cliente que haga una nueva solicitud a la URL especificada.</p>
+</dd>
+</dl>
+
+<note type="warning">Tenga en cuenta que <strong>1</strong> y <strong>2</strong> tienen exactamente la misma sintaxis. La diferencia entre ellos es que en el caso de <strong>1</strong>, el nivel superior de la ruta destino (es decir, <code>/usr/</code>) existe en el sistema de archivos, mientras que en el caso de <strong>2</strong>, no existe. (es decir, no hay <code>/bar/</code> como directorio de nivel raíz en el sistema de archivos.)</note>
+
+<p>La <var>Substitution</var> también puede
+contener <em>referencias inversas</em> a partes de la ruta URL entrante
+coincidida por el <var>Pattern</var>. Considere lo siguiente:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p>La variable <code>$1</code> será reemplazada por cualquier texto
+que haya coincidido con la expresión dentro de los paréntesis en
+el <var>Pattern</var>. Por ejemplo, una solicitud
+para <code>http://example.com/product/r14df/view</code> será mapeada
+a la ruta <code>/var/web/productdb/r14df</code>.</p>
+
+<p>Si hay más de una expresión entre paréntesis, están
+disponibles en orden en las
+variables <code>$1</code>, <code>$2</code>, <code>$3</code>, y así
+sucesivamente.</p>
+
+
+</section>
+
+<section id="flags"><title>Banderas de Reescritura</title>
+<p>El comportamiento de una <directive
+module="mod_rewrite">RewriteRule</directive> puede ser modificado por la
+aplicación de una o más banderas al final de la regla. Por ejemplo, el
+comportamiento de coincidencia de una regla puede hacerse insensible a mayúsculas/minúsculas mediante la
+aplicación de la bandera <code>[NC]</code>:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>Para más detalles sobre las banderas disponibles, sus significados, y
+ejemplos, consulte el documento de <a href="flags.html">Banderas de Reescritura</a>.</p>
+
+</section>
+
+
+<section id="rewritecond"><title>Condiciones de Reescritura</title>
+<p>Una o más directivas <directive module="mod_rewrite">RewriteCond</directive>
+pueden usarse para restringir los tipos de solicitudes que estarán
+sujetas a la
+<directive module="mod_rewrite">RewriteRule</directive> siguiente. El
+primer argumento es una variable que describe una característica de la
+solicitud, el segundo argumento es una <a href="#regex">expresión
+regular</a> que debe coincidir con la variable, y un tercer argumento opcional
+es una lista de banderas que modifican cómo se evalúa la coincidencia.</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="Sintaxis de la directiva RewriteCond" /><br />
+      <dfn>Figura 3:</dfn> Sintaxis de la directiva RewriteCond
+</p>
+
+<p>Por ejemplo, para enviar todas las solicitudes desde un rango de IP particular a un
+servidor diferente, podría usar:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>Cuando se especifica más de
+una <directive module="mod_rewrite">RewriteCond</directive>,
+todas deben coincidir para que la
+<directive module="mod_rewrite">RewriteRule</directive> se aplique.
+Por ejemplo, para denegar solicitudes que contengan la palabra "hack" en
+su cadena de consulta, a menos que también contengan una cookie que contenga
+la palabra "go", podría usar:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>Note que el signo de exclamación especifica una coincidencia negativa, por lo que la regla solo se aplica si la cookie no contiene "go".</p>
+
+<p>Las coincidencias en las expresiones regulares contenidas en
+las <directive module="mod_rewrite">RewriteCond</directive>s pueden
+usarse como parte de la <var>Substitution</var> en
+la <directive module="mod_rewrite">RewriteRule</directive> usando las
+variables <code>%1</code>, <code>%2</code>, etc. Por ejemplo, esto
+dirigirá la solicitud a un directorio diferente dependiendo del
+nombre de host usado para acceder al sitio:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p>Si la solicitud fue para <code>http://example.com/foo/bar</code>,
+entonces <code>%1</code> contendrá <code>example.com</code>
+y <code>$1</code> contendrá <code>foo/bar</code>.</p>
+
+
+
+</section>
+
+<section id="rewritemap"><title>Mapas de reescritura</title>
+
+<p>La directiva <directive module="mod_rewrite">RewriteMap</directive>
+proporciona una forma de llamar a una función externa, por así decirlo, para hacer su
+reescritura por usted. Esto se discute con mayor detalle en la <a
+href="rewritemap.html">documentación complementaria de RewriteMap</a>.</p>
+</section>
+
+<section id="htaccess"><title>Archivos .htaccess</title>
+
+<p>La reescritura se configura típicamente en la configuración principal del servidor
+(fuera de cualquier sección <directive type="section"
+module="core">Directory</directive>) o
+dentro de contenedores <directive type="section" module="core">VirtualHost</directive>.
+Esta es la forma más fácil de hacer reescritura y es
+recomendada. Sin embargo, es posible hacer reescritura
+dentro de secciones <directive type="section" module="core">Directory</directive>
+o archivos <a href="../howto/htaccess.html"><code>.htaccess</code></a>
+a costa de algo de complejidad adicional. Esta técnica
+se llama reescrituras per-directorio.</p>
+
+<p>La principal diferencia con las reescrituras per-servidor es que el prefijo de ruta
+del directorio que contiene el archivo <code>.htaccess</code> se
+elimina antes de la coincidencia en
+la <directive module="mod_rewrite">RewriteRule</directive>. Además, se debería usar <directive module="mod_rewrite">RewriteBase</directive> para asegurar que la solicitud se mapee correctamente.</p>
+
+</section>
+
+</manualpage>
index 75846f57830a6ad5e8b2b5034d8b6b28da3e7ec8..da1c56f7feb68d55813f2de6e90c1fedb2efd0ed 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1906637:1933423 (outdated) -->
+<!-- English Revision: 1933423 -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
@@ -89,8 +89,10 @@ expressions rationnelles. A cet effet, nous recommandons les <a
 href="http://pcre.org/pcre.txt">pages de manuel de PCRE</a>, la <a
 href="http://perldoc.perl.org/perlre.html">page de manuel des
 expressions rationnelles Perl</a>, et l'ouvrage <a
-href="http://shop.oreilly.com/product/9780596528126.do">Mastering
-Regular Expressions, by Jeffrey Friedl</a>.</p>
+href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Mastering
+Regular Expressions, by Jeffrey Friedl</a> (la troisième édition date
+de 2006, mais la syntaxe des expressions rationnelles n'a pas vraiment
+changé, et cet ouvrage reste la référence en la matière).</p>
 
 <p>Dans ce document, nous avons pour but de vous fournir suffisamment de
 vocabulaire des expressions rationnelles pour vous mettre le pied à
@@ -129,6 +131,9 @@ précédent zéro ou plusieurs fois</td>
 <tr><td><code>?</code></td><td>Rend la correspondance optionnelle.</td><td>
 <code>colou?r</code> correspondra à <code>color</code> et <code>colour</code>.</td>
 </tr>
+<tr><td><code>\</code></td><td>Échappe le caractère
+suivant</td><td><code>\.</code> correspondra à <code>.</code> (point) et non pas à
+<em>tout caractère unique</em> comme expliqué ci-dessus</td></tr>
 <tr><td><code>^</code></td><td>Appelé ancrage, correspond au début de la
 chaîne</td>
 <td><code>^a</code> correspond à une chaîne qui commence par
@@ -408,4 +413,3 @@ requête est correctement mise en correspondance.</p>
 </section>
 
 </manualpage>
-
diff --git a/docs/manual/rewrite/intro.xml.ja b/docs/manual/rewrite/intro.xml.ja
new file mode 100644 (file)
index 0000000..7d66424
--- /dev/null
@@ -0,0 +1,383 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 入門</title>
+
+<summary>
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> の使用に必要な基本概念を説明します。
+他のドキュメントではさらに詳しく説明しますが、このドキュメントは
+初心者が最初の一歩を踏み出すのに役立つはずです。
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<!-- <seealso><a href="intro.html">mod_rewrite 入門</a></seealso> -->
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="introduction"><title>はじめに</title>
+<p>Apache モジュール <module>mod_rewrite</module> は、URL 操作を行う方法を
+提供する非常に強力で洗練されたモジュールです。これを使用すると、
+必要なほぼすべての種類の URL 書き換えを行うことができます。
+ただし、やや複雑で、初心者には敷居が高く感じられるかもしれません。
+また、書き換えルールを実際に何をしているか理解せずに、魔法の呪文として
+扱う傾向もあります。</p>
+
+<p>このドキュメントは、以下の内容が単にコピーされるのではなく、
+理解されるための十分な背景を提供することを目指しています。
+</p>
+
+<p>多くの一般的な URL 操作タスクは <module>mod_rewrite</module> の
+フルパワーと複雑さを必要としないことを忘れないでください。シンプルな
+タスクについては、<module>mod_alias</module> と
+<a href="../urlmapping.html">URL からファイルシステムへの
+マッピング</a>に関するドキュメントを参照してください。</p>
+
+<p>最後に、先に進む前に、<directive module="core">LogLevel</directive>
+ディレクティブを使用して <module>mod_rewrite</module> のログレベルを
+trace レベルのいずれかに設定してください。これにより圧倒的な量の情報が
+得られますが、<module>mod_rewrite</module> 設定の問題をデバッグするのに
+不可欠です。各ルールがどのように処理されるかを正確に教えてくれます。</p>
+
+</section>
+
+<section id="regex"><title>正規表現</title>
+
+<p><module>mod_rewrite</module> は <a href="http://pcre.org/">Perl 互換
+正規表現</a>の語彙を使用します。このドキュメントでは、正規表現の
+詳細なリファレンスを提供しようとはしていません。そのためには、
+<a href="http://pcre.org/pcre.txt">PCRE man ページ</a>、
+<a href="http://perldoc.perl.org/perlre.html">Perl 正規表現
+man ページ</a>、および
+<a href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Jeffrey Friedl 著
+『詳説 正規表現』</a> (第 3 版は 2006 年のものですが、正規表現の
+構文は本質的に変わっておらず、このテーマの決定的なリファレンスです)
+を推奨します。</p>
+
+<p>このドキュメントでは、圧倒されることなく始められるように、
+十分な正規表現の語彙を提供しようとしています。
+<directive module="mod_rewrite">RewriteRule</directive> が魔法の呪文ではなく、
+科学的な公式であるようになることを願っています。</p>
+
+<section id="regexvocab"><title>正規表現の語彙</title>
+
+<p>以下は、正規表現と <directive
+module="mod_rewrite">RewriteRule</directive> を書くために必要な
+最小限の構成要素です。これらは完全な正規表現の語彙を表すものでは
+ありませんが、良い出発点であり、基本的な正規表現を読むだけでなく、
+自分で書くのにも役立つはずです。</p>
+
+<table>
+<tr>
+<th>文字</th>
+<th>意味</th>
+<th>例</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>任意の 1 文字にマッチ</td>
+    <td><code>c.t</code> は <code>cat</code>、<code>cot</code>、
+      <code>cut</code> 等にマッチ</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>直前のマッチを 1 回以上繰り返す</td>
+    <td><code>a+</code> は <code>a</code>、<code>aa</code>、
+      <code>aaa</code> 等にマッチ</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>直前のマッチを 0 回以上繰り返す</td>
+    <td><code>a*</code> は <code>a+</code> がマッチするすべてにマッチするが、
+      空文字列にもマッチする</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>マッチをオプションにする</td>
+    <td><code>colou?r</code> は <code>color</code> と
+    <code>colour</code> にマッチ</td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>次の文字をエスケープ</td>
+    <td><code>\.</code> は上記で説明した<em>任意の 1 文字</em>ではなく、
+    <code>.</code> (ドット) にマッチ</td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>アンカーと呼ばれ、文字列の先頭にマッチ</td>
+    <td><code>^a</code> は <code>a</code> で始まる文字列にマッチ</td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>もう一つのアンカーで、文字列の末尾にマッチ</td>
+    <td><code>a$</code> は <code>a</code> で終わる文字列にマッチ</td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>複数の文字を 1 つの単位にグループ化し、バックリファレンスで
+      使用するためのマッチをキャプチャ</td>
+    <td><code>(ab)+</code> は <code>ababab</code> にマッチ - つまり、
+      <code>+</code> がグループに適用される。バックリファレンスの
+      詳細は<a href="#InternalBackRefs">以下</a>を参照</td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>文字クラス - いずれかの文字にマッチ</td>
+    <td><code>c[uoa]t</code> は <code>cut</code>、<code>cot</code>、
+      <code>cat</code> にマッチ</td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>否定文字クラス - 指定されていない任意の文字にマッチ</td>
+    <td><code>c[^/]t</code> は <code>cat</code> や <code>c=t</code> に
+      マッチするが、<code>c/t</code> にはマッチしない</td></tr>
+</table>
+
+<p><module>mod_rewrite</module> では、正規表現の前に <code>!</code> 文字を
+使用して否定できます。つまり、式の残りの部分にマッチしない場合にのみ、
+文字列がマッチしたとみなされます。</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>正規表現バックリファレンスの利用</title>
+
+      <p>ここで覚えておくべき重要なことがあります: <em>Pattern</em> 内または
+      <em>CondPattern</em> 内で括弧を使用するたびに、内部的にバックリファレンスが
+      作成され、<code>$N</code> および <code>%N</code> という文字列で使用
+      できます (以下を参照)。これらは
+      <directive module="mod_rewrite">RewriteRule</directive> の
+      <em>Substitution</em> パラメータまたは
+      <directive module="mod_rewrite">RewriteCond</directive> の
+      <em>TestString</em> パラメータの作成に使用できます。</p>
+      <p><directive module="mod_rewrite">RewriteRule</directive> パターン内の
+      キャプチャは、(直感に反して) すべての先行する
+      <directive module="mod_rewrite">RewriteCond</directive> ディレクティブで
+      利用可能です。これは、<directive module="mod_rewrite">RewriteRule</directive>
+      式が個々の条件よりも先に評価されるためです。</p>
+
+      <p>図 1 は、バックリファレンスが展開のためにどの場所に
+      転送されるかを示すとともに、RewriteRule と RewriteCond の
+      マッチングのフローを図示しています。次の章では、これらの
+      バックリファレンスの使用方法を探りますので、最初は少し
+      馴染みがないように感じても心配しないでください。
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="RewriteRule と RewriteCond マッチングのフロー" /><br />
+      <dfn>図 1:</dfn> ルールを通るバックリファレンスのフロー。<br />
+      この例では、<code>/test/1234</code> へのリクエストは <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code> に変換されます。
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>RewriteRule の基本</title>
+<p><directive module="mod_rewrite">RewriteRule</directive> は、
+スペースで区切られた 3 つの引数で構成されます。引数は以下の通りです</p>
+<ol>
+<li><var>Pattern</var>: ルールの影響を受ける受信 URL;</li>
+<li><var>Substitution</var>: マッチするリクエストの送信先;</li>
+<li><var>[flags]</var>: 書き換えられたリクエストに影響するオプション。</li>
+</ol>
+
+<p><var>Pattern</var> は<a href="#regex">正規表現</a>です。
+最初 (最初の書き換えルールまたは置換が発生するまで) は、受信リクエストの
+URL パス (ホスト名の後、クエリ文字列の開始を示す疑問符の前の部分) に対して
+マッチされます。ディレクトリ単位のコンテキストでは、ルールが定義された
+ディレクトリに対するリクエストの相対パスに対してマッチされます。
+置換が発生すると、後続のルールは置換された値に対してマッチされます。
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="RewriteRule ディレクティブの構文" /><br />
+      <dfn>図 2:</dfn> RewriteRule ディレクティブの構文
+</p>
+
+
+<p><var>Substitution</var> 自体は以下の 3 つのいずれかです:</p>
+
+<dl>
+<dt>1. リソースへの完全なファイルシステムパス</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>これは、<directive module="mod_alias">Alias</directive> ディレクティブと
+同様に、リクエストをファイルシステム上の任意の場所にマッピングします。</p>
+</dd>
+
+<dt>2. リソースへの Web パス</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p><directive module="core">DocumentRoot</directive> が
+<code>/usr/local/apache2/htdocs</code> に設定されている場合、
+このディレクティブは <code>http://example.com/games</code> への
+リクエストをパス <code>/usr/local/apache2/htdocs/puzzles.html</code>
+にマッピングします。</p>
+
+</dd>
+
+<dt>3. 絶対 URL</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>これは、指定された URL に対する新しいリクエストを行うよう
+クライアントに指示します。</p>
+</dd>
+</dl>
+
+<note type="warning"><strong>1</strong> と <strong>2</strong> はまったく同じ構文であることに注意してください。違いは、<strong>1</strong> の場合はターゲットパスのトップレベル (つまり <code>/usr/</code>) がファイルシステム上に存在するのに対し、<strong>2</strong> の場合は存在しない (つまり、ファイルシステムのルートレベルディレクトリとして <code>/bar/</code> が存在しない) ことです。</note>
+
+<p><var>Substitution</var> には、<var>Pattern</var> でマッチした
+受信 URL パスの部分への<em>バックリファレンス</em>も含めることができます。
+以下を考えてみてください:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p>変数 <code>$1</code> は、<var>Pattern</var> 内の括弧内の
+式でマッチしたテキストに置き換えられます。例えば、
+<code>http://example.com/product/r14df/view</code> へのリクエストは
+パス <code>/var/web/productdb/r14df</code> にマッピングされます。</p>
+
+<p>括弧内の式が複数ある場合、変数 <code>$1</code>、<code>$2</code>、
+<code>$3</code> 等の順序で利用できます。</p>
+
+
+</section>
+
+<section id="flags"><title>書き換えフラグ</title>
+<p><directive module="mod_rewrite">RewriteRule</directive> の動作は、
+ルールの末尾に 1 つ以上のフラグを適用することで変更できます。例えば、
+ルールのマッチング動作は <code>[NC]</code> フラグの適用で
+大文字小文字を区別しないようにできます:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>利用可能なフラグ、その意味、および例の詳細については、
+<a href="flags.html">書き換えフラグ</a>ドキュメントを参照してください。</p>
+
+</section>
+
+
+<section id="rewritecond"><title>書き換え条件</title>
+<p>1 つ以上の <directive module="mod_rewrite">RewriteCond</directive>
+ディレクティブを使用して、後続の
+<directive module="mod_rewrite">RewriteRule</directive> の対象となる
+リクエストの種類を制限できます。最初の引数はリクエストの特性を
+記述する変数、2 番目の引数は変数にマッチする必要がある
+<a href="#regex">正規表現</a>、3 番目のオプション引数はマッチの
+評価方法を変更するフラグのリストです。</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="RewriteCond ディレクティブの構文" /><br />
+      <dfn>図 3:</dfn> RewriteCond ディレクティブの構文
+</p>
+
+<p>例えば、特定の IP 範囲からのすべてのリクエストを別のサーバに
+送信するには、以下を使用できます:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>複数の <directive module="mod_rewrite">RewriteCond</directive> が
+指定された場合、<directive module="mod_rewrite">RewriteRule</directive>
+が適用されるには、すべてがマッチする必要があります。例えば、
+クエリ文字列に "hack" という単語を含むリクエストを拒否するが、
+"go" という単語を含む cookie がある場合は除外するには、以下を使用
+できます:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>感嘆符は否定マッチを指定しており、cookie に "go" が含まれていない
+場合にのみルールが適用されます。</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive> 内の正規表現の
+マッチは、<directive module="mod_rewrite">RewriteRule</directive> の
+<var>Substitution</var> で変数 <code>%1</code>、<code>%2</code> 等を
+使用して使用できます。例えば、以下はサイトへのアクセスに使用された
+ホスト名に応じて、リクエストを異なるディレクトリに振り分けます:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p><code>http://example.com/foo/bar</code> へのリクエストの場合、
+<code>%1</code> は <code>example.com</code> を含み、
+<code>$1</code> は <code>foo/bar</code> を含みます。</p>
+
+
+
+</section>
+
+<section id="rewritemap"><title>書き換えマップ</title>
+
+<p><directive module="mod_rewrite">RewriteMap</directive> ディレクティブは、
+書き換えを行うための外部関数を呼び出す方法を提供します。これについては
+<a href="rewritemap.html">RewriteMap 補足ドキュメント</a>でより詳細に
+説明されています。</p>
+</section>
+
+<section id="htaccess"><title>.htaccess ファイル</title>
+
+<p>書き換えは通常、メインサーバ設定
+(<directive type="section" module="core">Directory</directive>
+セクション外) または
+<directive type="section" module="core">VirtualHost</directive>
+コンテナ内で設定されます。これが書き換えの最も簡単な方法であり、
+推奨されます。ただし、追加の複雑さを伴いますが、
+<directive type="section" module="core">Directory</directive>
+セクションや <a href="../howto/htaccess.html"><code>.htaccess</code>
+ファイル</a>内で書き換えを行うことも可能です。このテクニックは
+ディレクトリ単位の書き換えと呼ばれます。</p>
+
+<p>サーバ単位の書き換えとの主な違いは、<code>.htaccess</code>
+ファイルを含むディレクトリのパスプレフィックスが
+<directive module="mod_rewrite">RewriteRule</directive> でのマッチング前に
+削除されることです。さらに、リクエストが適切にマッピングされるように
+<directive module="mod_rewrite">RewriteBase</directive> を使用する
+必要があります。</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/intro.xml.ko b/docs/manual/rewrite/intro.xml.ko
new file mode 100644 (file)
index 0000000..1cf03e9
--- /dev/null
@@ -0,0 +1,405 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 소개</title>
+
+<summary>
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module> 사용에 필요한 기본 개념을
+설명합니다. 다른 문서에서 더 자세히 다루지만, 이 문서는
+초보자가 시작하는 데 도움이 될 것입니다.
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<!-- <seealso><a href="intro.html">mod_rewrite 소개</a></seealso> -->
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="introduction"><title>소개</title>
+<p>Apache 모듈 <module>mod_rewrite</module>는 URL 조작을
+수행하는 방법을 제공하는 매우 강력하고 정교한 모듈입니다.
+이를 사용하면 필요한 거의 모든 유형의 URL 재작성을 수행할 수
+있습니다. 그러나 다소 복잡하며 초보자에게 위협적일 수
+있습니다. 또한 실제로 무엇을 하는지 이해하지 않고 재작성
+규칙을 마법의 주문처럼 취급하는 경향이 있습니다.</p>
+
+<p>이 문서는 이후의 내용이 단순히 맹목적으로 복사되는 것이
+아니라 이해되도록 충분한 배경 지식을 제공하고자 합니다.
+</p>
+
+<p>많은 일반적인 URL 조작 작업에는
+<module>mod_rewrite</module>의 전체 기능과 복잡성이 필요하지
+않다는 것을 기억하십시오. 간단한 작업에는
+<module>mod_alias</module>와
+<a href="../urlmapping.html">파일 시스템에 URL 매핑</a>
+문서를 참조하십시오.</p>
+
+<p>마지막으로 진행하기 전에 <directive
+module="core">LogLevel</directive> 지시어를 사용하여
+<module>mod_rewrite</module>의 로그 레벨을 trace 레벨 중
+하나로 구성하십시오. 이는 압도적인 양의 정보를 제공할 수
+있지만, <module>mod_rewrite</module> 설정의 문제를
+디버깅하는 데 필수적입니다. 각 규칙이 어떻게 처리되는지
+정확히 알려주기 때문입니다.</p>
+
+</section>
+
+<section id="regex"><title>정규 표현식</title>
+
+<p><module>mod_rewrite</module>는 <a href="http://pcre.org/">Perl
+호환 정규 표현식</a> 어휘를 사용합니다. 이 문서에서는
+정규 표현식에 대한 자세한 참조를 제공하지 않습니다.
+이를 위해 <a href="http://pcre.org/pcre.txt">PCRE 매뉴얼
+페이지</a>, <a href="http://perldoc.perl.org/perlre.html">Perl
+정규 표현식 매뉴얼 페이지</a> 및
+<a href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Jeffrey
+Friedl의 Mastering Regular Expressions</a>(3판은 2006년에
+출판되었지만 정규 표현식 구문은 본질적으로 변경되지 않았으며
+이 주제에 대한 결정적인 참고 자료로 남아 있습니다)를
+권장합니다.</p>
+
+<p>이 문서에서는 <directive
+module="mod_rewrite">RewriteRule</directive>이 마법의 주문이
+아닌 과학적 공식이 되도록 압도적이지 않은 수준에서 시작하기에
+충분한 정규 표현식 어휘를 제공하고자 합니다.</p>
+
+<section id="regexvocab"><title>정규 표현식 어휘</title>
+
+<p>다음은 정규 표현식과 <directive
+module="mod_rewrite">RewriteRule</directive>을 작성하기 위해
+필요한 최소한의 구성 요소입니다. 이것들이 완전한 정규 표현식
+어휘를 나타내지는 않지만 시작하기에 좋은 출발점이며, 기본적인
+정규 표현식을 읽고 자신만의 것을 작성하는 데 도움이 될
+것입니다.</p>
+
+<table>
+<tr>
+<th>문자</th>
+<th>의미</th>
+<th>예제</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>임의의 단일 문자와 일치</td>
+    <td><code>c.t</code>는 <code>cat</code>, <code>cot</code>,
+      <code>cut</code> 등과 일치</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>이전 일치를 한 번 이상 반복</td>
+    <td><code>a+</code>는 <code>a</code>, <code>aa</code>,
+      <code>aaa</code> 등과 일치</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>이전 일치를 0번 이상 반복</td>
+    <td><code>a*</code>는 <code>a+</code>가 일치하는 모든 것과
+      일치하지만 빈 문자열과도 일치</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>일치를 선택적으로 만듦</td>
+    <td><code>colou?r</code>는 <code>color</code>와
+    <code>colour</code>에 일치</td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>다음 문자를 이스케이프</td>
+    <td><code>\.</code>는 위에서 설명한 <em>임의의 단일 문자</em>가
+    아닌 <code>.</code>(점)과 일치</td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>앵커라고 하며, 문자열의 시작과 일치</td>
+    <td><code>^a</code>는 <code>a</code>로 시작하는 문자열과 일치</td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>다른 앵커, 문자열의 끝과 일치</td>
+    <td><code>a$</code>는 <code>a</code>로 끝나는 문자열과 일치</td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>여러 문자를 단일 단위로 그룹화하고 역참조에서
+      사용할 일치를 캡처</td>
+    <td><code>(ab)+</code>는 <code>ababab</code>과 일치 -
+      즉, <code>+</code>가 그룹에 적용됨.
+      역참조에 대한 자세한 내용은 <a href="#InternalBackRefs">아래</a>를
+      참조</td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>문자 클래스 - 문자 중 하나와 일치</td>
+    <td><code>c[uoa]t</code>는 <code>cut</code>, <code>cot</code> 또는
+      <code>cat</code>과 일치</td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>부정 문자 클래스 - 지정되지 않은 모든 문자와 일치</td>
+    <td><code>c[^/]t</code>는 <code>cat</code> 또는 <code>c=t</code>와
+      일치하지만 <code>c/t</code>와는 일치하지 않음</td></tr>
+</table>
+
+<p><module>mod_rewrite</module>에서 <code>!</code> 문자는
+정규 표현식 앞에 사용하여 부정할 수 있습니다. 즉, 문자열이
+나머지 표현식과 일치하지 않는 경우에만 일치한 것으로
+간주됩니다.</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>정규 표현식 역참조 사용 가능성</title>
+
+      <p>여기서 기억해야 할 중요한 점이 있습니다:
+      <em>Pattern</em>이나 <em>CondPattern</em> 중 하나에서
+      괄호를 사용할 때마다 내부적으로 역참조가 생성되며
+      문자열 <code>$N</code>과 <code>%N</code>(아래 참조)으로
+      사용할 수 있습니다. 이것들은
+      <directive module="mod_rewrite">RewriteRule</directive>의
+      <em>Substitution</em> 매개변수 또는
+      <directive module="mod_rewrite">RewriteCond</directive>의
+      <em>TestString</em> 매개변수를 생성하는 데 사용할 수
+      있습니다.</p>
+      <p><directive module="mod_rewrite">RewriteRule</directive>
+      패턴의 캡처는 (직관에 반하여) 모든 선행
+      <directive module="mod_rewrite">RewriteCond</directive>
+      지시어에서 사용할 수 있습니다.
+      <directive module="mod_rewrite">RewriteRule</directive>
+      표현식이 개별 조건보다 먼저 평가되기 때문입니다.</p>
+
+      <p>그림 1은 역참조가 확장을 위해 전달되는 위치와
+      RewriteRule, RewriteCond 매칭의 흐름을 보여줍니다.
+      다음 장에서 이러한 역참조를 사용하는 방법을 탐구할
+      것이므로, 처음에 다소 생소하게 느껴져도 걱정하지
+      마십시오.
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="RewriteRule과 RewriteCond 매칭의 흐름" /><br />
+      <dfn>그림 1:</dfn> 규칙을 통한 역참조 흐름.<br />
+      이 예제에서 <code>/test/1234</code>에 대한 요청은 <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code>으로 변환됩니다.
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>RewriteRule 기본</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>은
+공백으로 구분된 세 개의 인수로 구성됩니다. 인수는 다음과
+같습니다:</p>
+<ol>
+<li><var>Pattern</var>: 규칙의 영향을 받는 들어오는 URL;</li>
+<li><var>Substitution</var>: 일치하는 요청이 전송되어야 할 곳;</li>
+<li><var>[flags]</var>: 재작성된 요청에 영향을 미치는 옵션.</li>
+</ol>
+
+<p><var>Pattern</var>은 <a href="#regex">정규 표현식</a>입니다.
+처음에는(첫 번째 재작성 규칙이거나 치환이 발생하기 전까지)
+들어오는 요청의 URL 경로(호스트명 뒤부터 쿼리 문자열의
+시작을 나타내는 물음표 앞까지의 부분) 또는 디렉토리별
+컨텍스트에서는 규칙이 정의된 디렉토리에 상대적인 요청
+경로와 비교됩니다. 치환이 발생하면 이후의 규칙은 치환된
+값과 비교됩니다.
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="RewriteRule 지시어의 구문" /><br />
+      <dfn>그림 2:</dfn> RewriteRule 지시어의 구문.
+</p>
+
+
+<p><var>Substitution</var>은 자체적으로 다음 세 가지 중
+하나일 수 있습니다:</p>
+
+<dl>
+<dt>1. 자원에 대한 전체 파일 시스템 경로</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>이것은 <directive module="mod_alias">Alias</directive>
+지시어와 마찬가지로 요청을 파일 시스템의 임의의 위치에
+매핑합니다.</p>
+</dd>
+
+<dt>2. 자원에 대한 웹 경로</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p><directive module="core">DocumentRoot</directive>가
+<code>/usr/local/apache2/htdocs</code>로 설정된 경우 이
+지시어는 <code>http://example.com/games</code>에 대한 요청을
+<code>/usr/local/apache2/htdocs/puzzles.html</code> 경로로
+매핑합니다.</p>
+
+</dd>
+
+<dt>3. 절대 URL</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>이것은 클라이언트에게 지정된 URL에 대한 새 요청을 하도록
+지시합니다.</p>
+</dd>
+</dl>
+
+<note type="warning"><strong>1</strong>과 <strong>2</strong>는 정확히 동일한 구문을 가집니다. 차이점은 <strong>1</strong>의 경우 대상 경로의 최상위 수준(즉, <code>/usr/</code>)이 파일 시스템에 존재하는 반면, <strong>2</strong>의 경우 존재하지 않는다는 것입니다. (즉, 파일 시스템에 <code>/bar/</code>라는 루트 수준 디렉토리가 없습니다.)</note>
+
+<p><var>Substitution</var>은 <var>Pattern</var>에 의해
+일치된 들어오는 URL 경로의 부분에 대한
+<em>역참조</em>를 포함할 수도 있습니다. 다음을
+고려하십시오:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p>변수 <code>$1</code>은 <var>Pattern</var>의 괄호 안의
+표현식에 의해 일치된 텍스트로 대체됩니다. 예를 들어,
+<code>http://example.com/product/r14df/view</code>에 대한
+요청은 <code>/var/web/productdb/r14df</code> 경로에
+매핑됩니다.</p>
+
+<p>괄호 안의 표현식이 둘 이상인 경우 변수
+<code>$1</code>, <code>$2</code>, <code>$3</code> 등의
+순서로 사용할 수 있습니다.</p>
+
+
+</section>
+
+<section id="flags"><title>재작성 플래그</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>의
+동작은 규칙 끝에 하나 이상의 플래그를 적용하여 수정할 수
+있습니다. 예를 들어, 규칙의 매칭 동작을 <code>[NC]</code>
+플래그를 적용하여 대소문자를 구분하지 않도록 만들 수
+있습니다:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>사용 가능한 플래그, 그 의미 및 예제에 대한 자세한
+내용은 <a href="flags.html">재작성 플래그</a> 문서를
+참조하십시오.</p>
+
+</section>
+
+
+<section id="rewritecond"><title>재작성 조건</title>
+<p>하나 이상의 <directive module="mod_rewrite">RewriteCond</directive>
+지시어를 사용하여 다음
+<directive module="mod_rewrite">RewriteRule</directive>의 대상이
+되는 요청 유형을 제한할 수 있습니다. 첫 번째 인수는 요청의
+특성을 설명하는 변수이고, 두 번째 인수는 변수와 일치해야 하는
+<a href="#regex">정규 표현식</a>이며, 세 번째 선택적 인수는
+일치 평가 방식을 수정하는 플래그 목록입니다.</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="RewriteCond 지시어의 구문" /><br />
+      <dfn>그림 3:</dfn> RewriteCond 지시어의 구문
+</p>
+
+<p>예를 들어, 특정 IP 범위의 모든 요청을 다른 서버로
+보내려면 다음을 사용할 수 있습니다:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>둘 이상의 <directive module="mod_rewrite">RewriteCond</directive>가
+지정된 경우 <directive module="mod_rewrite">RewriteRule</directive>이
+적용되려면 모든 조건이 일치해야 합니다. 예를 들어, 쿼리
+문자열에 "hack"이라는 단어가 포함된 요청을 거부하되, "go"라는
+단어가 포함된 쿠키가 있는 경우는 제외하려면 다음을 사용할 수
+있습니다:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>느낌표는 부정 일치를 지정하므로, 쿠키에 "go"가 포함되지
+않은 경우에만 규칙이 적용됩니다.</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive>에
+포함된 정규 표현식의 일치는 변수 <code>%1</code>,
+<code>%2</code> 등을 사용하여
+<directive module="mod_rewrite">RewriteRule</directive>의
+<var>Substitution</var>의 일부로 사용할 수 있습니다.
+예를 들어, 사이트에 접근하는 데 사용된 호스트명에 따라
+요청을 다른 디렉토리로 보내는 다음과 같습니다:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p><code>http://example.com/foo/bar</code>에 대한 요청이면
+<code>%1</code>은 <code>example.com</code>을 포함하고
+<code>$1</code>은 <code>foo/bar</code>를 포함합니다.</p>
+
+
+
+</section>
+
+<section id="rewritemap"><title>재작성 맵</title>
+
+<p><directive module="mod_rewrite">RewriteMap</directive> 지시어는
+재작성을 수행할 외부 함수를 호출하는 방법을 제공합니다.
+이에 대한 자세한 내용은 <a href="rewritemap.html">RewriteMap
+보충 문서</a>에서 논의됩니다.</p>
+</section>
+
+<section id="htaccess"><title>.htaccess 파일</title>
+
+<p>재작성은 일반적으로 주 서버 설정(
+<directive type="section" module="core">Directory</directive>
+섹션 외부)에서 또는
+<directive type="section" module="core">VirtualHost</directive>
+컨테이너 내에서 구성됩니다. 이것이 재작성을 수행하는 가장
+쉬운 방법이며 권장됩니다. 그러나 약간의 추가 복잡성을
+감수하면
+<directive type="section" module="core">Directory</directive>
+섹션이나 <a href="../howto/htaccess.html"><code>.htaccess</code>
+파일</a>에서도 재작성을 수행할 수 있습니다. 이 기술을
+디렉토리별 재작성이라고 합니다.</p>
+
+<p>서버별 재작성과의 주요 차이점은 <code>.htaccess</code>
+파일이 포함된 디렉토리의 경로 접두사가
+<directive module="mod_rewrite">RewriteRule</directive>에서
+매칭하기 전에 제거된다는 것입니다. 또한
+<directive module="mod_rewrite">RewriteBase</directive>를
+사용하여 요청이 올바르게 매핑되도록 해야 합니다.</p>
+
+</section>
+
+</manualpage>
index ce245b2841ca052c89d1608a46eb15c79f469bd8..7a94bb187776a2c7303db5dbc2cb475f0075be54 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant outdated="yes">fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/intro.xml.tr b/docs/manual/rewrite/intro.xml.tr
new file mode 100644 (file)
index 0000000..36e1ebc
--- /dev/null
@@ -0,0 +1,406 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite'a Giriş</title>
+
+<summary>
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+<module>mod_rewrite</module> kullanımı için gerekli temel kavramları
+açıklar. Diğer belgeler daha ayrıntılıdır, ancak bu belge
+başlangıç yapmak isteyenlere yardımcı olmalıdır.
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<!-- <seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso> -->
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="introduction"><title>Giriş</title>
+<p>Apache modülü <module>mod_rewrite</module>, URL değiştirmeleri
+yapmanın bir yolunu sunan çok güçlü ve karmaşık bir modüldür. Bununla
+ihtiyaç duyabileceğiniz neredeyse her türlü URL yeniden yazma işlemini
+gerçekleştirebilirsiniz. Ancak biraz karmaşıktır ve yeni başlayanlar
+için korkutucu olabilir. Yeniden yazma kurallarını, gerçekte ne
+yaptıklarını anlamadan sihirli formüller olarak ele alma eğilimi de
+vardır.</p>
+
+<p>Bu belge, takip eden içeriğin körü körüne kopyalanmak yerine
+anlaşılması için yeterli arka plan bilgisi sağlamaya çalışmaktadır.
+</p>
+
+<p>Birçok yaygın URL değiştirme görevinin <module>mod_rewrite</module>
+modülünün tüm gücünü ve karmaşıklığını gerektirmediğini unutmayın.
+Basit görevler için <module>mod_alias</module> modülüne ve <a
+href="../urlmapping.html">URL'lerin dosya sistemine
+eşlenmesi</a> belgelerine bakın.</p>
+
+<p>Son olarak, devam etmeden önce <module>mod_rewrite</module>
+modülünün günlük seviyesini <directive module="core">LogLevel</directive>
+yönergesini kullanarak izleme seviyelerinden birine yapılandırmayı
+unutmayın. Bu, bunaltıcı miktarda bilgi sağlasa da,
+<module>mod_rewrite</module> yapılandırma sorunlarını ayıklamada
+vazgeçilmezdir; çünkü her kuralın nasıl işlendiğini tam olarak
+gösterir.</p>
+
+</section>
+
+<section id="regex"><title>Düzenli İfadeler</title>
+
+<p><module>mod_rewrite</module>, <a href="http://pcre.org/">Perl
+Uyumlu Düzenli İfade</a> sözvarlığını kullanır. Bu belgede, düzenli
+ifadelere ayrıntılı bir başvuru sağlamaya çalışmıyoruz. Bunun için
+<a href="http://pcre.org/pcre.txt">PCRE kılavuz sayfalarını</a>,
+<a href="http://perldoc.perl.org/perlre.html">Perl düzenli ifade
+kılavuz sayfasını</a> ve <a
+href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Jeffrey
+Friedl'ın Mastering Regular Expressions kitabını</a> (üçüncü baskısı
+2006'dandır, ancak düzenli ifade sözdizimi temelde değişmemiştir ve
+bu konu hakkında kesin başvuru kaynağı olmaya devam etmektedir)
+öneririz.</p>
+
+<p>Bu belgede, bunaltıcı olmadan başlamanıza yetecek kadar düzenli
+ifade sözvarlığı sağlamaya çalışıyoruz; böylece <directive
+module="mod_rewrite">RewriteRule</directive> kuralları sihirli
+formüller yerine bilimsel formüller olacaktır.</p>
+
+<section id="regexvocab"><title>Düzenli ifade sözvarlığı</title>
+
+<p>Düzenli ifadeler ve <directive
+module="mod_rewrite">RewriteRule</directive> kuralları yazmak için
+ihtiyaç duyacağınız asgari yapı taşları aşağıdadır. Bunlar kesinlikle
+tam bir düzenli ifade sözvarlığını temsil etmez, ancak başlamak ve
+temel düzenli ifadeleri okumak için iyi bir yerdir.</p>
+
+<table>
+<tr>
+<th>Karakter</th>
+<th>Anlam</th>
+<th>Örnek</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>Herhangi bir tek karakterle eşleşir</td>
+    <td><code>c.t</code>; <code>cat</code>, <code>cot</code>,
+      <code>cut</code> vb. ile eşleşir</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>Önceki eşleşmeyi bir veya daha fazla kez tekrarlar</td>
+    <td><code>a+</code>; <code>a</code>, <code>aa</code>,
+      <code>aaa</code> vb. ile eşleşir</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>Önceki eşleşmeyi sıfır veya daha fazla kez tekrarlar</td>
+    <td><code>a*</code>; <code>a+</code> ile aynı şeylerle eşleşir
+      ancak ayrıca boş dizgeyle de eşleşir</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>Eşleşmeyi isteğe bağlı yapar</td>
+    <td><code>colou?r</code>; <code>color</code> ve
+    <code>colour</code> ile eşleşir</td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>Sonraki karakteri kodlar</td>
+    <td><code>\.</code>; yukarıda açıklandığı gibi <em>herhangi bir tek
+    karakter</em> yerine <code>.</code> (nokta) ile eşleşir</td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>Çapa olarak adlandırılır, dizgenin başlangıcıyla eşleşir</td>
+    <td><code>^a</code>; <code>a</code> ile başlayan bir dizgeyle
+    eşleşir</td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>Diğer çapa, dizgenin sonuyla eşleşir</td>
+    <td><code>a$</code>; <code>a</code> ile biten bir dizgeyle
+    eşleşir</td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>Birkaç karakteri tek bir birime gruplar ve geri başvuruda
+      kullanılmak üzere bir eşleşme yakalar</td>
+    <td><code>(ab)+</code>; <code>ababab</code> ile eşleşir - yani
+      <code>+</code> gruba uygulanır. Geri başvurular hakkında daha
+      fazla bilgi için <a href="#InternalBackRefs">aşağıya</a>
+      bakın</td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>Bir karakter sınıfı - karakterlerden biriyle eşleşir</td>
+    <td><code>c[uoa]t</code>; <code>cut</code>, <code>cot</code> veya
+      <code>cat</code> ile eşleşir</td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>Olumsuz karakter sınıfı - belirtilmeyen herhangi bir
+      karakterle eşleşir</td>
+    <td><code>c[^/]t</code>; <code>cat</code> veya <code>c=t</code>
+      ile eşleşir ancak <code>c/t</code> ile eşleşmez</td></tr>
+</table>
+
+<p><module>mod_rewrite</module> modülünde <code>!</code> karakteri
+düzenli ifadeyi olumsuzlamak için kullanılabilir. Yani, bir dizge
+yalnızca ifadenin geri kalanıyla eşleşmezse eşleşmiş sayılır.</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>Düzenli İfade Geri Başvuru
+Kullanılabilirliği</title>
+
+      <p>Burada hatırlanması gereken önemli bir şey vardır:
+      <em>Kalıp</em>'ta veya <em>CondPattern</em>'lerden birinde
+      parantez kullandığınızda, <code>$N</code> ve <code>%N</code>
+      dizgeleriyle kullanılabilecek dahili geri başvurular oluşturulur
+      (aşağıya bakın). Bunlar, bir
+      <directive module="mod_rewrite">RewriteRule</directive>
+      yönergesinin <em>Değiştirme</em> parametresini veya bir
+      <directive module="mod_rewrite">RewriteCond</directive>
+      yönergesinin <em>SınamaDizgesi</em> parametresini oluşturmak
+      için kullanılabilir.</p>
+      <p><directive module="mod_rewrite">RewriteRule</directive>
+      kalıplarındaki yakalamalar (sezgiye aykırı olarak) kendinden
+      önceki tüm <directive module="mod_rewrite">RewriteCond</directive>
+      yönergelerinde kullanılabilir; çünkü <directive
+      module="mod_rewrite">RewriteRule</directive> ifadesi bireysel
+      koşullardan önce değerlendirilir.</p>
+
+      <p>Şekil 1, geri başvuruların genişletilmek üzere hangi
+      konumlara aktarıldığını ve RewriteRule, RewriteCond eşleştirme
+      akışını gösterir. Sonraki bölümlerde bu geri başvuruların nasıl
+      kullanılacağını inceleyeceğiz; bu nedenle ilk başta biraz yabancı
+      görünürse endişelenmeyin.
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="RewriteRule ve RewriteCond eşleştirme akışı" /><br />
+      <dfn>Şekil 1:</dfn> Bir kural boyunca geri başvuru akışı.<br />
+      Bu örnekte, <code>/test/1234</code> için bir istek <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code> olarak dönüştürülecektir.
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>RewriteRule Temelleri</title>
+<p>Bir <directive module="mod_rewrite">RewriteRule</directive>,
+boşluklarla ayrılmış üç argümandan oluşur. Argümanlar şunlardır:</p>
+<ol>
+<li><var>Kalıp</var>: hangi gelen URL'lerin kuraldan etkileneceği;</li>
+<li><var>Değiştirme</var>: eşleşen isteklerin nereye gönderileceği;</li>
+<li><var>[bayraklar]</var>: yeniden yazılmış isteği etkileyen
+seçenekler.</li>
+</ol>
+
+<p><var>Kalıp</var> bir <a href="#regex">düzenli ifadedir</a>.
+İlk başta (ilk yeniden yazma kuralı için veya bir değiştirme
+gerçekleşene kadar) gelen isteğin URL yoluyla (konak adından sonra
+ancak sorgu dizgesinin başlangıcını gösteren soru işaretinden önceki
+kısım) veya dizin başına bağlamda kuralın tanımlandığı dizine göre
+isteğin yoluyla eşleştirilir. Bir değiştirme gerçekleştikten sonra
+izleyen kurallar değiştirilen değerle eşleştirilir.
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="RewriteRule yönergesinin sözdizimi" /><br />
+      <dfn>Şekil 2:</dfn> RewriteRule yönergesinin sözdizimi.
+</p>
+
+
+<p><var>Değiştirme</var> kendisi üç şeyden biri olabilir:</p>
+
+<dl>
+<dt>1. Bir kaynağa tam dosya sistemi yolu</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>Bu, <directive module="mod_alias">Alias</directive> yönergesine
+benzer şekilde bir isteği dosya sistemindeki keyfi bir konuma
+eşler.</p>
+</dd>
+
+<dt>2. Bir kaynağa web yolu</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p><directive module="core">DocumentRoot</directive>
+<code>/usr/local/apache2/htdocs</code> olarak ayarlanmışsa, bu
+yönerge <code>http://example.com/games</code> isteklerini
+<code>/usr/local/apache2/htdocs/puzzles.html</code> yoluna
+eşler.</p>
+
+</dd>
+
+<dt>3. Mutlak bir URL</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>Bu, istemciye belirtilen URL için yeni bir istek yapmasını
+söyler.</p>
+</dd>
+</dl>
+
+<note type="warning"><strong>1</strong> ve <strong>2</strong>'nin sözdiziminin tamamen aynı olduğunu unutmayın. Aralarındaki fark, <strong>1</strong> durumunda hedef yolun en üst düzeyinin (yani <code>/usr/</code>) dosya sisteminde mevcut olması, <strong>2</strong> durumunda ise mevcut olmamasıdır (yani dosya sisteminde kök düzeyinde bir <code>/bar/</code> dizini yoktur).</note>
+
+<p><var>Değiştirme</var>, <var>Kalıp</var> tarafından eşleşen gelen
+URL yolunun bölümlerine <em>geri başvurular</em> da içerebilir. Şunu
+ele alalım:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p><code>$1</code> değişkeni, <var>Kalıp</var> içindeki parantez
+içindeki ifadeyle eşleşen metinle değiştirilir. Örneğin,
+<code>http://example.com/product/r14df/view</code> isteği
+<code>/var/web/productdb/r14df</code> yoluna eşlenir.</p>
+
+<p>Parantez içinde birden fazla ifade varsa, bunlar sırasıyla
+<code>$1</code>, <code>$2</code>, <code>$3</code> ve sonraki
+değişkenlerde kullanılabilir.</p>
+
+
+</section>
+
+<section id="flags"><title>Yeniden Yazma Bayrakları</title>
+<p>Bir <directive module="mod_rewrite">RewriteRule</directive>
+yönergesinin davranışı, kuralın sonuna bir veya daha fazla bayrak
+uygulanarak değiştirilebilir. Örneğin, bir kuralın eşleştirme
+davranışı <code>[NC]</code> bayrağı uygulanarak büyük/küçük harf
+duyarsız yapılabilir:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>Kullanılabilir bayraklar, anlamları ve örnekleri hakkında daha
+fazla ayrıntı için <a href="flags.html">Yeniden Yazma Bayrakları</a>
+belgesine bakın.</p>
+
+</section>
+
+
+<section id="rewritecond"><title>Yeniden Yazma Koşulları</title>
+<p>Ardından gelen <directive
+module="mod_rewrite">RewriteRule</directive> yönergesine tabi
+olacak istek türlerini kısıtlamak için bir veya daha fazla <directive
+module="mod_rewrite">RewriteCond</directive> yönergesi
+kullanılabilir. İlk argüman isteğin bir özelliğini tanımlayan bir
+değişken, ikinci argüman değişkenle eşleşmesi gereken bir <a
+href="#regex">düzenli ifade</a> ve üçüncü isteğe bağlı argüman
+eşleşmenin nasıl değerlendirileceğini değiştiren bayrakların bir
+listesidir.</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="RewriteCond yönergesinin sözdizimi" /><br />
+      <dfn>Şekil 3:</dfn> RewriteCond yönergesinin sözdizimi
+</p>
+
+<p>Örneğin, belirli bir IP aralığından gelen tüm istekleri farklı
+bir sunucuya göndermek için şunu kullanabilirsiniz:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>Birden fazla <directive module="mod_rewrite">RewriteCond</directive>
+belirtildiğinde, <directive module="mod_rewrite">RewriteRule</directive>
+yönergesinin uygulanması için hepsinin eşleşmesi gerekir. Örneğin,
+sorgu dizgelerinde "hack" sözcüğünü içeren istekleri reddetmek, ancak
+"go" sözcüğünü içeren bir çerez taşıyanları hariç tutmak için şunu
+kullanabilirsiniz:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>Ünlem işaretinin olumsuz bir eşleşme belirttiğine dikkat edin;
+kural yalnızca çerez "go" içermiyorsa uygulanır.</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive>
+yönergelerindeki düzenli ifadelerdeki eşleşmeler, <directive
+module="mod_rewrite">RewriteRule</directive> yönergesindeki
+<var>Değiştirme</var>'nin bir parçası olarak <code>%1</code>,
+<code>%2</code> vb. değişkenler kullanılarak kullanılabilir. Örneğin,
+şu kural siteye erişmek için kullanılan konak adına bağlı olarak
+isteği farklı bir dizine yönlendirecektir:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p>İstek <code>http://example.com/foo/bar</code> için ise
+<code>%1</code> değeri <code>example.com</code> ve <code>$1</code>
+değeri <code>foo/bar</code> olacaktır.</p>
+
+
+
+</section>
+
+<section id="rewritemap"><title>Yeniden yazma eşlemleri</title>
+
+<p><directive module="mod_rewrite">RewriteMap</directive> yönergesi,
+tabir yerindeyse yeniden yazma işleminizi yapacak harici bir işlev
+çağırmanın bir yolunu sunar. Bu, <a
+href="rewritemap.html">RewriteMap ek belgelerinde</a> daha ayrıntılı
+olarak tartışılmaktadır.</p>
+</section>
+
+<section id="htaccess"><title>.htaccess dosyaları</title>
+
+<p>Yeniden yazma genellikle ana sunucu yapılandırma ayarında
+(herhangi bir <directive type="section"
+module="core">Directory</directive> bölümünün dışında) veya
+<directive type="section" module="core">VirtualHost</directive>
+kapsayıcıları içinde yapılandırılır. Bu, yeniden yazma yapmanın en
+kolay yoludur ve önerilir. Ancak yeniden yazmayı <directive
+type="section" module="core">Directory</directive> bölümlerinde veya
+<a href="../howto/htaccess.html"><code>.htaccess</code>
+dosyalarında</a> bazı ek karmaşıklık pahasına yapmak mümkündür. Bu
+tekniğe dizin başına yeniden yazma denir.</p>
+
+<p>Sunucu başına yeniden yazmadan temel fark, <code>.htaccess</code>
+dosyasını içeren dizinin yol önekinin,
+<directive module="mod_rewrite">RewriteRule</directive> yönergesinde
+eşleştirmeden önce çıkarılmasıdır. Ayrıca, isteğin düzgün şekilde
+eşlenmesini sağlamak için <directive
+module="mod_rewrite">RewriteBase</directive> kullanılmalıdır.</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/intro.xml.zh-cn b/docs/manual/rewrite/intro.xml.zh-cn
new file mode 100644 (file)
index 0000000..a584b9e
--- /dev/null
@@ -0,0 +1,372 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933423 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="intro.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 简介</title>
+
+<summary>
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了使用
+<module>mod_rewrite</module> 所需的基本概念。
+其他文档会更详细地介绍,但本文档应该能帮助初学者入门。
+</p>
+</summary>
+
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<!-- <seealso><a href="intro.html">mod_rewrite 简介</a></seealso> -->
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="introduction"><title>介绍</title>
+<p>Apache 模块 <module>mod_rewrite</module> 是一个非常强大且复杂的模块,
+它提供了进行 URL 操作的方法。使用它,你几乎可以完成所有类型的 URL 重写。
+然而,它有一定的复杂性,可能会令初学者望而生畏。
+还有一种倾向是将重写规则视为魔法咒语,在不真正理解其作用的情况下使用它们。</p>
+
+<p>本文档试图提供足够的背景知识,使接下来的内容被理解,
+而不仅仅是盲目复制。
+</p>
+
+<p>请记住,许多常见的 URL 操作任务不需要 <module>mod_rewrite</module>
+的全部功能和复杂性。对于简单任务,请参阅 <module>mod_alias</module>
+和关于<a href="../urlmapping.html">将 URL 映射到文件系统</a>的文档。</p>
+
+<p>最后,在继续之前,请务必使用
+<directive module="core">LogLevel</directive>
+指令将 <module>mod_rewrite</module> 的日志级别配置为 trace 级别之一。
+虽然这可能会产生大量信息,但在调试 <module>mod_rewrite</module>
+配置问题时它是不可或缺的,因为它会告诉你每条规则是如何被处理的。</p>
+
+</section>
+
+<section id="regex"><title>正则表达式</title>
+
+<p><module>mod_rewrite</module> 使用 <a href="http://pcre.org/">Perl
+兼容正则表达式</a>词汇。在本文档中,我们不试图提供正则表达式的详细参考。
+为此,我们推荐 <a href="http://pcre.org/pcre.txt">PCRE 手册页</a>、
+<a href="http://perldoc.perl.org/perlre.html">Perl 正则表达式手册页</a>
+以及 <a
+href="https://www.oreilly.com/library/view/mastering-regular-expressions/0596528124/">Jeffrey
+Friedl 的《精通正则表达式》</a>(第三版出版于 2006 年,
+但正则表达式语法基本没有变化,它仍然是该主题的权威参考)。</p>
+
+<p>在本文档中,我们试图提供足够的正则表达式词汇来帮助你入门,
+而不会让你感到不知所措,希望
+<directive module="mod_rewrite">RewriteRule</directive>
+是科学公式,而不是魔法咒语。</p>
+
+<section id="regexvocab"><title>正则表达式词汇</title>
+
+<p>以下是编写正则表达式和
+<directive module="mod_rewrite">RewriteRule</directive>
+所需的最基本构建块。它们当然不代表完整的正则表达式词汇,
+但它们是一个好的起点,应该能帮助你阅读基本的正则表达式并编写自己的正则表达式。</p>
+
+<table>
+<tr>
+<th>字符</th>
+<th>含义</th>
+<th>示例</th>
+</tr>
+
+<tr>
+    <td><code>.</code></td>
+    <td>匹配任意单个字符</td>
+    <td><code>c.t</code> 将匹配 <code>cat</code>、<code>cot</code>、
+      <code>cut</code> 等</td>
+</tr>
+<tr>
+    <td><code>+</code></td>
+    <td>重复前一个匹配一次或多次</td>
+    <td><code>a+</code> 匹配 <code>a</code>、<code>aa</code>、
+      <code>aaa</code> 等</td>
+</tr>
+<tr>
+    <td><code>*</code></td>
+    <td>重复前一个匹配零次或多次</td>
+    <td><code>a*</code> 匹配 <code>a+</code> 匹配的所有内容,
+      但也会匹配空字符串</td>
+</tr>
+<tr>
+    <td><code>?</code></td>
+    <td>使匹配变为可选</td>
+    <td><code>colou?r</code> 将匹配 <code>color</code> 和
+    <code>colour</code></td>
+</tr>
+<tr>
+    <td><code>\</code></td>
+    <td>转义下一个字符</td>
+    <td><code>\.</code> 将匹配 <code>.</code>(点)而不是如上所述的
+    <em>任意单个字符</em></td>
+</tr>
+<tr>
+    <td><code>^</code></td>
+    <td>称为锚点,匹配字符串的开头</td>
+    <td><code>^a</code> 匹配以 <code>a</code> 开头的字符串</td>
+</tr>
+<tr>
+    <td><code>$</code></td>
+    <td>另一个锚点,匹配字符串的结尾</td>
+    <td><code>a$</code> 匹配以 <code>a</code> 结尾的字符串</td>
+</tr>
+<tr>
+    <td><code>( )</code></td>
+    <td>将多个字符组合为一个单元,并捕获匹配以用于反向引用</td>
+    <td><code>(ab)+</code> 匹配 <code>ababab</code>——即
+      <code>+</code> 应用于整个组。关于反向引用的更多信息见
+      <a href="#InternalBackRefs">下文</a></td>
+</tr>
+<tr>
+    <td><code>[ ]</code></td>
+    <td>字符类——匹配其中一个字符</td>
+    <td><code>c[uoa]t</code> 匹配 <code>cut</code>、<code>cot</code> 或
+      <code>cat</code></td>
+</tr>
+<tr>
+    <td><code>[^ ]</code></td>
+    <td>否定字符类——匹配未指定的任意字符</td>
+    <td><code>c[^/]t</code> 匹配 <code>cat</code> 或 <code>c=t</code>
+      但不匹配 <code>c/t</code></td></tr>
+</table>
+
+<p>在 <module>mod_rewrite</module> 中,<code>!</code>
+字符可以在正则表达式前使用来否定它。也就是说,
+只有当字符串不匹配表达式的其余部分时,才认为匹配成功。</p>
+
+</section>
+
+<section id="InternalBackRefs"><title>正则表达式反向引用的可用性</title>
+
+      <p>这里有一个重要的事情要记住:每当你在<em>模式</em>或某个
+      <em>CondPattern</em> 中使用括号时,都会在内部创建反向引用,
+      可以使用字符串 <code>$N</code> 和 <code>%N</code>(见下文)来引用。
+      这些可用于创建
+      <directive module="mod_rewrite">RewriteRule</directive> 的
+      <em>替换</em>参数或
+      <directive module="mod_rewrite">RewriteCond</directive> 的
+      <em>TestString</em> 参数。</p>
+      <p><directive module="mod_rewrite">RewriteRule</directive>
+      模式中的捕获(看似违反直觉地)可供所有前面的
+      <directive module="mod_rewrite">RewriteCond</directive> 指令使用,
+      因为 <directive module="mod_rewrite">RewriteRule</directive>
+      表达式在各个条件之前就已被求值。</p>
+
+      <p>图 1 显示了反向引用被传递到哪些位置进行展开,
+      并说明了 RewriteRule 和 RewriteCond 匹配的流程。
+      在接下来的章节中,我们将探索如何使用这些反向引用,
+      所以如果你一开始觉得有些陌生,不必担心。
+      </p>
+
+<p class="figure">
+      <img src="../images/rewrite_backreferences.png"
+      alt="RewriteRule 和 RewriteCond 匹配流程" /><br />
+      <dfn>图 1:</dfn>反向引用在规则中的流向。<br />
+      在此示例中,对 <code>/test/1234</code> 的请求将被转换为 <code>/admin.foo?page=test&amp;id=1234&amp;host=admin.example.com</code>。
+</p>
+
+</section>
+</section>
+
+<section id="rewriterule"><title>RewriteRule 基础</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>
+由三个以空格分隔的参数组成。这些参数是:</p>
+<ol>
+<li><var>Pattern</var>:哪些传入的 URL 应受此规则影响;</li>
+<li><var>Substitution</var>:匹配的请求应被发送到哪里;</li>
+<li><var>[flags]</var>:影响重写请求的选项。</li>
+</ol>
+
+<p><var>Pattern</var> 是一个<a href="#regex">正则表达式</a>。
+它最初(对于第一条重写规则或直到发生替换为止)与传入请求的 URL 路径
+(主机名之后但问号之前的部分,问号表示查询字符串的开始)进行匹配,
+或者在目录级上下文中与请求相对于定义规则的目录的路径进行匹配。
+一旦发生替换,后续规则将与替换后的值进行匹配。
+</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewriterule.png"
+      alt="RewriteRule 指令的语法" /><br />
+      <dfn>图 2:</dfn>RewriteRule 指令的语法。
+</p>
+
+
+<p><var>Substitution</var> 本身可以是以下三种之一:</p>
+
+<dl>
+<dt>1. 资源的完整文件系统路径</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games" "/usr/local/games/web/puzzles.html"
+</highlight>
+<p>这将请求映射到文件系统上的任意位置,
+类似于 <directive module="mod_alias">Alias</directive> 指令。</p>
+</dd>
+
+<dt>2. 资源的 Web 路径</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/games$" "/puzzles.html"
+</highlight>
+<p>如果 <directive module="core">DocumentRoot</directive> 设置为
+<code>/usr/local/apache2/htdocs</code>,则此指令会将对
+<code>http://example.com/games</code> 的请求映射到路径
+<code>/usr/local/apache2/htdocs/puzzles.html</code>。</p>
+
+</dd>
+
+<dt>3. 绝对 URL</dt>
+<dd>
+<highlight language="config">
+RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]
+</highlight>
+<p>这告诉客户端对指定 URL 发出新的请求。</p>
+</dd>
+</dl>
+
+<note type="warning">请注意 <strong>1</strong> 和 <strong>2</strong>
+的语法完全相同。它们之间的区别在于,对于 <strong>1</strong>,
+目标路径的顶层(即 <code>/usr/</code>)存在于文件系统上,
+而对于 <strong>2</strong>,它不存在。
+(即文件系统中没有 <code>/bar/</code> 作为根级目录。)</note>
+
+<p><var>Substitution</var> 还可以包含对传入 URL 路径中由
+<var>Pattern</var> 匹配的部分的<em>反向引用</em>。
+请看以下示例:</p>
+<highlight language="config">
+RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"
+</highlight>
+<p>变量 <code>$1</code> 将被替换为 <var>Pattern</var>
+中括号内的表达式所匹配的任何文本。例如,对
+<code>http://example.com/product/r14df/view</code> 的请求将被映射到路径
+<code>/var/web/productdb/r14df</code>。</p>
+
+<p>如果括号中有多个表达式,它们将按顺序出现在变量
+<code>$1</code>、<code>$2</code>、<code>$3</code> 等中。</p>
+
+
+</section>
+
+<section id="flags"><title>重写标志</title>
+<p><directive module="mod_rewrite">RewriteRule</directive>
+的行为可以通过在规则末尾应用一个或多个标志来修改。
+例如,可以通过应用 <code>[NC]</code>
+标志使规则的匹配行为不区分大小写:
+</p>
+<highlight language="config">
+RewriteRule "^puppy.html" "smalldog.html" [NC]
+</highlight>
+
+<p>有关可用标志、其含义和示例的更多详细信息,
+请参阅<a href="flags.html">重写标志</a>文档。</p>
+
+</section>
+
+
+<section id="rewritecond"><title>重写条件</title>
+<p>一个或多个 <directive module="mod_rewrite">RewriteCond</directive>
+指令可用于限制将受后续
+<directive module="mod_rewrite">RewriteRule</directive> 影响的请求类型。
+第一个参数是描述请求特征的变量,
+第二个参数是必须匹配该变量的<a href="#regex">正则表达式</a>,
+第三个可选参数是修改匹配评估方式的标志列表。</p>
+
+<p class="figure">
+      <img src="../images/syntax_rewritecond.png"
+      alt="RewriteCond 指令的语法" /><br />
+      <dfn>图 3:</dfn>RewriteCond 指令的语法
+</p>
+
+<p>例如,要将来自特定 IP 范围的所有请求发送到不同的服务器,
+你可以使用:</p>
+<highlight language="config">
+RewriteCond "%{REMOTE_ADDR}" "^10\.2\."
+RewriteRule "(.*)"           "http://intranet.example.com$1"
+</highlight>
+
+<p>当指定了多个 <directive module="mod_rewrite">RewriteCond</directive> 时,
+它们必须全部匹配才能应用
+<directive module="mod_rewrite">RewriteRule</directive>。
+例如,要拒绝查询字符串中包含"hack"一词的请求,
+除非它们还包含含有"go"一词的 cookie,你可以使用:</p>
+<highlight language="config">
+RewriteCond "%{QUERY_STRING}" "hack"
+RewriteCond "%{HTTP_COOKIE}"  !go
+RewriteRule "."               "-"   [F]
+</highlight>
+<p>请注意,感叹号指定否定匹配,
+因此只有当 cookie 不包含"go"时才应用该规则。</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive>
+中正则表达式的匹配结果可以作为
+<directive module="mod_rewrite">RewriteRule</directive> 中
+<var>Substitution</var> 的一部分,使用变量 <code>%1</code>、
+<code>%2</code> 等。例如,这将根据用于访问站点的主机名
+将请求定向到不同的目录:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "(.*)"
+RewriteRule "^/(.*)"       "/sites/%1/$1"
+</highlight>
+<p>如果请求是 <code>http://example.com/foo/bar</code>,
+则 <code>%1</code> 将包含 <code>example.com</code>,
+<code>$1</code> 将包含 <code>foo/bar</code>。</p>
+
+
+
+</section>
+
+<section id="rewritemap"><title>重写映射</title>
+
+<p><directive module="mod_rewrite">RewriteMap</directive>
+指令提供了一种调用外部函数来为你执行重写的方法。
+这在 <a href="rewritemap.html">RewriteMap 补充文档</a>中有更详细的讨论。</p>
+</section>
+
+<section id="htaccess"><title>.htaccess 文件</title>
+
+<p>重写通常在主服务器配置中(在任何
+<directive type="section" module="core">Directory</directive>
+配置段之外)或在
+<directive type="section" module="core">VirtualHost</directive>
+容器中配置。这是执行重写的最简单方式,也是推荐的方式。
+但是,也可以在
+<directive type="section" module="core">Directory</directive>
+配置段或 <a href="../howto/htaccess.html"><code>.htaccess</code>
+文件</a>中执行重写,但会增加一些额外的复杂性。
+这种技术称为目录级重写。</p>
+
+<p>与服务器级重写的主要区别在于,
+包含 <code>.htaccess</code> 文件的目录路径前缀在
+<directive module="mod_rewrite">RewriteRule</directive>
+中匹配之前会被去除。此外,应使用
+<directive module="mod_rewrite">RewriteBase</directive>
+来确保请求被正确映射。</p>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/proxy.xml.de b/docs/manual/rewrite/proxy.xml.de
new file mode 100644 (file)
index 0000000..5dedb4c
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Verwendung von mod_rewrite für Proxying</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt,
+wie man das [P]-Flag der RewriteRule verwendet, um Inhalte an einen anderen
+Server weiterzuleiten. Es werden verschiedene Rezepte bereitgestellt, die
+gängige Szenarien beschreiben.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<!--<seealso><a href="proxy.html">Proxying</a></seealso>-->
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>Proxying von Inhalten mit mod_rewrite</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module> bietet das [P]-Flag, mit dem URLs über
+    <module>mod_proxy</module> an einen anderen Server weitergeleitet werden
+    können. Hier werden zwei Beispiele gegeben. In einem Beispiel wird eine
+    URL direkt an einen anderen Server weitergeleitet und so ausgeliefert,
+    als wäre sie eine lokale URL. Im anderen Beispiel leiten wir fehlende
+    Inhalte an einen Backend-Server weiter.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Um eine URL einfach einem anderen Server zuzuordnen, verwenden
+      wir das [P]-Flag wie folgt:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>Im zweiten Beispiel leiten wir die Anfrage nur weiter, wenn wir
+   die Ressource nicht lokal finden können. Dies kann sehr nützlich sein,
+   wenn Sie von einem Server zu einem anderen migrieren und sich nicht
+   sicher sind, ob alle Inhalte bereits migriert wurden.</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>Diskussion:</dt>
+
+    <dd><p>In jedem Fall fügen wir eine <directive
+    module="mod_proxy">ProxyPassReverse</directive>-Direktive hinzu, um
+    sicherzustellen, dass alle vom Backend ausgegebenen Umleitungen
+    korrekt an den Client weitergeleitet werden.</p>
+
+    <p>Erwägen Sie, wann immer möglich, <directive
+    module="mod_proxy">ProxyPass</directive> oder <directive
+    module="mod_proxy">ProxyPassMatch</directive> anstelle von
+    <module>mod_rewrite</module> zu verwenden.</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/proxy.xml.es b/docs/manual/rewrite/proxy.xml.es
new file mode 100644 (file)
index 0000000..c11807f
--- /dev/null
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Uso de mod_rewrite para Proxy</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+cómo usar la bandera [P] de RewriteRule para hacer proxy de contenido a otro servidor.
+Se proporcionan varias recetas que describen escenarios comunes.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<!--<seealso><a href="proxy.html">Proxy</a></seealso>-->
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>Hacer proxy de contenido con mod_rewrite</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module> proporciona la bandera [P], que permite pasar URLs,
+    a través de <module>mod_proxy</module>, a otro servidor. Aquí se dan dos ejemplos. En
+    un ejemplo, una URL se pasa directamente a otro servidor, y se sirve
+    como si fuera una URL local. En el otro ejemplo, hacemos proxy del
+    contenido faltante a un servidor backend.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Para simplemente mapear una URL a otro servidor, usamos la bandera [P], de la
+      siguiente manera:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>En el segundo ejemplo, hacemos proxy de la solicitud solo si no podemos encontrar
+   el recurso localmente. Esto puede ser muy útil cuando está migrando
+   de un servidor a otro, y no está seguro de si todo el contenido
+   ha sido migrado todavía.</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>Discusión:</dt>
+
+    <dd><p>En cada caso, añadimos una directiva <directive
+    module="mod_proxy">ProxyPassReverse</directive> para asegurar
+    que cualquier redirección emitida por el backend se pase correctamente al
+    cliente.</p>
+
+    <p>Considere usar <directive
+    module="mod_proxy">ProxyPass</directive> o <directive
+    module="mod_proxy">ProxyPassMatch</directive> siempre que sea posible en
+    preferencia a <module>mod_rewrite</module>.</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/proxy.xml.ja b/docs/manual/rewrite/proxy.xml.ja
new file mode 100644 (file)
index 0000000..94f6ab9
--- /dev/null
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite によるプロキシ</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+RewriteRule の [P] フラグを使用して他のサーバにコンテンツをプロキシする方法を
+説明します。一般的なシナリオを説明するレシピがいくつか提供されています。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<!--<seealso><a href="proxy.html">プロキシ</a></seealso>-->
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>mod_rewrite によるコンテンツのプロキシ</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module> は [P] フラグを提供しており、URL を
+    <module>mod_proxy</module> 経由で他のサーバに渡すことができます。ここでは
+    2 つの例を示します。1 つ目の例では、URL を直接別のサーバに渡し、
+    ローカル URL であるかのように提供します。もう 1 つの例では、
+    見つからないコンテンツをバックエンドサーバにプロキシします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>単純に URL を別のサーバにマッピングするには、次のように
+      [P] フラグを使用します:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>2 つ目の例では、リソースがローカルに見つからない場合にのみ
+   リクエストをプロキシします。これは、あるサーバから別のサーバに
+   移行中で、すべてのコンテンツが移行済みかどうかわからない場合に
+   非常に便利です。</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>議論:</dt>
+
+    <dd><p>どちらの場合も、バックエンドから発行されるリダイレクトが
+    正しくクライアントに渡されるように <directive
+    module="mod_proxy">ProxyPassReverse</directive> ディレクティブを
+    追加しています。</p>
+
+    <p>可能な限り <module>mod_rewrite</module> よりも <directive
+    module="mod_proxy">ProxyPass</directive> や <directive
+    module="mod_proxy">ProxyPassMatch</directive> の使用を検討してください。</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/proxy.xml.ko b/docs/manual/rewrite/proxy.xml.ko
new file mode 100644 (file)
index 0000000..05ddd83
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>프록시를 위한 mod_rewrite 사용</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+RewriteRule의 [P] 플래그를 사용하여 다른 서버로 콘텐츠를
+프록시하는 방법을 설명합니다. 일반적인 시나리오를 설명하는
+여러 레시피가 제공됩니다.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<!--<seealso><a href="proxy.html">프록시</a></seealso>-->
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>mod_rewrite를 사용한 콘텐츠 프록시</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module>는 [P] 플래그를 제공하여
+    <module>mod_proxy</module>를 통해 URL을 다른 서버로
+    전달할 수 있게 합니다. 여기에 두 가지 예제가 있습니다.
+    한 예제에서는 URL이 다른 서버로 직접 전달되어 로컬
+    URL인 것처럼 제공됩니다. 다른 예제에서는 누락된
+    콘텐츠를 백엔드 서버로 프록시합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>URL을 다른 서버에 단순히 매핑하려면 다음과 같이
+      [P] 플래그를 사용합니다:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>두 번째 예제에서는 로컬에서 자원을 찾을 수 없는
+   경우에만 요청을 프록시합니다. 이것은 한 서버에서 다른
+   서버로 마이그레이션하고 있으며 모든 콘텐츠가 아직
+   마이그레이션되었는지 확신할 수 없을 때 매우 유용합니다.</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>토론:</dt>
+
+    <dd><p>각 경우에 백엔드에서 발행한 리다이렉트가 클라이언트에
+    올바르게 전달되도록 <directive
+    module="mod_proxy">ProxyPassReverse</directive> 지시어를
+    추가합니다.</p>
+
+    <p><module>mod_rewrite</module> 대신 가능하면
+    <directive module="mod_proxy">ProxyPass</directive> 또는
+    <directive module="mod_proxy">ProxyPassMatch</directive>를
+    사용하는 것을 고려하십시오.</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
index 07ad4e7e07a492796a652e274a6eda81347ca288..9fbb14b7812cfc09e8b500b8873dc5266f8712d0 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/proxy.xml.tr b/docs/manual/rewrite/proxy.xml.tr
new file mode 100644 (file)
index 0000000..2e68ebd
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Vekil Kullanımı için mod_rewrite</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+İçeriği başka bir sunucuya vekil olarak iletmek için RewriteRule'un [P]
+bayrağının nasıl kullanılacağını açıklar. Yaygın senaryoları anlatan
+birkaç tarif sunulmuştur.</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<!--<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>-->
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>mod_rewrite ile İçerik Vekilleme</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module>, URL'lerin <module>mod_proxy</module>
+    aracılığıyla başka bir sunucuya iletilmesini sağlayan [P] bayrağını
+    sunar. Burada iki örnek verilmiştir. Birinde, bir URL doğrudan başka
+    bir sunucuya iletilir ve yerel bir URL gibi sunulur. Diğerinde,
+    eksik içeriği bir arka uç sunucusuna vekil olarak iletiriz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Bir URL'yi başka bir sunucuya basitçe eşlemek için [P]
+      bayrağını şu şekilde kullanırız:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>İkinci örnekte, isteği yalnızca kaynağı yerel olarak
+   bulamadığımızda vekil olarak iletiriz. Bu, bir sunucudan diğerine
+   geçiş yaparken ve tüm içeriğin taşınıp taşınmadığından emin
+   olmadığınızda çok yararlı olabilir.</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>Tartışma:</dt>
+
+    <dd><p>Her iki durumda da, arka uç tarafından verilen
+    yönlendirmelerin istemciye doğru şekilde iletilmesini sağlamak
+    için bir <directive module="mod_proxy">ProxyPassReverse</directive>
+    yönergesi ekliyoruz.</p>
+
+    <p>Mümkün olduğunda <module>mod_rewrite</module> yerine <directive
+    module="mod_proxy">ProxyPass</directive> veya <directive
+    module="mod_proxy">ProxyPassMatch</directive> kullanmayı
+    değerlendirin.</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/proxy.xml.zh-cn b/docs/manual/rewrite/proxy.xml.zh-cn
new file mode 100644 (file)
index 0000000..dbc5d1f
--- /dev/null
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933067 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="proxy.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>使用 mod_rewrite 进行代理</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了如何使用
+RewriteRule 的 [P] 标志将内容代理到另一台服务器。
+提供了若干描述常见场景的配置方案。</p>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<!--<seealso><a href="proxy.html">代理</a></seealso>-->
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="dynamic-proxy">
+
+  <title>使用 mod_rewrite 代理内容</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+    <p>
+    <module>mod_rewrite</module> 提供了 [P] 标志,允许 URL 通过
+    <module>mod_proxy</module> 传递到另一台服务器。这里给出两个示例。
+    在一个示例中,URL 被直接传递到另一台服务器,并像本地 URL 一样提供服务。
+    在另一个示例中,我们将缺失的内容代理到后端服务器。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>要简单地将 URL 映射到另一台服务器,我们使用 [P] 标志,如下所示:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/products/"
+RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
+ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
+</highlight>
+
+   <p>在第二个示例中,我们仅在本地找不到资源时才代理请求。
+   当你从一台服务器迁移到另一台服务器,而不确定所有内容是否已迁移完毕时,
+   这非常有用。</p>
+
+<highlight language="config">
+RewriteCond "%{REQUEST_FILENAME}"       !-f
+RewriteCond "%{REQUEST_FILENAME}"       !-d
+RewriteRule "^/(.*)"                    "http://old.example.com/$1" [P]
+ProxyPassReverse "/" "http://old.example.com/"
+</highlight>
+    </dd>
+
+    <dt>讨论:</dt>
+
+    <dd><p>在每种情况下,我们都添加了一个 <directive
+    module="mod_proxy">ProxyPassReverse</directive> 指令,
+    以确保后端发出的任何重定向都能正确地传递给客户端。</p>
+
+    <p>请尽可能考虑使用 <directive
+    module="mod_proxy">ProxyPass</directive> 或 <directive
+    module="mod_proxy">ProxyPassMatch</directive> 来代替
+    <module>mod_rewrite</module>。</p>
+    </dd>
+  </dl>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/remapping.xml.de b/docs/manual/rewrite/remapping.xml.de
new file mode 100644 (file)
index 0000000..26ecac8
--- /dev/null
@@ -0,0 +1,668 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Umleitung und Neuzuordnung mit mod_rewrite</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt,
+wie Sie <module>mod_rewrite</module> verwenden können, um Anfragen
+umzuleiten und neu zuzuordnen. Dies beinhaltet viele Beispiele für gängige
+Verwendungen von <module>mod_rewrite</module>, einschließlich detaillierter
+Beschreibungen, wie jedes einzelne funktioniert.</p>
+
+<note type="warning">Beachten Sie, dass viele dieser Beispiele nicht unverändert in Ihrer
+speziellen Serverkonfiguration funktionieren werden. Es ist daher wichtig, dass Sie
+sie verstehen, anstatt die Beispiele einfach auszuschneiden und in Ihre
+Konfiguration einzufügen.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<!--<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>-->
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="old-to-new">
+
+  <title>Von Alt zu Neu (intern)</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Angenommen, wir haben kürzlich die Seite
+      <code>foo.html</code> in <code>bar.html</code> umbenannt und
+      möchten nun die alte URL aus Gründen der Abwärtskompatibilität
+      weiterhin bereitstellen. Dabei sollen die Benutzer der alten URL
+      jedoch nicht bemerken, dass die Seite umbenannt wurde - das heißt,
+      die Adresse soll sich in ihrem Browser nicht ändern.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir schreiben die alte URL intern auf die neue um, mit der
+      folgenden Regel:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>Umschreiben von Alt zu Neu (extern)</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Angenommen erneut, dass wir kürzlich die Seite
+      <code>foo.html</code> in <code>bar.html</code> umbenannt haben und
+      nun die alte URL aus Gründen der Abwärtskompatibilität weiterhin
+      bereitstellen möchten. Diesmal möchten wir aber, dass die Benutzer
+      der alten URL auf die neue hingewiesen werden, d.h. die
+      Adresszeile ihres Browsers soll sich ebenfalls ändern.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir erzwingen eine HTTP-Umleitung auf die neue URL, was zu einer
+      Änderung der Browser-Adresszeile und damit der Ansicht der Benutzer
+      führt:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>Diskussion</dt>
+
+    <dd>
+    <p>In diesem Beispiel können wir im Gegensatz zum
+    <a href="#old-to-new-intern">internen</a> Beispiel oben einfach die
+    Redirect-Direktive verwenden. <module>mod_rewrite</module> wurde in
+    diesem früheren Beispiel verwendet, um die Umleitung vor dem Client
+    zu verbergen:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>Ressource auf einen anderen Server verschoben</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wenn eine Ressource auf einen anderen Server verschoben wurde,
+      möchten Sie möglicherweise, dass URLs für eine gewisse Zeit weiterhin
+      auf dem alten Server funktionieren, während die Benutzer ihre
+      Lesezeichen aktualisieren.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Sie können <module>mod_rewrite</module> verwenden, um diese URLs
+      auf den neuen Server umzuleiten, aber Sie könnten auch die Redirect-
+      oder RedirectMatch-Direktive in Betracht ziehen.</p>
+
+<highlight language="config">
+#Mit mod_rewrite
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#Mit RedirectMatch
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#Mit Redirect
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>Von statisch zu dynamisch</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wie können wir eine statische Seite
+      <code>foo.html</code> nahtlos in eine dynamische Variante
+      <code>foo.cgi</code> umwandeln, d.h. ohne dass der
+      Browser/Benutzer es bemerkt?</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir schreiben die URL einfach auf das CGI-Skript um und
+      erzwingen, dass der Handler <strong>cgi-script</strong> ist,
+      damit es als CGI-Programm ausgeführt wird. So führt eine Anfrage
+      an <code>/~quux/foo.html</code> intern zum Aufruf von
+      <code>/~quux/foo.cgi</code>.</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>Abwärtskompatibilität bei Änderung der Dateiendung</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Wie können wir URLs abwärtskompatibel machen (virtuell weiterhin
+      existierend), nachdem <code>document.YYYY</code> zu
+      <code>document.XXXX</code> migriert wurde, z.B. nach der Konvertierung
+      einer Reihe von <code>.html</code>-Dateien nach <code>.php</code>?</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Die URL wird nur dann von der alten auf die neue Endung
+      umgeschrieben, wenn die Zieldatei mit der neuen Endung existiert
+      und die Originaldatei mit der alten Endung nicht existiert.
+      Andernfalls bleibt die URL unverändert.</p>
+
+<highlight language="config">
+#   Abwärtskompatibilitäts-Regelsatz für
+#   Umschreibung von document.html zu document.php
+#   wenn und nur wenn document.php existiert
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>Diskussion</dt>
+    <dd>
+    <p>Dieses Beispiel nutzt eine oft übersehene Funktion von
+    <module>mod_rewrite</module>, indem es die Ausführungsreihenfolge des
+    Regelsatzes ausnutzt. Insbesondere wertet <module>mod_rewrite</module>
+    die linke Seite der RewriteRule aus, bevor es die
+    RewriteCond-Direktiven auswertet. Folglich ist $1 bereits definiert,
+    wenn die RewriteCond-Direktiven ausgewertet werden. Dies ermöglicht
+    es uns, die Existenz der Original- (<code>document.html</code>) und
+    Zieldatei (<code>document.php</code>) unter Verwendung desselben
+    Basisdateinamens zu prüfen.</p>
+
+    <p>Dieser Regelsatz ist für die Verwendung im Verzeichniskontext
+    (in einem &lt;Directory&gt;-Block oder in einer .htaccess-Datei)
+    konzipiert, sodass die <code>-f</code>-Prüfungen im korrekten
+    Verzeichnispfad suchen. Möglicherweise müssen Sie eine <directive
+    module="mod_rewrite">RewriteBase</directive>-Direktive setzen, um das
+    Verzeichnis anzugeben, in dem Sie arbeiten.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>Kanonische Hostnamen</title>
+
+      <dl>
+        <dt>Beschreibung:</dt>
+
+        <dd>Das Ziel dieser Regel ist es, die Verwendung eines bestimmten
+        Hostnamens zu erzwingen, anstelle anderer Hostnamen, die für den
+        Zugriff auf dieselbe Website verwendet werden könnten. Wenn Sie
+        beispielsweise die Verwendung von <strong>www.example.com</strong>
+        anstelle von <strong>example.com</strong> erzwingen möchten,
+        können Sie eine Variante des folgenden Rezepts verwenden.</dd>
+
+        <dt>Lösung:</dt>
+
+        <dd>
+
+<p>Der allerbeste Weg, dies zu lösen, verwendet gar nicht <module>mod_rewrite</module>,
+sondern die <directive module="mod_alias">Redirect</directive>-Direktive
+in einem virtuellen Host für den nicht-kanonischen Hostnamen.</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>Alternativ können Sie dies mit der
+<directive module="core" type="section">If</directive>-Direktive
+erreichen: (<strong>ab Version 2.4</strong>)</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>Oder, um beispielsweise einen Teil Ihrer Website auf HTTPS umzuleiten,
+könnten Sie Folgendes tun:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>Wenn Sie aus irgendeinem Grund dennoch <module>mod_rewrite</module>
+verwenden möchten - zum Beispiel, wenn Sie dies mit einer größeren Menge
+von RewriteRules benötigen - können Sie eines der folgenden Rezepte
+verwenden.</p>
+
+<p>Für Websites, die auf einem anderen Port als 80 laufen:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>Und für eine Website auf Port 80:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        Wenn Sie dies generisch für alle Domainnamen tun möchten - das
+        heißt, wenn Sie <strong>example.com</strong> für alle möglichen
+        Werte von <strong>example.com</strong> auf
+        <strong>www.example.com</strong> umleiten möchten, können Sie
+        das folgende Rezept verwenden:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>Diese Regelsätze funktionieren sowohl in Ihrer
+    Hauptserverkonfigurationsdatei als auch in einer <code>.htaccess</code>-Datei,
+    die im <directive module="core">DocumentRoot</directive> des Servers
+    abgelegt wird.</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>Suche nach Seiten in mehr als einem Verzeichnis</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+      <p>Eine bestimmte Ressource könnte an einem von mehreren Orten
+      existieren, und wir möchten an diesen Orten nach der Ressource
+      suchen, wenn sie angefordert wird. Vielleicht haben wir kürzlich
+      unsere Verzeichnisstruktur umorganisiert und Inhalte auf mehrere
+      Orte verteilt.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Der folgende Regelsatz sucht in zwei Verzeichnissen nach der
+      Ressource und versucht, falls sie an keinem der beiden Orte
+      gefunden wird, sie einfach vom angeforderten Ort auszuliefern.</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   zuerst versuchen, es in dir1/ zu finden...
+#   ...und wenn gefunden, anhalten und zufrieden sein:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   dann versuchen, es in dir2/ zu finden...
+#   ...und wenn gefunden, anhalten und zufrieden sein:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   sonst weiter zu anderen Alias- oder ScriptAlias-Direktiven usw.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>Umleitung auf geografisch verteilte Server</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+    <p>Wir haben zahlreiche Spiegelserver unserer Website und möchten
+    Besucher auf denjenigen umleiten, der sich in dem Land befindet, in
+    dem sie sich aufhalten.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+    <p>Anhand des Hostnamens des anfragenden Clients bestimmen wir, aus
+    welchem Land er kommt. Wenn wir keine Auflösung seiner IP-Adresse
+    durchführen können, greifen wir auf einen Standardserver zurück.</p>
+    <p>Wir verwenden eine <directive module="mod_rewrite">RewriteMap</directive>-Direktive,
+    um eine Liste der gewünschten Server zu erstellen.</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- Multiplexing-Map<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>Diskussion</dt>
+    <dd>
+    <note type="warning">Dieser Regelsatz setzt voraus, dass
+    <directive module="core">HostNameLookups</directive> auf <code>on</code>
+    gesetzt ist, was einen erheblichen Leistungseinbruch bedeuten kann.</note>
+
+    <p>Die <directive module="mod_rewrite">RewriteCond</directive>-Direktive
+    erfasst den letzten Teil des Hostnamens des anfragenden Clients - den
+    Ländercode - und die nachfolgende RewriteRule verwendet diesen Wert,
+    um den entsprechenden Spiegelhost in der Map-Datei nachzuschlagen.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>Kanonische URLs</title>
+
+<dl>
+ <dt>Beschreibung:</dt>
+
+   <dd>
+     <p>Auf manchen Webservern gibt es mehr als eine URL für eine
+     Ressource. Normalerweise gibt es kanonische URLs (die tatsächlich
+     verwendet und verteilt werden) und solche, die nur Abkürzungen,
+     interne Adressen usw. sind. Unabhängig davon, welche URL der
+     Benutzer mit der Anfrage angegeben hat, sollte er schließlich die
+     kanonische URL in der Adresszeile seines Browsers sehen.</p>
+   </dd>
+
+   <dt>Lösung:</dt>
+
+     <dd>
+       <p>Wir führen eine externe HTTP-Umleitung für alle nicht-kanonischen
+       URLs durch, um sie in der Adressanzeige des Browsers und für alle
+       nachfolgenden Anfragen zu korrigieren. Im folgenden Beispiel-Regelsatz
+       ersetzen wir <code>/puppies</code> und <code>/canines</code>
+       durch die kanonische URL <code>/dogs</code>.</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>Diskussion:</dt>
+     <dd>
+     Dies sollte eigentlich mit Redirect- oder RedirectMatch-Direktiven
+     erreicht werden:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title>Verschobenes <code>DocumentRoot</code></title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+<p>Normalerweise entspricht das <directive module="core">DocumentRoot</directive>
+des Webservers direkt der URL "<code>/</code>". Aber oft sind diese Daten
+nicht wirklich von höchster Priorität. Beispielsweise möchten Sie
+vielleicht, dass Besucher beim ersten Betreten einer Website in ein
+bestimmtes Unterverzeichnis <code>/about/</code> geleitet werden. Dies
+kann mit dem folgenden Regelsatz erreicht werden:</p>
+</dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+      <p>Wir leiten die URL <code>/</code> nach
+      <code>/about/</code> um:
+      </p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>Beachten Sie, dass dies auch mit der <directive
+module="mod_alias">RedirectMatch</directive>-Direktive gehandhabt werden
+kann:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>Beachten Sie auch, dass das Beispiel nur die Stamm-URL umschreibt.
+Das heißt, es schreibt eine Anfrage für <code>http://example.com/</code>
+um, aber nicht eine Anfrage für <code>http://example.com/page.html</code>.
+Wenn Sie tatsächlich Ihr Document Root geändert haben - das heißt, wenn
+<strong>alle</strong> Ihre Inhalte tatsächlich in diesem Unterverzeichnis
+liegen - ist es wesentlich besser, einfach Ihre
+<directive module="core">DocumentRoot</directive>-Direktive zu ändern
+oder alle Inhalte ein Verzeichnis nach oben zu verschieben, anstatt URLs
+umzuschreiben.</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>Fallback-Ressource</title>
+
+<dl>
+<dt>Beschreibung:</dt>
+<dd>Sie möchten, dass eine einzelne Ressource (beispielsweise eine bestimmte
+Datei wie index.php) alle Anfragen behandelt, die an ein bestimmtes
+Verzeichnis gerichtet sind, mit Ausnahme derjenigen, die an eine vorhandene
+Ressource wie ein Bild oder eine CSS-Datei gehen sollen.</dd>
+
+<dt>Lösung:</dt>
+<dd>
+<p>Ab Version 2.2.16 sollten Sie hierfür die <directive
+module="mod_dir">FallbackResource</directive>-Direktive verwenden:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>In älteren Versionen von Apache oder wenn Ihre Anforderungen
+komplizierter sind, können Sie eine Variante des folgenden
+Umschreibungssatzes verwenden, um dasselbe zu erreichen:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>Wenn Sie andererseits die angeforderte URI als Query-String-Argument
+an index.php übergeben möchten, können Sie diese RewriteRule ersetzen
+durch:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>Beachten Sie, dass diese Regelsätze sowohl in einer
+<code>.htaccess</code>-Datei als auch in einem &lt;Directory&gt;-Block
+verwendet werden können.</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>Query-String umschreiben</title>
+
+<dl>
+<dt>Beschreibung:</dt>
+<dd>Sie möchten einen bestimmten Wert aus einem Query-String erfassen
+und ihn entweder ersetzen oder in eine andere Komponente der URL
+einbinden.</dd>
+
+<dt>Lösungen:</dt>
+<dd>
+<p>Viele der Lösungen in diesem Abschnitt verwenden dieselbe Bedingung,
+die den übereinstimmenden Wert in der Rückreferenz %2 belässt. %1 ist der
+Anfang des Query-Strings (bis zum interessierenden Schlüssel) und %3 ist
+der Rest. Diese Bedingung ist etwas komplex, um Flexibilität zu gewährleisten
+und doppelte '&amp;&amp;' in den Ersetzungen zu vermeiden.</p>
+<ul>
+  <li>Diese Lösung entfernt den übereinstimmenden Schlüssel und Wert:
+
+<highlight language="config">
+# mykey=??? entfernen
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>Diese Lösung verwendet den erfassten Wert in der URL-Ersetzung
+  und verwirft den Rest des ursprünglichen Query-Strings durch Anhängen
+  eines '?':
+
+<highlight language="config">
+# Vom Query-String in PATH_INFO kopieren
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>Diese Lösung prüft den erfassten Wert in einer nachfolgenden Bedingung:
+
+<highlight language="config">
+# Den Wert von mykey im Query-String erfassen
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>Diese Lösung zeigt die Umkehrung der vorherigen und kopiert
+      Pfadkomponenten (möglicherweise PATH_INFO) aus der URL in den
+      Query-String.
+<highlight language="config">
+# Die gewünschte URL könnte /products/kitchen-sink sein, und das Skript erwartet
+# /path?products=kitchen-sink.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/remapping.xml.es b/docs/manual/rewrite/remapping.xml.es
new file mode 100644 (file)
index 0000000..1aeb721
--- /dev/null
@@ -0,0 +1,657 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Redirección y Remapeo con mod_rewrite</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+cómo puede usar <module>mod_rewrite</module> para redirigir y remapear
+solicitudes. Esto incluye muchos ejemplos de usos comunes de <module>mod_rewrite</module>,
+incluyendo descripciones detalladas de cómo funciona cada uno.</p>
+
+<note type="warning">Tenga en cuenta que muchos de estos ejemplos no funcionarán sin cambios en su
+configuración particular del servidor, por lo que es importante que los
+entienda, en lugar de simplemente copiar y pegar los ejemplos en su
+configuración.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<!--<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>-->
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="old-to-new">
+
+  <title>De Antiguo a Nuevo (interno)</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Supongamos que hemos renombrado recientemente la página
+      <code>foo.html</code> a <code>bar.html</code> y ahora queremos
+      proporcionar la antigua URL por compatibilidad hacia atrás. Sin embargo,
+      queremos que los usuarios de la antigua URL ni siquiera se den cuenta de que
+      la página fue renombrada - es decir, no queremos que la dirección
+      cambie en su navegador.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Reescribimos la antigua URL a la nueva internamente mediante la
+      siguiente regla:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>Reescritura de Antiguo a Nuevo (externo)</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Supongamos de nuevo que hemos renombrado recientemente la página
+      <code>foo.html</code> a <code>bar.html</code> y ahora queremos
+      proporcionar la antigua URL por compatibilidad hacia atrás. Pero esta
+      vez queremos que los usuarios de la antigua URL reciban una indicación de
+      la nueva, es decir, que el campo de Ubicación de su navegador también
+      cambie.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Forzamos una redirección HTTP a la nueva URL que lleva a un
+      cambio del navegador y por lo tanto de la vista del usuario:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>Discusión</dt>
+
+    <dd>
+    <p>En este ejemplo, a diferencia del ejemplo <a
+    href="#old-to-new-intern">interno</a> anterior, podemos simplemente
+    usar la directiva Redirect. <module>mod_rewrite</module> se usó en ese ejemplo
+    anterior para ocultar la redirección del cliente:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>Recurso Movido a Otro Servidor</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Si un recurso se ha movido a otro servidor, puede desear que
+      las URLs continúen funcionando por un tiempo en el antiguo servidor mientras
+      la gente actualiza sus marcadores.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Puede usar <module>mod_rewrite</module> para redirigir estas URLs
+      al nuevo servidor, pero también podría considerar usar la directiva Redirect
+      o RedirectMatch.</p>
+
+<highlight language="config">
+#With mod_rewrite
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#With RedirectMatch
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#With Redirect
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>De Estático a Dinámico</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>¿Cómo podemos transformar una página estática
+      <code>foo.html</code> en una variante dinámica
+      <code>foo.cgi</code> de manera transparente, es decir, sin que
+      el navegador/usuario lo note.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Simplemente reescribimos la URL al script CGI y forzamos el
+      manejador a ser <strong>cgi-script</strong> para que se
+      ejecute como un programa CGI.
+      De esta manera, una solicitud a <code>/~quux/foo.html</code>
+      internamente lleva a la invocación de
+      <code>/~quux/foo.cgi</code>.</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>Compatibilidad hacia atrás para cambio de extensión de archivo</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>¿Cómo podemos hacer URLs retrocompatibles (aún
+      existentes virtualmente) después de migrar <code>document.YYYY</code>
+      a <code>document.XXXX</code>, por ejemplo, después de traducir un
+      grupo de archivos <code>.html</code> a <code>.php</code>?</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>La URL se reescribe de la antigua extensión a la nueva
+      solo si el archivo destino con la nueva extensión existe
+      y el archivo original con la antigua extensión no existe.
+      De lo contrario, la URL se deja sin cambios.</p>
+
+<highlight language="config">
+#   backward compatibility ruleset for
+#   rewriting document.html to document.php
+#   when and only when document.php exists
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>Discusión</dt>
+    <dd>
+    <p>Este ejemplo usa una característica a menudo pasada por alto de <module>mod_rewrite</module>,
+    aprovechando el orden de ejecución del conjunto de reglas. En
+    particular, <module>mod_rewrite</module> evalúa el lado izquierdo de la
+    RewriteRule antes de evaluar las directivas RewriteCond.
+    En consecuencia, $1 ya está definido para el momento en que las directivas
+    RewriteCond se evalúan. Esto nos permite probar la existencia
+    del archivo original (<code>document.html</code>) y destino
+    (<code>document.php</code>) usando el mismo nombre de archivo base.</p>
+
+    <p>Este conjunto de reglas está diseñado para usarse en un contexto per-directorio (en un
+    bloque &lt;Directory&gt; o en un archivo .htaccess), de modo que las
+    verificaciones <code>-f</code> busquen en la ruta de directorio correcta.
+    Puede necesitar establecer una directiva <directive
+    module="mod_rewrite">RewriteBase</directive> para especificar la
+    base de directorio en la que está trabajando.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>Nombres de Host Canónicos</title>
+
+      <dl>
+        <dt>Descripción:</dt>
+
+        <dd>El objetivo de esta regla es forzar el uso de un nombre de
+        host particular, en preferencia a otros nombres de host que pueden usarse para
+        alcanzar el mismo sitio. Por ejemplo, si desea forzar el uso
+        de <strong>www.example.com</strong> en lugar de
+        <strong>example.com</strong>, podría usar una variante de la
+        siguiente receta.</dd>
+
+        <dt>Solución:</dt>
+
+        <dd>
+
+<p>La mejor manera de resolver esto no involucra <module>mod_rewrite</module> en absoluto,
+sino que usa la directiva <directive module="mod_alias">Redirect</directive>
+colocada en un host virtual para el o los nombres de host no canónicos.</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>Alternativamente puede lograr esto usando la
+directiva <directive module="core" type="section">If</directive>:
+(<strong>2.4 y posterior</strong>)</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>O, por ejemplo, para redirigir una porción de su sitio a HTTPS, podría
+hacer lo siguiente:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>Si, por cualquier razón, aún desea usar <module>mod_rewrite</module>
+- si, por ejemplo, necesita que esto funcione con un conjunto más grande de RewriteRules -
+podría usar una de las recetas siguientes.</p>
+
+<p>Para sitios ejecutándose en un puerto distinto al 80:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>Y para un sitio ejecutándose en el puerto 80</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        Si quisiera hacer esto genéricamente para todos los nombres de dominio - es
+        decir, si quiere redirigir <strong>example.com</strong> a
+        <strong>www.example.com</strong> para todos los valores posibles de
+        <strong>example.com</strong>, podría usar la siguiente
+        receta:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>Estos conjuntos de reglas funcionarán tanto en su archivo de configuración principal
+    del servidor, como en un archivo <code>.htaccess</code> colocado en el <directive
+    module="core">DocumentRoot</directive> del servidor.</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>Búsqueda de páginas en más de un directorio</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+      <p>Un recurso particular podría existir en uno de varios lugares, y
+      queremos buscar en esos lugares el recurso cuando se
+      solicita. Quizás hemos reorganizado recientemente nuestra estructura de
+      directorios, dividiendo el contenido en varias ubicaciones.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>El siguiente conjunto de reglas busca en dos directorios para encontrar el
+      recurso, y, si no lo encuentra en ninguno de los dos, intentará
+      simplemente servirlo desde la ubicación solicitada.</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   first try to find it in dir1/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   second try to find it in dir2/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   else go on for other Alias or ScriptAlias directives,
+#   etc.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>Redirección a Servidores Distribuidos Geográficamente</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+    <p>Tenemos numerosos espejos de nuestro sitio web, y queremos redirigir
+    a la gente al que está ubicado en el país donde se
+    encuentran.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+    <p>Mirando el nombre de host del cliente solicitante, determinamos
+    de qué país provienen. Si no podemos hacer una búsqueda de su
+    dirección IP, recurrimos a un servidor predeterminado.</p>
+    <p>Usaremos una directiva <directive module="mod_rewrite">RewriteMap</directive>
+    para construir una lista de servidores que deseamos usar.</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- Mapa de Multiplexación<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>Discusión</dt>
+    <dd>
+    <note type="warning">Este conjunto de reglas depende de que
+    <directive module="core">HostNameLookups</directive>
+    esté configurado como <code>on</code>, lo que puede ser
+    un impacto significativo en el rendimiento.</note>
+
+    <p>La directiva <directive module="mod_rewrite">RewriteCond</directive>
+    captura la última parte del nombre de host del
+    cliente solicitante - el código de país - y la siguiente RewriteRule
+    usa ese valor para buscar el host espejo apropiado en el archivo
+    de mapa.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>URLs Canónicas</title>
+
+<dl>
+ <dt>Descripción:</dt>
+
+   <dd>
+     <p>En algunos servidores web hay más de una URL para un
+     recurso. Generalmente hay URLs canónicas (que son las que realmente
+     se usan y distribuyen) y aquellas que son solo
+     atajos, internas, etc. Independientemente de qué URL
+     proporcionó el usuario con la solicitud, finalmente debería ver la
+     canónica en la barra de direcciones de su navegador.</p>
+   </dd>
+
+   <dt>Solución:</dt>
+
+     <dd>
+       <p>Hacemos una redirección HTTP externa para todas las
+       URLs no canónicas para corregirlas en la vista de ubicación del navegador y
+       para todas las solicitudes posteriores. En el conjunto de reglas de ejemplo
+       reemplazamos <code>/puppies</code> y <code>/canines</code>
+       por el canónico <code>/dogs</code>.</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>Discusión:</dt>
+     <dd>
+     Esto realmente debería lograrse con directivas Redirect o RedirectMatch:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title><code>DocumentRoot</code> Movido</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+<p>Generalmente el <directive module="core">DocumentRoot</directive>
+del servidor web se relaciona directamente con la URL "<code>/</code>".
+Pero a menudo estos datos no son realmente de máxima prioridad. Por ejemplo,
+puede desear que los visitantes, al entrar por primera vez a un sitio, vayan a un
+subdirectorio particular <code>/about/</code>. Esto puede lograrse
+usando el siguiente conjunto de reglas:</p>
+</dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+      <p>Redirigimos la URL <code>/</code> a
+      <code>/about/</code>:
+      </p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>Tenga en cuenta que esto también puede manejarse usando la directiva <directive
+module="mod_alias">RedirectMatch</directive>:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>Tenga en cuenta también que el ejemplo solo reescribe la URL raíz. Es decir, reescribe
+una solicitud para <code>http://example.com/</code>, pero no una
+solicitud para <code>http://example.com/page.html</code>. Si de hecho ha
+cambiado la raíz de documentos - es decir, si <strong>todo</strong> su
+contenido está en ese subdirectorio, es muy preferible
+simplemente cambiar su directiva <directive module="core">DocumentRoot</directive>,
+o mover todo el contenido un directorio arriba,
+en lugar de reescribir URLs.</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>Recurso de Respaldo</title>
+
+<dl>
+<dt>Descripción:</dt>
+<dd>Desea que un solo recurso (digamos, un cierto archivo, como index.php) maneje
+todas las solicitudes que lleguen a un directorio particular, excepto aquellas
+que deberían ir a un recurso existente como una imagen, o un archivo css.</dd>
+
+<dt>Solución:</dt>
+<dd>
+<p>A partir de la versión 2.2.16, debería usar la directiva <directive
+module="mod_dir">FallbackResource</directive> para esto:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>Sin embargo, en versiones anteriores de Apache, o si sus necesidades son más
+complicadas que esto, puede usar una variación del siguiente conjunto de
+reescritura para lograr lo mismo:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>Si, por otro lado, desea pasar la URI solicitada como un argumento de
+cadena de consulta a index.php, puede reemplazar esa RewriteRule con:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>Tenga en cuenta que estos conjuntos de reglas pueden usarse en un archivo <code>.htaccess</code>,
+así como en un bloque &lt;Directory&gt;.</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>Reescribir cadena de consulta</title>
+
+<dl>
+<dt>Descripción:</dt>
+<dd>Desea capturar un valor particular de una cadena de consulta
+y reemplazarlo o incorporarlo en otro componente
+de la URL.</dd>
+
+<dt>Soluciones:</dt>
+<dd>
+<p>Muchas de las soluciones en esta sección usarán la misma condición,
+que deja el valor coincidente en la referencia inversa %2. %1 es el inicio
+de la cadena de consulta (hasta la clave de interés), y %3 es el resto. Esta
+condición es un poco compleja por flexibilidad y para evitar doble '&amp;&amp;' en las
+sustituciones.</p>
+<ul>
+  <li>Esta solución elimina la clave y valor coincidentes:
+
+<highlight language="config">
+# Remove mykey=???
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>Esta solución usa el valor capturado en la sustitución de URL,
+  descartando el resto de la consulta original añadiendo un '?':
+
+<highlight language="config">
+# Copy from query string to PATH_INFO
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>Esta solución verifica el valor capturado en una condición posterior:
+
+<highlight language="config">
+# Capture the value of mykey in the query string
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>Esta solución muestra lo inverso de las anteriores, copiando
+      componentes de ruta (quizás PATH_INFO) de la URL a la cadena de consulta.
+<highlight language="config">
+# The desired URL might be /products/kitchen-sink, and the script expects
+# /path?products=kitchen-sink.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/remapping.xml.ja b/docs/manual/rewrite/remapping.xml.ja
new file mode 100644 (file)
index 0000000..9febb2c
--- /dev/null
@@ -0,0 +1,648 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite によるリダイレクトとリマッピング</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> を使用してリクエストをリダイレクトおよびリマッピング
+する方法を説明します。<module>mod_rewrite</module> の一般的な使用例を多数含んでおり、
+それぞれの動作についての詳細な説明も含まれています。</p>
+
+<note type="warning">これらの例の多くは、特定のサーバ設定ではそのまま
+動作しないことに注意してください。そのため、単にコピー&ペーストするのではなく、
+内容を理解することが重要です。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<!--<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>-->
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="old-to-new">
+
+  <title>旧 URL から新 URL へ (内部)</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>最近ページ <code>foo.html</code> を <code>bar.html</code> に
+      リネームし、後方互換性のために旧 URL も提供したいとします。
+      ただし、旧 URL のユーザにはページがリネームされたことを
+      気づかせたくありません - つまり、ブラウザのアドレスが
+      変更されないようにします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>以下のルールで旧 URL を内部的に新しいものに書き換えます:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>旧 URL から新 URL への書き換え (外部)</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>再び、最近ページ <code>foo.html</code> を <code>bar.html</code>
+      にリネームし、後方互換性のために旧 URL を提供したいとします。
+      しかし今回は、旧 URL のユーザに新しい URL を知らせたい、
+      つまりブラウザの Location フィールドも変更されるようにしたいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>新しい URL への HTTP リダイレクトを強制し、ブラウザと
+      ユーザの表示を変更します:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>議論</dt>
+
+    <dd>
+    <p>この例では、上記の<a href="#old-to-new-intern">内部</a>の例と
+    対比して、単純に Redirect ディレクティブを使用できます。
+    <module>mod_rewrite</module> は、前の例でクライアントからリダイレクトを
+    隠すために使用されました:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>リソースの別サーバへの移動</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>リソースが別のサーバに移動した場合、人々がブックマークを
+      更新する間、旧サーバでも URL がしばらく機能し続けるように
+      したいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module> を使用してこれらの URL を新しいサーバに
+      リダイレクトできますが、Redirect や RedirectMatch ディレクティブの
+      使用も検討してください。</p>
+
+<highlight language="config">
+#With mod_rewrite
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#With RedirectMatch
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#With Redirect
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>静的から動的へ</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>静的ページ <code>foo.html</code> を動的バリアント
+      <code>foo.cgi</code> にシームレスに、つまりブラウザ/ユーザに
+      気づかれずに変換するにはどうすればよいでしょうか。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>URL を CGI スクリプトに書き換え、ハンドラを
+      <strong>cgi-script</strong> に強制して、CGI プログラムとして
+      実行されるようにします。
+      これにより、<code>/~quux/foo.html</code> へのリクエストは
+      内部的に <code>/~quux/foo.cgi</code> の呼び出しに
+      つながります。</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>ファイル拡張子変更の後方互換性</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p><code>document.YYYY</code> から <code>document.XXXX</code> への
+      移行後、例えば <code>.html</code> ファイル群を <code>.php</code> に
+      変換した後に、URL の後方互換性 (仮想的にまだ存在する状態) を
+      どのように保つことができるでしょうか?</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>URL は旧拡張子から新拡張子に書き換えられますが、新拡張子の
+      ターゲットファイルが存在し、かつ旧拡張子の元のファイルが
+      存在しない場合のみです。それ以外の場合、URL はそのまま
+      変更されません。</p>
+
+<highlight language="config">
+#   backward compatibility ruleset for
+#   rewriting document.html to document.php
+#   when and only when document.php exists
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>議論</dt>
+    <dd>
+    <p>この例では、<module>mod_rewrite</module> のあまり知られていない
+    機能を利用しています。ルールセットの実行順序を活用しています。
+    具体的には、<module>mod_rewrite</module> は RewriteCond ディレクティブを
+    評価する前に RewriteRule の左辺を評価します。
+    そのため、RewriteCond ディレクティブが評価される時点で
+    $1 はすでに定義されています。これにより、同じベースファイル名を使用して
+    元のファイル (<code>document.html</code>) とターゲットファイル
+    (<code>document.php</code>) の存在を確認できます。</p>
+
+    <p>このルールセットはディレクトリ単位のコンテキスト
+    (&lt;Directory&gt; ブロックまたは .htaccess ファイル内) で
+    使用するよう設計されているため、<code>-f</code> チェックは
+    正しいディレクトリパスを参照します。作業しているディレクトリベースを
+    指定するために <directive module="mod_rewrite">RewriteBase</directive>
+    ディレクティブを設定する必要があるかもしれません。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>正規ホスト名</title>
+
+      <dl>
+        <dt>説明:</dt>
+
+        <dd>このルールの目的は、同じサイトに到達するために使用される
+        可能性のある他のホスト名よりも、特定のホスト名の使用を強制
+        することです。例えば、<strong>example.com</strong> の代わりに
+        <strong>www.example.com</strong> の使用を強制したい場合は、
+        以下のレシピのバリアントを使用できます。</dd>
+
+        <dt>解決方法:</dt>
+
+        <dd>
+
+<p>最善の方法は <module>mod_rewrite</module> をまったく使わず、
+非正規のホスト名用のバーチャルホストに配置した <directive
+module="mod_alias">Redirect</directive> ディレクティブを使用する
+ことです。</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>あるいは、<directive module="core" type="section">If</directive>
+ディレクティブを使用して実現することもできます:
+(<strong>2.4 以降</strong>)</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>あるいは、例えばサイトの一部を HTTPS にリダイレクトするには、
+以下のようにします:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>何らかの理由でまだ <module>mod_rewrite</module> を使用したい場合 -
+例えば、より大きな RewriteRule のセットと組み合わせる必要がある場合 -
+以下のレシピのいずれかを使用できます。</p>
+
+<p>ポート 80 以外で実行されているサイトの場合:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>ポート 80 で実行されているサイトの場合:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        すべてのドメイン名に対してこれを汎用的に行いたい場合 -
+        つまり、<strong>example.com</strong> のすべての可能な値に対して
+        <strong>example.com</strong> を <strong>www.example.com</strong>
+        にリダイレクトしたい場合 - 以下のレシピを使用できます:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>これらのルールセットは、メインサーバ設定ファイルまたはサーバの
+    <directive module="core">DocumentRoot</directive> に配置した
+    <code>.htaccess</code> ファイルのいずれでも動作します。</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>複数のディレクトリでのページ検索</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+      <p>特定のリソースが複数の場所に存在する可能性があり、
+      リクエスト時にそれらの場所でリソースを検索したいとします。
+      おそらく最近ディレクトリ構造を再編成し、コンテンツを
+      複数の場所に分割したためです。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>以下のルールセットは 2 つのディレクトリでリソースを検索し、
+      どちらにも見つからない場合は、リクエストされた場所からそのまま
+      提供しようとします。</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   first try to find it in dir1/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   second try to find it in dir2/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   else go on for other Alias or ScriptAlias directives,
+#   etc.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>地理的に分散されたサーバへのリダイレクト</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+    <p>ウェブサイトの多数のミラーがあり、アクセス元の国に最も近い
+    ミラーにリダイレクトしたいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+    <p>リクエスト元のクライアントのホスト名を参照して、どの国から
+    アクセスしているかを判定します。IP アドレスの検索ができない場合は、
+    デフォルトサーバにフォールバックします。</p>
+    <p>使用したいサーバのリストを構築するために <directive
+    module="mod_rewrite">RewriteMap</directive> ディレクティブを
+    使用します。</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- マルチプレクシングマップ<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>議論</dt>
+    <dd>
+    <note type="warning">このルールセットは
+    <directive module="core">HostNameLookups</directive> が
+    <code>on</code> に設定されていることに依存しており、
+    パフォーマンスに大きな影響を与える可能性があります。</note>
+
+    <p><directive module="mod_rewrite">RewriteCond</directive>
+    ディレクティブは、リクエスト元のクライアントのホスト名の最後の
+    部分 (国コード) をキャプチャし、後続の RewriteRule はその値を
+    使用してマップファイルから適切なミラーホストを検索します。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>正規 URL</title>
+
+<dl>
+ <dt>説明:</dt>
+
+   <dd>
+     <p>一部のウェブサーバでは、リソースに対して複数の URL が存在します。
+     通常、正規の URL (実際に使用および配布される URL) と、単なる
+     ショートカット、内部用の URL 等があります。ユーザがリクエストで
+     どの URL を提供したかに関係なく、最終的にブラウザのアドレスバーに
+     正規の URL が表示されるようにしたいとします。</p>
+   </dd>
+
+   <dt>解決方法:</dt>
+
+     <dd>
+       <p>すべての非正規 URL に対して外部 HTTP リダイレクトを行い、
+       ブラウザの表示を修正し、以降のすべてのリクエストに反映させます。
+       以下のルールセット例では、<code>/puppies</code> と
+       <code>/canines</code> を正規の <code>/dogs</code> に
+       置き換えます。</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>議論:</dt>
+     <dd>
+     これは実際には Redirect または RedirectMatch ディレクティブで
+     実現すべきです:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title><code>DocumentRoot</code> の移動</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+<p>通常、ウェブサーバの <directive module="core">DocumentRoot</directive>
+は URL "<code>/</code>" に直接対応します。
+しかし、このデータが最優先ではない場合も多くあります。例えば、
+訪問者がサイトに最初にアクセスしたときに特定のサブディレクトリ
+<code>/about/</code> に移動させたい場合があります。これは以下の
+ルールセットで実現できます:</p>
+</dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+      <p>URL <code>/</code> を <code>/about/</code> にリダイレクトします:
+      </p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>これは <directive module="mod_alias">RedirectMatch</directive>
+ディレクティブでも処理できることに注意してください:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>この例はルート URL のみを書き換えることに注意してください。つまり、
+<code>http://example.com/</code> へのリクエストは書き換えますが、
+<code>http://example.com/page.html</code> へのリクエストは書き換えません。
+実際にドキュメントルートを変更した場合 - つまり、コンテンツの
+<strong>すべて</strong>が実際にそのサブディレクトリにある場合 - URL を
+書き換えるよりも、単に <directive module="core">DocumentRoot</directive>
+ディレクティブを変更するか、すべてのコンテンツを 1 つ上のディレクトリに
+移動する方がはるかに望ましいです。</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>フォールバックリソース</title>
+
+<dl>
+<dt>説明:</dt>
+<dd>特定のディレクトリに来るすべてのリクエストを単一のリソース
+(例えば特定のファイル、index.php など) で処理したいが、
+画像や CSS ファイルなどの既存のリソースへのリクエストは
+そのまま処理したいとします。</dd>
+
+<dt>解決方法:</dt>
+<dd>
+<p>バージョン 2.2.16 以降では、このために <directive
+module="mod_dir">FallbackResource</directive> ディレクティブを
+使用してください:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>ただし、以前のバージョンの Apache や、これよりも複雑なニーズがある
+場合は、以下の書き換えセットのバリエーションを使用して同じことを
+実現できます:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>一方、リクエストされた URI をクエリ文字列引数として index.php に
+渡したい場合は、その RewriteRule を以下に置き換えることができます:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>これらのルールセットは <code>.htaccess</code> ファイルでも
+&lt;Directory&gt; ブロックでも使用できることに注意してください。</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>クエリ文字列の書き換え</title>
+
+<dl>
+<dt>説明:</dt>
+<dd>クエリ文字列から特定の値をキャプチャし、それを置換するか
+URL の別のコンポーネントに組み込みたいとします。</dd>
+
+<dt>解決方法:</dt>
+<dd>
+<p>このセクションの多くの解決方法は同じ条件を使用し、マッチした値を
+%2 バックリファレンスに残します。%1 はクエリ文字列の先頭 (対象キーまで)、
+%3 は残りの部分です。この条件は、柔軟性のため、また置換で二重の
+'&amp;&amp;' を避けるためにやや複雑です。</p>
+<ul>
+  <li>この方法はマッチするキーと値を削除します:
+
+<highlight language="config">
+# Remove mykey=???
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>この方法はキャプチャした値を URL 置換で使用し、'?' を追加して
+  元のクエリの残りを破棄します:
+
+<highlight language="config">
+# Copy from query string to PATH_INFO
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>この方法は後続の条件でキャプチャした値を確認します:
+
+<highlight language="config">
+# Capture the value of mykey in the query string
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>この方法は前の方法の逆で、URL からパスコンポーネント
+      (おそらく PATH_INFO) をクエリ文字列にコピーします:
+<highlight language="config">
+# The desired URL might be /products/kitchen-sink, and the script expects
+# /path?products=kitchen-sink.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/remapping.xml.ko b/docs/manual/rewrite/remapping.xml.ko
new file mode 100644 (file)
index 0000000..2872ace
--- /dev/null
@@ -0,0 +1,662 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite를 사용한 리다이렉션과 재매핑</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module>를 사용하여 요청을 리다이렉트하고
+재매핑하는 방법을 설명합니다. 여기에는
+<module>mod_rewrite</module>의 일반적인 사용 예제가 많이
+포함되어 있으며, 각각이 어떻게 작동하는지에 대한 자세한
+설명이 있습니다.</p>
+
+<note type="warning">이 예제들 중 많은 것이 특정 서버 설정에서
+그대로 작동하지 않을 수 있으므로, 단순히 예제를 복사하여
+설정에 붙여넣기보다는 이해하는 것이 중요합니다.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<!--<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>-->
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="old-to-new">
+
+  <title>이전에서 새로운 것으로 (내부)</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>최근에 <code>foo.html</code> 페이지를
+      <code>bar.html</code>로 이름을 변경했고 이전 URL을
+      하위 호환성을 위해 제공하고자 한다고 가정합니다.
+      그러나 이전 URL의 사용자가 페이지 이름이 변경된 것을
+      인식하지 못하게 하고 싶습니다. 즉, 브라우저에서
+      주소가 변경되지 않아야 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>다음 규칙을 통해 이전 URL을 새 URL로 내부적으로
+      재작성합니다:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>이전에서 새로운 것으로 재작성 (외부)</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>다시 최근에 <code>foo.html</code> 페이지를
+      <code>bar.html</code>로 이름을 변경했고 이전 URL을
+      하위 호환성을 위해 제공하고자 한다고 가정합니다.
+      그러나 이번에는 이전 URL의 사용자에게 새 URL을
+      알려주고 싶습니다. 즉, 브라우저의 위치 필드도
+      변경되어야 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>브라우저와 사용자의 보기를 변경하는 새 URL로의
+      HTTP 리다이렉트를 강제합니다:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>토론</dt>
+
+    <dd>
+    <p>이 예제에서는 위의 <a href="#old-to-new-intern">내부</a>
+    예제와 대조적으로 단순히 Redirect 지시어를 사용할 수
+    있습니다. <module>mod_rewrite</module>는 클라이언트로부터
+    리다이렉트를 숨기기 위해 이전 예제에서 사용되었습니다:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>다른 서버로 이동한 자원</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>자원이 다른 서버로 이동한 경우, 사람들이 북마크를
+      업데이트하는 동안 이전 서버에서 URL이 한동안 계속
+      작동하기를 원할 수 있습니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p><module>mod_rewrite</module>를 사용하여 이러한 URL을
+      새 서버로 리다이렉트할 수 있지만, Redirect 또는
+      RedirectMatch 지시어를 사용하는 것도 고려할 수
+      있습니다.</p>
+
+<highlight language="config">
+#With mod_rewrite
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#With RedirectMatch
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#With Redirect
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>정적에서 동적으로</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>정적 페이지 <code>foo.html</code>을 동적 변형인
+      <code>foo.cgi</code>로 브라우저/사용자가 인식하지
+      못하도록 매끄럽게 변환하는 방법입니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>URL을 CGI 스크립트로 재작성하고 핸들러를
+      <strong>cgi-script</strong>로 강제하여 CGI 프로그램으로
+      실행합니다. 이렇게 하면 <code>/~quux/foo.html</code>에
+      대한 요청이 내부적으로 <code>/~quux/foo.cgi</code>의
+      호출로 이어집니다.</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>파일 확장자 변경에 대한 하위 호환성</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p><code>document.YYYY</code>에서
+      <code>document.XXXX</code>로 마이그레이션한 후,
+      예를 들어 <code>.html</code> 파일 묶음을
+      <code>.php</code>로 변환한 후, URL을 하위 호환되게
+      (여전히 가상으로 존재) 만드는 방법은 무엇입니까?</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>새 확장자를 가진 대상 파일이 존재하고 이전
+      확장자를 가진 원래 파일이 존재하지 않는 경우에만
+      이전 확장자에서 새 확장자로 URL을 재작성합니다.
+      그렇지 않으면 URL은 변경되지 않습니다.</p>
+
+<highlight language="config">
+#   backward compatibility ruleset for
+#   rewriting document.html to document.php
+#   when and only when document.php exists
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>토론</dt>
+    <dd>
+    <p>이 예제는 <module>mod_rewrite</module>의 종종 간과되는
+    기능을 사용하며, 규칙 세트의 실행 순서를 활용합니다.
+    특히 <module>mod_rewrite</module>는 RewriteCond 지시어를
+    평가하기 전에 RewriteRule의 왼쪽을 먼저 평가합니다.
+    따라서 RewriteCond 지시어가 평가될 때 $1이 이미
+    정의됩니다. 이를 통해 동일한 기본 파일명을 사용하여
+    원본(<code>document.html</code>)과 대상
+    (<code>document.php</code>) 파일의 존재를 테스트할 수
+    있습니다.</p>
+
+    <p>이 규칙 세트는 디렉토리별 컨텍스트(&lt;Directory&gt;
+    블록 또는 .htaccess 파일)에서 사용하도록 설계되어
+    <code>-f</code> 검사가 올바른 디렉토리 경로를 확인합니다.
+    작업 중인 디렉토리 기본을 지정하기 위해 <directive
+    module="mod_rewrite">RewriteBase</directive> 지시어를
+    설정해야 할 수 있습니다.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>정규 호스트명</title>
+
+      <dl>
+        <dt>설명:</dt>
+
+        <dd>이 규칙의 목표는 사이트에 도달하는 데 사용할 수
+        있는 다른 호스트명 대신 특정 호스트명의 사용을
+        강제하는 것입니다. 예를 들어,
+        <strong>example.com</strong> 대신
+        <strong>www.example.com</strong>의 사용을 강제하려면
+        다음 레시피의 변형을 사용할 수 있습니다.</dd>
+
+        <dt>해결책:</dt>
+
+        <dd>
+
+<p>이를 해결하는 가장 좋은 방법은 <module>mod_rewrite</module>를
+전혀 사용하지 않고, 비정규 호스트명에 대한 가상 호스트에
+<directive module="mod_alias">Redirect</directive> 지시어를
+배치하는 것입니다.</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p><directive module="core" type="section">If</directive>
+지시어를 사용하여 이를 수행할 수도 있습니다:
+(<strong>2.4 이상</strong>)</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>또는 예를 들어 사이트의 일부를 HTTPS로 리다이렉트하려면
+다음과 같이 할 수 있습니다:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>어떤 이유로든 여전히 <module>mod_rewrite</module>를
+사용하고 싶다면 - 예를 들어, 더 큰 RewriteRules 세트와
+함께 사용해야 하는 경우 - 아래 레시피 중 하나를 사용할 수
+있습니다.</p>
+
+<p>포트 80이 아닌 다른 포트에서 실행되는 사이트의 경우:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>그리고 포트 80에서 실행되는 사이트의 경우:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        모든 도메인 이름에 대해 이를 일반적으로 수행하고
+        싶다면 - 즉, 모든 가능한 값의
+        <strong>example.com</strong>에 대해
+        <strong>example.com</strong>을
+        <strong>www.example.com</strong>으로 리다이렉트하려면
+        다음 레시피를 사용할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>이 규칙 세트는 주 서버 설정 파일이나 서버의
+    <directive module="core">DocumentRoot</directive>에 놓인
+    <code>.htaccess</code> 파일에서 모두 작동합니다.</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>여러 디렉토리에서 페이지 검색</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+      <p>특정 자원이 여러 위치 중 하나에 존재할 수 있으며,
+      요청 시 해당 위치에서 자원을 찾고자 합니다. 아마도
+      최근에 디렉토리 구조를 재편하여 콘텐츠를 여러
+      위치로 나누었을 것입니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>다음 규칙 세트는 두 디렉토리에서 자원을 검색하고,
+      어느 곳에서도 찾지 못하면 요청된 위치에서 그대로
+      제공하려고 시도합니다.</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   먼저 dir1/에서 찾아봅니다...
+#   ...찾으면 멈추고 만족합니다:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   다음으로 dir2/에서 찾아봅니다...
+#   ...찾으면 멈추고 만족합니다:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   그렇지 않으면 다른 Alias 또는 ScriptAlias 지시어 등을
+#   위해 계속합니다.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>지리적으로 분산된 서버로의 리다이렉션</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+    <p>웹사이트의 여러 미러가 있으며, 사용자가 위치한
+    국가에 있는 미러로 사용자를 리다이렉트하고자 합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+    <p>요청하는 클라이언트의 호스트명을 확인하여 어느
+    국가에서 오는지 판단합니다. IP 주소 조회가 불가능한
+    경우 기본 서버로 폴백합니다.</p>
+    <p><directive module="mod_rewrite">RewriteMap</directive>
+    지시어를 사용하여 사용할 서버 목록을 작성합니다.</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- 멀티플렉싱 맵<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>토론</dt>
+    <dd>
+    <note type="warning">이 규칙 세트는
+    <directive module="core">HostNameLookups</directive>가
+    <code>on</code>으로 설정되어 있어야 하며, 이는 상당한
+    성능 저하를 초래할 수 있습니다.</note>
+
+    <p><directive module="mod_rewrite">RewriteCond</directive>
+    지시어는 요청하는 클라이언트의 호스트명의 마지막
+    부분인 국가 코드를 캡처하고, 다음 RewriteRule은
+    해당 값을 사용하여 맵 파일에서 적절한 미러 호스트를
+    조회합니다.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>정규 URL</title>
+
+<dl>
+ <dt>설명:</dt>
+
+   <dd>
+     <p>일부 웹 서버에는 하나의 자원에 대해 둘 이상의
+     URL이 있습니다. 보통 실제로 사용되고 배포되는
+     정규 URL이 있고, 단축키, 내부용 등의 URL이 있습니다.
+     사용자가 요청과 함께 어떤 URL을 제공했는지에
+     관계없이 최종적으로 브라우저 주소 표시줄에
+     정규 URL이 표시되어야 합니다.</p>
+   </dd>
+
+   <dt>해결책:</dt>
+
+     <dd>
+       <p>모든 비정규 URL에 대해 외부 HTTP 리다이렉트를
+       수행하여 브라우저의 위치 보기와 모든 후속 요청에서
+       이를 수정합니다. 아래 예제 규칙 세트에서
+       <code>/puppies</code>와 <code>/canines</code>를
+       정규 <code>/dogs</code>로 대체합니다.</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>토론:</dt>
+     <dd>
+     이것은 실제로 Redirect 또는 RedirectMatch 지시어로
+     수행해야 합니다:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title>이동된 <code>DocumentRoot</code></title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+<p>보통 웹 서버의 <directive module="core">DocumentRoot</directive>는
+URL "<code>/</code>"에 직접 관련됩니다. 그러나 종종 이 데이터는
+실제로 최상위 우선 순위가 아닙니다. 예를 들어, 사이트에
+처음 방문하는 방문자가 특정 하위 디렉토리
+<code>/about/</code>으로 이동하기를 원할 수 있습니다.
+다음 규칙 세트를 사용하여 이를 수행할 수 있습니다:</p>
+</dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+      <p>URL <code>/</code>를 <code>/about/</code>으로
+      리다이렉트합니다:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>이것은 <directive module="mod_alias">RedirectMatch</directive>
+지시어를 사용하여도 처리할 수 있습니다:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>또한 이 예제는 루트 URL만 재작성합니다. 즉,
+<code>http://example.com/</code>에 대한 요청만 재작성하고
+<code>http://example.com/page.html</code>에 대한 요청은
+재작성하지 않습니다. 실제로 문서 루트를 변경한 경우 -
+즉, <strong>모든</strong> 콘텐츠가 실제로 해당
+하위 디렉토리에 있는 경우 - URL을 재작성하는 것보다
+<directive module="core">DocumentRoot</directive> 지시어를
+변경하거나 모든 콘텐츠를 한 디렉토리 위로 이동하는 것이
+훨씬 좋습니다.</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>대체 자원</title>
+
+<dl>
+<dt>설명:</dt>
+<dd>특정 디렉토리로 오는 모든 요청을 단일 자원(예를 들어
+index.php와 같은 특정 파일)으로 처리하고 싶지만, 이미지나
+css 파일과 같은 기존 자원에 대한 요청은 제외하고자 합니다.</dd>
+
+<dt>해결책:</dt>
+<dd>
+<p>버전 2.2.16부터 이를 위해 <directive
+module="mod_dir">FallbackResource</directive> 지시어를
+사용해야 합니다:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>그러나 이전 버전의 Apache에서 또는 요구 사항이 이보다
+더 복잡한 경우 동일한 것을 달성하기 위해 다음 재작성
+세트의 변형을 사용할 수 있습니다:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>반면에, 요청된 URI를 index.php에 쿼리 문자열 인수로
+전달하려면 해당 RewriteRule을 다음으로 대체할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>이 규칙 세트는 <code>.htaccess</code> 파일뿐만 아니라
+&lt;Directory&gt; 블록에서도 사용할 수 있습니다.</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>쿼리 문자열 재작성</title>
+
+<dl>
+<dt>설명:</dt>
+<dd>쿼리 문자열에서 특정 값을 캡처하여 대체하거나
+URL의 다른 구성 요소에 통합하고자 합니다.</dd>
+
+<dt>해결책:</dt>
+<dd>
+<p>이 섹션의 많은 해결책은 일치된 값을 %2 역참조에
+남기는 동일한 조건을 사용합니다. %1은 쿼리 문자열의
+시작(관심 키까지)이고, %3은 나머지입니다. 이 조건은
+유연성을 위해 그리고 치환에서 이중
+'&amp;&amp;'을 피하기 위해 다소 복잡합니다.</p>
+<ul>
+  <li>이 해결책은 일치하는 키와 값을 제거합니다:
+
+<highlight language="config">
+# Remove mykey=???
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>이 해결책은 캡처된 값을 URL 치환에 사용하고
+  나머지 원래 쿼리를 '?'를 추가하여 버립니다:
+
+<highlight language="config">
+# Copy from query string to PATH_INFO
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>이 해결책은 후속 조건에서 캡처된 값을 확인합니다:
+
+<highlight language="config">
+# Capture the value of mykey in the query string
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>이 해결책은 이전 것들의 반대로, URL에서 경로
+      구성 요소(아마도 PATH_INFO)를 쿼리 문자열로 복사합니다.
+<highlight language="config">
+# The desired URL might be /products/kitchen-sink, and the script expects
+# /path?products=kitchen-sink.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+
+</manualpage>
index fc4dfefebf26cb01ad30e3c557638c376e1308b4..cc29dd58d1efdea9df720bb2740f1b517c5b25bf 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/remapping.xml.tr b/docs/manual/rewrite/remapping.xml.tr
new file mode 100644 (file)
index 0000000..8400959
--- /dev/null
@@ -0,0 +1,665 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite ile Yeniden Yönlendirme ve Yeniden Eşleme</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+İstekleri yeniden yönlendirmek ve yeniden eşlemek için
+<module>mod_rewrite</module> modülünü nasıl kullanabileceğinizi
+açıklar. Her birinin nasıl çalıştığının ayrıntılı açıklamalarını
+içeren birçok <module>mod_rewrite</module> kullanım örneği
+sunar.</p>
+
+<note type="warning">Bu örneklerin birçoğunun sizin sunucu yapılandırmanızda
+değişiklik yapılmadan çalışmayacağını unutmayın; bu nedenle örnekleri
+yapılandırmanıza kopyalayıp yapıştırmak yerine anlamanız
+önemlidir.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<!--<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>-->
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="old-to-new">
+
+  <title>Eskiden Yeniye (dahili)</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p><code>foo.html</code> sayfasını yakın zamanda
+      <code>bar.html</code> olarak yeniden adlandırdığımızı ve şimdi
+      geriye dönük uyumluluk için eski URL'yi sağlamak istediğimizi
+      varsayalım. Ancak eski URL kullanıcılarının sayfanın yeniden
+      adlandırıldığını fark etmemesini istiyoruz - yani adresin
+      tarayıcılarında değişmesini istemiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Eski URL'yi aşağıdaki kuralla dahili olarak yenisine yeniden
+      yazıyoruz:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>Eskiden Yeniye Yeniden Yazma (harici)</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Yine <code>foo.html</code> sayfasını yakın zamanda
+      <code>bar.html</code> olarak yeniden adlandırdığımızı ve şimdi
+      geriye dönük uyumluluk için eski URL'yi sağlamak istediğimizi
+      varsayalım. Ancak bu sefer eski URL kullanıcılarının yeni URL
+      hakkında bilgilendirilmesini istiyoruz, yani tarayıcılarının
+      Konum alanı da değişmeli.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Tarayıcının ve dolayısıyla kullanıcının görünümünün
+      değişmesini sağlayan yeni URL'ye bir HTTP yönlendirmesi
+      zorluyoruz:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>Tartışma</dt>
+
+    <dd>
+    <p>Bu örnekte, <a href="#old-to-new-intern">dahili</a> örneğin
+    aksine, basitçe Redirect yönergesini kullanabiliriz. Önceki
+    örnekte <module>mod_rewrite</module>, yönlendirmeyi istemciden
+    gizlemek için kullanılmıştı:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>Başka Bir Sunucuya Taşınan Kaynak</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Bir kaynak başka bir sunucuya taşındıysa, insanlar yer
+      imlerini güncellerken URL'lerin eski sunucuda bir süre daha
+      çalışmasını isteyebilirsiniz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Bu URL'leri yeni sunucuya yönlendirmek için
+      <module>mod_rewrite</module> kullanabilirsiniz, ancak Redirect
+      veya RedirectMatch yönergesini kullanmayı da
+      düşünebilirsiniz.</p>
+
+<highlight language="config">
+#mod_rewrite ile
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#RedirectMatch ile
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#Redirect ile
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>Statikten Devingene</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Statik bir sayfa olan <code>foo.html</code>'yi devingen bir
+      varyant olan <code>foo.cgi</code>'ye tarayıcı/kullanıcı fark
+      etmeden sorunsuz bir şekilde nasıl dönüştürebiliriz?</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>URL'yi CGI betiğine yeniden yazar ve işleyiciyi
+      <strong>cgi-script</strong> olarak zorlayarak bir CGI programı
+      olarak yürütülmesini sağlarız. Böylece
+      <code>/~quux/foo.html</code> isteği dahili olarak
+      <code>/~quux/foo.cgi</code>'nin çağrılmasına yol açar.</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>Dosya Uzantısı Değişikliği için Geriye Dönük Uyumluluk</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p><code>document.YYYY</code>'den <code>document.XXXX</code>'e
+      geçiş yaptıktan sonra, örneğin bir dizi <code>.html</code>
+      dosyasını <code>.php</code>'ye çevirdikten sonra URL'leri nasıl
+      geriye dönük uyumlu (sanal olarak hâlâ mevcut) yapabiliriz?</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>URL, yeni uzantılı hedef dosya mevcutsa ve eski uzantılı
+      orijinal dosya mevcut değilse eski uzantıdan yeni uzantıya
+      yeniden yazılır. Aksi takdirde URL değiştirilmeden bırakılır.</p>
+
+<highlight language="config">
+#   document.html'yi document.php'ye yeniden yazma
+#   için geriye dönük uyumluluk kural kümesi
+#   yalnızca document.php varsa
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>Tartışma</dt>
+    <dd>
+    <p>Bu örnek, <module>mod_rewrite</module> modülünün genellikle
+    gözden kaçan bir özelliğini kullanır: kural kümesinin yürütme
+    sırasından yararlanır. Özellikle, <module>mod_rewrite</module>
+    RewriteCond yönergelerini değerlendirmeden önce RewriteRule'un
+    sol tarafını değerlendirir. Sonuç olarak, RewriteCond yönergeleri
+    değerlendirildiğinde $1 zaten tanımlanmış olur. Bu, aynı temel
+    dosya adını kullanarak orijinal (<code>document.html</code>) ve
+    hedef (<code>document.php</code>) dosyaların varlığını
+    sınamamıza olanak tanır.</p>
+
+    <p>Bu kural kümesi dizin başına bağlamda (bir &lt;Directory&gt;
+    bloğunda veya bir .htaccess dosyasında) kullanılmak üzere
+    tasarlanmıştır; böylece <code>-f</code> kontrolleri doğru dizin
+    yoluna bakar. Çalıştığınız dizin tabanını belirtmek için bir
+    <directive module="mod_rewrite">RewriteBase</directive> yönergesi
+    ayarlamanız gerekebilir.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>Kurallı Konak Adları</title>
+
+      <dl>
+        <dt>Açıklama:</dt>
+
+        <dd>Bu kuralın amacı, aynı siteye erişmek için kullanılabilecek
+        diğer konak adları yerine belirli bir konak adının
+        kullanılmasını zorlamaktır. Örneğin,
+        <strong>example.com</strong> yerine
+        <strong>www.example.com</strong> kullanılmasını zorlamak
+        istiyorsanız aşağıdaki tarifin bir varyantını
+        kullanabilirsiniz.</dd>
+
+        <dt>Çözüm:</dt>
+
+        <dd>
+
+<p>Bunu çözmenin en iyi yolu <module>mod_rewrite</module> kullanmak
+değil, kurallı olmayan konak ad(lar)ı için bir sanal konağa yerleştirilmiş
+<directive module="mod_alias">Redirect</directive> yönergesini
+kullanmaktır.</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>Bunu alternatif olarak <directive module="core"
+type="section">If</directive> yönergesini kullanarak da
+gerçekleştirebilirsiniz: (<strong>2.4 ve sonrası</strong>)</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>Veya örneğin, sitenizin bir bölümünü HTTPS'ye yönlendirmek için
+şunları yapabilirsiniz:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>Herhangi bir nedenle hâlâ <module>mod_rewrite</module> kullanmak
+istiyorsanız - örneğin buna daha büyük bir RewriteRules kümesiyle
+birlikte ihtiyaç duyuyorsanız - aşağıdaki tariflerden birini
+kullanabilirsiniz.</p>
+
+<p>80 dışında bir bağlantı noktasında çalışan siteler için:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>80 bağlantı noktasında çalışan bir site için</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        Bunu tüm alan adları için genel olarak yapmak istiyorsanız -
+        yani tüm olası <strong>example.com</strong> değerleri için
+        <strong>example.com</strong>'u
+        <strong>www.example.com</strong>'a yönlendirmek istiyorsanız -
+        aşağıdaki tarifi kullanabilirsiniz:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>Bu kural kümeleri, ana sunucu yapılandırma dosyanızda veya
+    sunucunun <directive module="core">DocumentRoot</directive>
+    dizinine yerleştirilen bir <code>.htaccess</code> dosyasında
+    çalışacaktır.</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>Birden Fazla Dizinde Sayfa Arama</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+      <p>Belirli bir kaynak birkaç yerden birinde olabilir ve
+      istendiğinde bu yerlerde kaynağı aramak istiyoruz. Belki yakın
+      zamanda dizin yapımızı yeniden düzenledik ve içeriği birkaç
+      konuma böldük.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p>Aşağıdaki kural kümesi, kaynağı bulmak için iki dizinde
+      arama yapar ve hiçbirinde bulamazsa istenen konumdan sunmayı
+      dener.</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   önce dir1/ içinde bulmayı dene
+#   ...ve bulunursa dur ve mutlu ol:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   sonra dir2/ içinde bulmayı dene
+#   ...ve bulunursa dur ve mutlu ol:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   yoksa diğer Alias veya ScriptAlias yönergeleri vb. için devam et.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>Coğrafi Olarak Dağıtılmış Sunuculara Yönlendirme</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+    <p>Web sitemizin çok sayıda yansısı var ve insanları bulundukları
+    ülkedeki yansıya yönlendirmek istiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+    <p>İstemcinin konak adına bakarak hangi ülkeden geldiklerini
+    belirliyoruz. IP adreslerini çözümleyemezsek öntanımlı bir
+    sunucuya geri dönüyoruz.</p>
+    <p>Kullanmak istediğimiz sunucuların listesini oluşturmak için
+    bir <directive module="mod_rewrite">RewriteMap</directive>
+    yönergesi kullanacağız.</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- Çoğullama Eşlem Dosyası<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>Tartışma</dt>
+    <dd>
+    <note type="warning">Bu kural kümesi, <directive
+    module="core">HostNameLookups</directive> yönergesinin
+    <code>on</code> olarak ayarlanmasına dayanır; bu da önemli bir
+    performans etkisi olabilir.</note>
+
+    <p><directive module="mod_rewrite">RewriteCond</directive>
+    yönergesi, istemcinin konak adının son bölümünü - ülke kodunu -
+    yakalar ve ardından gelen RewriteRule bu değeri eşlem dosyasında
+    uygun yansı konağını aramak için kullanır.</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>Kurallı URL'ler</title>
+
+<dl>
+ <dt>Açıklama:</dt>
+
+   <dd>
+     <p>Bazı web sunucularında bir kaynak için birden fazla URL
+     bulunur. Genellikle kurallı URL'ler (gerçekten kullanılan ve
+     dağıtılan) ve kısayollar, dahili URL'ler vb. vardır. Kullanıcı
+     istekle hangi URL'yi sağlamış olursa olsun, sonunda tarayıcı
+     adres çubuğunda kurallı olanı görmelidir.</p>
+   </dd>
+
+   <dt>Çözüm:</dt>
+
+     <dd>
+       <p>Tüm kurallı olmayan URL'leri tarayıcının Konum görünümünde
+       düzeltmek ve sonraki tüm istekler için harici bir HTTP
+       yönlendirmesi yapıyoruz. Aşağıdaki örnek kural kümesinde
+       <code>/puppies</code> ve <code>/canines</code> yollarını
+       kurallı <code>/dogs</code> ile değiştiriyoruz.</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>Tartışma:</dt>
+     <dd>
+     Bu gerçekten Redirect veya RedirectMatch yönergeleriyle
+     gerçekleştirilmelidir:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title>Taşınmış <code>DocumentRoot</code></title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+<p>Genellikle web sunucusunun <directive
+module="core">DocumentRoot</directive> dizini doğrudan
+"<code>/</code>" URL'siyle ilişkilidir. Ancak çoğu zaman bu veriler
+gerçekten en üst düzey önceliğe sahip değildir. Örneğin, siteye ilk
+giren ziyaretçilerin belirli bir <code>/about/</code> alt dizinine
+yönlendirilmesini isteyebilirsiniz. Bu, aşağıdaki kural kümesi
+kullanılarak gerçekleştirilebilir:</p>
+</dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+      <p><code>/</code> URL'sini <code>/about/</code> adresine
+      yönlendiriyoruz:</p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>Bunun <directive module="mod_alias">RedirectMatch</directive>
+yönergesi kullanılarak da ele alınabileceğini unutmayın:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>Ayrıca örneğin yalnızca kök URL'yi yeniden yazdığını unutmayın.
+Yani <code>http://example.com/</code> isteğini yeniden yazar ancak
+<code>http://example.com/page.html</code> isteğini yeniden yazmaz.
+Belge kökünüzü gerçekten değiştirdiyseniz - yani tüm içeriğiniz
+aslında o alt dizindeyse - <directive
+module="core">DocumentRoot</directive> yönergesini değiştirmek veya
+tüm içeriği bir dizin yukarı taşımak, URL'leri yeniden yazmaktan
+çok daha tercih edilir.</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>Yedek Kaynak</title>
+
+<dl>
+<dt>Açıklama:</dt>
+<dd>Belirli bir dizine gelen tüm istekleri, bir resim veya css
+dosyası gibi mevcut bir kaynağa gitmesi gerekenler dışında tek bir
+kaynağın (örneğin index.php gibi belirli bir dosyanın) işlemesini
+istiyorsunuz.</dd>
+
+<dt>Çözüm:</dt>
+<dd>
+<p>2.2.16 sürümünden itibaren bunun için <directive
+module="mod_dir">FallbackResource</directive> yönergesini
+kullanmalısınız:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>Ancak Apache'nin önceki sürümlerinde veya ihtiyaçlarınız bundan
+daha karmaşıksa, aynı şeyi gerçekleştirmek için aşağıdaki yeniden
+yazma kümesinin bir varyasyonunu kullanabilirsiniz:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>Diğer taraftan, istenen URI'yi index.php'ye sorgu dizgesi
+argümanı olarak geçirmek isterseniz, o RewriteRule'u şununla
+değiştirebilirsiniz:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>Bu kural kümelerinin bir <code>.htaccess</code> dosyasında ve
+bir &lt;Directory&gt; bloğunda da kullanılabileceğini unutmayın.</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>Sorgu Dizgesini Yeniden Yazma</title>
+
+<dl>
+<dt>Açıklama:</dt>
+<dd>Bir sorgu dizgesinden belirli bir değeri yakalamak ve onu
+değiştirmek veya URL'nin başka bir bileşenine dahil etmek
+istiyorsunuz.</dd>
+
+<dt>Çözümler:</dt>
+<dd>
+<p>Bu bölümdeki çözümlerin birçoğu aynı koşulu kullanır; bu koşul
+eşleşen değeri %2 geri başvurusunda bırakır. %1 sorgu dizgesinin
+başlangıcıdır (ilgili anahtara kadar) ve %3 geri kalanıdır. Bu
+koşul, esneklik ve değiştirmelerde çift '&amp;&amp;' oluşmasını
+önlemek için biraz karmaşıktır.</p>
+<ul>
+  <li>Bu çözüm eşleşen anahtarı ve değeri kaldırır:
+
+<highlight language="config">
+# mykey=??? öğesini kaldır
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>Bu çözüm, yakalanan değeri URL değiştirmesinde kullanır ve
+  sonuna '?' ekleyerek orijinal sorgu dizgesinin geri kalanını
+  atar:
+
+<highlight language="config">
+# Sorgu dizgesinden PATH_INFO'ya kopyala
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>Bu çözüm, yakalanan değeri sonraki bir koşulda kontrol eder:
+
+<highlight language="config">
+# Sorgu dizgesindeki mykey değerini yakala
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>Bu çözüm, önceki çözümlerin tersini gösterir: yol bileşenlerini
+      (belki PATH_INFO) URL'den sorgu dizgesine kopyalar.
+<highlight language="config">
+# İstenen URL /products/kitchen-sink olabilir ve betik
+# /path?products=kitchen-sink bekler.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/remapping.xml.zh-cn b/docs/manual/rewrite/remapping.xml.zh-cn
new file mode 100644 (file)
index 0000000..4f0b277
--- /dev/null
@@ -0,0 +1,622 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933068 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="remapping.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>使用 mod_rewrite 进行重定向和重映射</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了如何使用
+<module>mod_rewrite</module> 来重定向和重映射请求。
+其中包括许多 <module>mod_rewrite</module> 的常见用法示例,
+以及每个示例工作原理的详细描述。</p>
+
+<note type="warning">请注意,这些示例中的许多不会在你的特定服务器配置中直接生效,
+因此理解它们非常重要,而不仅仅是将示例复制粘贴到你的配置中。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<!--<seealso><a href="remapping.html">重定向和重映射</a></seealso>-->
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="old-to-new">
+
+  <title>从旧到新(内部)</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>假设我们最近将页面 <code>foo.html</code> 重命名为
+      <code>bar.html</code>,现在希望提供旧 URL 以实现向后兼容。
+      但是,我们希望旧 URL 的用户甚至不会注意到页面已被重命名——
+      也就是说,我们不希望浏览器中的地址发生变化。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们通过以下规则在内部将旧 URL 重写为新 URL:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>/bar</strong>.html" [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="old-to-new-extern">
+
+  <title>从旧到新的重写(外部)</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>再次假设我们最近将页面 <code>foo.html</code> 重命名为
+      <code>bar.html</code>,现在希望提供旧 URL 以实现向后兼容。
+      但这次我们希望旧 URL 的用户能看到新 URL 的提示,
+      即他们的浏览器地址栏也应该改变。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们强制进行 HTTP 重定向到新 URL,
+      这会导致浏览器以及用户视图的变化:</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteRule    "^<strong>/foo</strong>\.html$"  "<strong>bar</strong>.html"  [<strong>R</strong>]
+</highlight>
+</dd>
+
+<dt>讨论</dt>
+
+    <dd>
+    <p>在本示例中,与上面的<a href="#old-to-new-intern">内部</a>示例不同,
+    我们可以简单地使用 Redirect 指令。在前面的示例中使用
+    <module>mod_rewrite</module> 是为了对客户端隐藏重定向:</p>
+
+    <highlight language="config">
+Redirect "/foo.html" "/bar.html"
+    </highlight>
+
+    </dd>
+  </dl>
+
+</section>
+
+<section id="movehomedirs">
+
+  <title>资源已移至另一台服务器</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>如果资源已移至另一台服务器,你可能希望 URL
+      在旧服务器上继续工作一段时间,以便人们更新书签。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>你可以使用 <module>mod_rewrite</module> 将这些 URL
+      重定向到新服务器,但也可以考虑使用 Redirect 或 RedirectMatch 指令。</p>
+
+<highlight language="config">
+#With mod_rewrite
+RewriteEngine on
+RewriteRule   "^/docs/(.+)"  "http://new.example.com/docs/$1"  [R,L]
+</highlight>
+
+<highlight language="config">
+#With RedirectMatch
+RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1"
+</highlight>
+
+<highlight language="config">
+#With Redirect
+Redirect "/docs/" "http://new.example.com/docs/"
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="static-to-dynamic">
+
+  <title>从静态到动态</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>如何以无缝的方式(即浏览器/用户不会注意到)将静态页面
+      <code>foo.html</code> 转换为动态变体 <code>foo.cgi</code>。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们只需将 URL 重写为 CGI 脚本并强制处理程序为
+      <strong>cgi-script</strong>,使其作为 CGI 程序执行。
+      这样,对 <code>/~quux/foo.html</code> 的请求在内部会导致调用
+      <code>/~quux/foo.cgi</code>。</p>
+
+<highlight language="config">
+RewriteEngine  on
+RewriteBase    "/~quux/"
+RewriteRule    "^foo\.html$"  "foo.cgi"  [H=<strong>cgi-script</strong>]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="backward-compatibility">
+
+  <title>文件扩展名更改的向后兼容性</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>在将 <code>document.YYYY</code> 迁移到
+      <code>document.XXXX</code>(例如将一批 <code>.html</code>
+      文件翻译为 <code>.php</code>)之后,
+      如何使 URL 保持向后兼容(仍然虚拟存在)?</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>仅当具有新扩展名的目标文件存在而具有旧扩展名的原始文件不存在时,
+      才将 URL 从旧扩展名重写为新扩展名。否则,URL 保持不变。</p>
+
+<highlight language="config">
+#   backward compatibility ruleset for
+#   rewriting document.html to document.php
+#   when and only when document.php exists
+&lt;Directory "/var/www/htdocs"&gt;
+    RewriteEngine on
+    RewriteBase   "/var/www/htdocs"
+
+    RewriteCond   "$1.php"           -f
+    RewriteCond   "$1.html"          !-f
+    RewriteRule   "^(.*).html$"      "$1.php"
+&lt;/Directory&gt;
+</highlight>
+    </dd>
+
+    <dt>讨论</dt>
+    <dd>
+    <p>此示例使用了 <module>mod_rewrite</module> 的一个经常被忽视的特性,
+    利用了规则集的执行顺序。特别是,<module>mod_rewrite</module>
+    在求值 RewriteCond 指令之前先求值 RewriteRule 的左侧。
+    因此,在求值 RewriteCond 指令时 $1 已经被定义。
+    这使我们能够使用相同的基础文件名来测试原始文件
+    (<code>document.html</code>)和目标文件
+    (<code>document.php</code>)的存在性。</p>
+
+    <p>此规则集设计用于目录级上下文
+    (在 &lt;Directory&gt; 块或 .htaccess 文件中),
+    以便 <code>-f</code> 检查正确的目录路径。
+    你可能需要设置 <directive
+    module="mod_rewrite">RewriteBase</directive>
+    指令来指定你正在使用的目录基准。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalhost">
+
+<title>规范主机名</title>
+
+      <dl>
+        <dt>描述:</dt>
+
+        <dd>此规则的目标是强制使用特定的主机名,
+        而不是可能用来到达同一站点的其他主机名。
+        例如,如果你希望强制使用
+        <strong>www.example.com</strong> 而不是
+        <strong>example.com</strong>,你可以使用以下方案的变体。</dd>
+
+        <dt>解决方案:</dt>
+
+        <dd>
+
+<p>最佳方式根本不涉及 <module>mod_rewrite</module>,
+而是使用放置在非规范主机名虚拟主机中的
+<directive module="mod_alias">Redirect</directive> 指令。</p>
+
+<highlight language="config">
+&lt;VirtualHost *:80&gt;
+  ServerName undesired.example.com
+  ServerAlias example.com notthis.example.com
+
+  Redirect "/" "http://www.example.com/"
+&lt;/VirtualHost&gt;
+
+&lt;VirtualHost *:80&gt;
+  ServerName www.example.com
+&lt;/VirtualHost&gt;
+</highlight>
+
+<p>你也可以使用
+<directive module="core" type="section">If</directive>
+指令来完成(<strong>2.4 及更高版本</strong>):</p>
+
+<highlight language="config">
+&lt;If "%{HTTP_HOST} != 'www.example.com'"&gt;
+    Redirect "/" "http://www.example.com/"
+&lt;/If&gt;
+</highlight>
+
+<p>或者,例如,要将站点的一部分重定向到 HTTPS,你可以执行以下操作:</p>
+
+<highlight language="config">
+&lt;If "%{SERVER_PROTOCOL} != 'HTTPS'"&gt;
+    Redirect "/admin/" "https://www.example.com/admin/"
+&lt;/If&gt;
+</highlight>
+
+<p>如果出于某种原因你仍然想使用 <module>mod_rewrite</module>——
+例如,你需要它与一组更大的 RewriteRule 一起使用——
+你可以使用以下方案之一。</p>
+
+<p>对于运行在非 80 端口上的站点:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com" [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteCond "%{SERVER_PORT}" "!^80$"
+RewriteRule "^/?(.*)"        "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]
+</highlight>
+
+<p>对于运行在 80 端口上的站点:</p>
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}"   "!^www\.example\.com"       [NC]
+RewriteCond "%{HTTP_HOST}"   "!^$"
+RewriteRule "^/?(.*)"        "http://www.example.com/$1" [L,R,NE]
+</highlight>
+
+        <p>
+        如果你希望对所有域名通用地执行此操作——也就是说,
+        如果你想将 <strong>example.com</strong> 重定向到
+        <strong>www.example.com</strong>,其中
+        <strong>example.com</strong> 可以是任何值,
+        你可以使用以下方案:</p>
+
+<highlight language="config">
+RewriteCond "%{HTTP_HOST}" "!^www\."                    [NC]
+RewriteCond "%{HTTP_HOST}" "!^$"
+RewriteRule "^/?(.*)"      "http://www.%{HTTP_HOST}/$1" [L,R,NE]
+</highlight>
+
+    <p>这些规则集可以在主服务器配置文件中使用,
+    也可以在放置于服务器 <directive
+    module="core">DocumentRoot</directive> 中的
+    <code>.htaccess</code> 文件中使用。</p>
+        </dd>
+      </dl>
+
+</section>
+
+<section id="multipledirs">
+
+  <title>在多个目录中搜索页面</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+      <p>某个特定资源可能存在于多个位置,
+      我们希望在请求时在这些位置中查找该资源。
+      也许我们最近重新整理了目录结构,将内容分散到多个位置。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>以下规则集在两个目录中搜索资源,
+      如果在两个位置都找不到,则尝试从请求的位置直接提供。</p>
+
+<highlight language="config">
+RewriteEngine on
+
+#   first try to find it in dir1/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir1</strong>/$1"  [L]
+
+#   second try to find it in dir2/...
+#   ...and if found stop and be happy:
+RewriteCond         "%{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}"  -f
+RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/<strong>dir2</strong>/$1"  [L]
+
+#   else go on for other Alias or ScriptAlias directives,
+#   etc.
+RewriteRule "^"     "-"                                          [PT]
+</highlight>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="archive-access-multiplexer">
+
+  <title>重定向到地理分布式服务器</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+    <p>我们的网站有多个镜像,
+    希望将用户重定向到距其所在国家最近的镜像。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+    <p>查看请求客户端的主机名,确定他们来自哪个国家。
+    如果无法查找其 IP 地址,则回退到默认服务器。</p>
+    <p>我们将使用 <directive module="mod_rewrite">RewriteMap</directive>
+    指令来构建我们希望使用的服务器列表。</p>
+
+<highlight language="config">
+HostnameLookups on
+RewriteEngine on
+RewriteMap    multiplex         "txt:/path/to/map.mirrors"
+RewriteCond  "%{REMOTE_HOST}"   "([a-z]+)$"                [NC]
+RewriteRule  "^/(.*)$"          "${multiplex:<strong>%1</strong>|http://www.example.com/}$1"  [R,L]
+</highlight>
+
+<example>
+##  map.mirrors -- 多路复用映射<br />
+<br />
+de        http://www.example.de/<br />
+uk        http://www.example.uk/<br />
+com       http://www.example.com/<br />
+##EOF##
+</example>
+    </dd>
+
+    <dt>讨论</dt>
+    <dd>
+    <note type="warning">此规则集依赖于
+    <directive module="core">HostNameLookups</directive>
+    设置为 <code>on</code>,这可能会对性能产生显著影响。</note>
+
+    <p><directive module="mod_rewrite">RewriteCond</directive>
+    捕获请求客户端主机名的最后部分——国家代码——后续的 RewriteRule
+    使用该值在映射文件中查找适当的镜像主机。</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="canonicalurl">
+
+<title>规范 URL</title>
+
+<dl>
+ <dt>描述:</dt>
+
+   <dd>
+     <p>在某些 Web 服务器上,一个资源可能有多个 URL。
+     通常有规范 URL(即实际使用和分发的 URL)
+     和只是快捷方式、内部 URL 等的 URL。
+     无论用户在请求中提供的是哪个 URL,
+     他们最终应在浏览器地址栏中看到规范 URL。</p>
+   </dd>
+
+   <dt>解决方案:</dt>
+
+     <dd>
+       <p>我们对所有非规范 URL 执行外部 HTTP 重定向,
+       以在浏览器的地址视图中修正它们,并用于所有后续请求。
+       在下面的示例规则集中,我们将 <code>/puppies</code> 和
+       <code>/canines</code> 替换为规范的 <code>/dogs</code>。</p>
+
+<highlight language="config">
+RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
+</highlight>
+        </dd>
+
+     <dt>讨论:</dt>
+     <dd>
+     这实际上应该使用 Redirect 或 RedirectMatch 指令来完成:
+
+     <highlight language="config">
+RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2"
+     </highlight>
+     </dd>
+      </dl>
+
+</section>
+
+<section id="moveddocroot">
+
+  <title>移动的 <code>DocumentRoot</code></title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+<p>通常 Web 服务器的 <directive module="core">DocumentRoot</directive>
+直接对应 URL "<code>/</code>"。
+但这些数据通常不是最高优先级的内容。例如,
+你可能希望访客在首次进入站点时转到特定子目录 <code>/about/</code>。
+这可以使用以下规则集来实现:</p>
+</dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+      <p>我们将 URL <code>/</code> 重定向到 <code>/about/</code>:
+      </p>
+
+<highlight language="config">
+RewriteEngine on
+RewriteRule   "^/$"  "/about/"  [<strong>R</strong>]
+</highlight>
+
+<p>请注意,这也可以使用
+<directive module="mod_alias">RedirectMatch</directive> 指令来处理:</p>
+
+<highlight language="config">
+RedirectMatch "^/$" "http://example.com/about/"
+</highlight>
+
+<p>还要注意,此示例仅重写根 URL。也就是说,
+它重写对 <code>http://example.com/</code> 的请求,
+但不会重写对 <code>http://example.com/page.html</code> 的请求。
+如果你确实更改了文档根目录——也就是说,如果你的<strong>所有</strong>内容
+实际上都在该子目录中,那么最好直接更改
+<directive module="core">DocumentRoot</directive> 指令,
+或将所有内容向上移动一个目录,而不是重写 URL。</p>
+</dd>
+</dl>
+
+</section>
+
+<section id="fallback-resource">
+<title>回退资源</title>
+
+<dl>
+<dt>描述:</dt>
+<dd>你希望单个资源(例如某个文件,如 index.php)处理所有进入特定目录的请求,
+但已存在的资源(如图片或 CSS 文件)除外。</dd>
+
+<dt>解决方案:</dt>
+<dd>
+<p>从 2.2.16 版本开始,你应该使用
+<directive module="mod_dir">FallbackResource</directive> 指令来完成:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  FallbackResource index.php
+&lt;/Directory&gt;
+</highlight>
+
+<p>但是,在早期版本的 Apache 中,或者如果你的需求比这更复杂,
+你可以使用以下重写集的变体来实现相同的目的:</p>
+
+<highlight language="config">
+&lt;Directory "/var/www/my_blog"&gt;
+  RewriteBase "/my_blog"
+
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f
+  RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d
+  RewriteRule "^"                                    "index.php" [PT]
+&lt;/Directory&gt;
+</highlight>
+
+<p>另一方面,如果你希望将请求的 URI 作为查询字符串参数传递给 index.php,
+你可以将该 RewriteRule 替换为:</p>
+
+<highlight language="config">
+RewriteRule "(.*)" "index.php?$1" [PT,QSA]
+</highlight>
+
+<p>请注意,这些规则集可以在 <code>.htaccess</code> 文件中使用,
+也可以在 &lt;Directory&gt; 块中使用。</p>
+
+</dd>
+
+</dl>
+
+</section>
+
+<section id="rewrite-query">
+<title>重写查询字符串</title>
+
+<dl>
+<dt>描述:</dt>
+<dd>你想从查询字符串中捕获特定值,并替换它或将其合并到 URL 的另一个组件中。</dd>
+
+<dt>解决方案:</dt>
+<dd>
+<p>本节中的许多解决方案都使用相同的条件,
+该条件将匹配的值留在 %2 反向引用中。%1 是查询字符串的开头
+(直到感兴趣的键),%3 是剩余部分。
+此条件稍微复杂是为了灵活性和避免替换中出现双 '&amp;&amp;'。</p>
+<ul>
+  <li>此解决方案移除匹配的键和值:
+
+<highlight language="config">
+# Remove mykey=???
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1?%1%3"
+</highlight>
+  </li>
+
+  <li>此解决方案在 URL 替换中使用捕获的值,
+  通过附加 '?' 来丢弃其余的原始查询:
+
+<highlight language="config">
+# Copy from query string to PATH_INFO
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteRule "(.*)"            "$1/products/%2/?" [PT]
+</highlight>
+  </li>
+
+  <li>此解决方案在后续条件中检查捕获的值:
+
+<highlight language="config">
+# Capture the value of mykey in the query string
+RewriteCond "%{QUERY_STRING}" "(.*(?:^|&amp;))mykey=([^&amp;]*)&amp;?(.*)&amp;?$"
+RewriteCond "%2"              !=not-so-secret-value
+RewriteRule "(.*)"            "-" [F]
+</highlight>
+  </li>
+
+  <li>此解决方案展示了前面方案的逆操作,
+      将路径组件(可能是 PATH_INFO)从 URL 复制到查询字符串中。
+<highlight language="config">
+# The desired URL might be /products/kitchen-sink, and the script expects
+# /path?products=kitchen-sink.
+RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT]
+</highlight>
+  </li>
+</ul>
+
+</dd>
+
+</dl>
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/rewritemap.xml.de b/docs/manual/rewrite/rewritemap.xml.de
new file mode 100644 (file)
index 0000000..be1b101
--- /dev/null
@@ -0,0 +1,503 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1932819 -->
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>Verwendung von RewriteMap</title>
+  <summary>
+
+    <p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt
+die Verwendung der <directive module="mod_rewrite">RewriteMap</directive>-Direktive
+und bietet Beispiele für jeden der verschiedenen
+<directive module="mod_rewrite">RewriteMap</directive>-Typen.</p>
+
+    <note type="warning">Beachten Sie, dass viele dieser Beispiele nicht unverändert in Ihrer
+speziellen Serverkonfiguration funktionieren werden. Es ist daher wichtig, dass Sie
+sie verstehen, anstatt die Beispiele einfach auszuschneiden und in Ihre
+Konfiguration einzufügen.</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+  <seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+  <seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+  <seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+  <seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+  <seealso><a href="proxy.html">Proxying</a></seealso>
+  <seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+  <seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+  <section id="introduction">
+    <title>Einführung</title>
+
+   <p>
+   Die <directive module="mod_rewrite">RewriteMap</directive>-Direktive
+   definiert eine externe Funktion, die im Kontext von
+   <directive module="mod_rewrite">RewriteRule</directive>- oder
+   <directive module="mod_rewrite">RewriteCond</directive>-Direktiven
+   aufgerufen werden kann, um Umschreibungen durchzuführen, die zu
+   kompliziert oder zu spezialisiert sind, um allein mit regulären
+   Ausdrücken durchgeführt zu werden. Die Quelle für diese Nachschlagung
+   kann einer der in den folgenden Abschnitten aufgeführten Typen sein,
+   die auch in der
+   <directive module="mod_rewrite">RewriteMap</directive>-Referenzdokumentation
+   aufgezählt sind.</p>
+
+   <p>Die Syntax der <directive module="mod_rewrite">RewriteMap</directive>-Direktive
+   lautet wie folgt:</p>
+
+<highlight language="config">
+RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
+</highlight>
+
+    <p>Der <a id="mapfunc" name="mapfunc"><em>MapName</em></a> ist ein
+    beliebiger Name, den Sie der Map zuweisen und den Sie später in
+    Direktiven verwenden. Argumente werden der Map über die folgende
+    Syntax übergeben:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>MapName</em> <code>:</code> <em>LookupKey</em>
+        <code>}</code> <br/> <code>${</code> <em>MapName</em> <code>:</code>
+        <em>LookupKey</em> <code>|</code> <em>DefaultValue</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>Wenn ein solches Konstrukt auftritt, wird die Map <em>MapName</em>
+      konsultiert und der Schlüssel <em>LookupKey</em> nachgeschlagen.
+      Wenn der Schlüssel gefunden wird, wird das Map-Funktions-Konstrukt
+      durch <em>SubstValue</em> ersetzt. Wenn der Schlüssel nicht gefunden
+      wird, wird es durch <em>DefaultValue</em> oder durch den leeren
+      String ersetzt, falls kein <em>DefaultValue</em> angegeben wurde.</p>
+
+    <p>Sie können beispielsweise eine
+      <directive module="mod_rewrite">RewriteMap</directive> wie folgt
+      definieren:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>Sie können diese Map dann in einer
+      <directive module="mod_rewrite">RewriteRule</directive> wie folgt
+      verwenden:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>Ein Standardwert kann für den Fall angegeben werden, dass nichts in
+der Map gefunden wird:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>Verzeichniskontext und .htaccess-Kontext</title>
+<p>
+Die <directive module="mod_rewrite">RewriteMap</directive>-Direktive darf nicht
+in <directive module="core" type="section">Directory</directive>-Abschnitten oder
+<code>.htaccess</code>-Dateien verwendet werden. Sie müssen die Map im Server-
+oder VirtualHost-Kontext deklarieren. Sie können die Map, einmal erstellt, in
+Ihren <directive module="mod_rewrite">RewriteRule</directive>- und
+<directive module="mod_rewrite">RewriteCond</directive>-Direktiven in diesen
+Geltungsbereichen verwenden. Sie können sie nur nicht in diesen Geltungsbereichen
+<strong>deklarieren</strong>.</p>
+</note>
+
+<p>Die folgenden Abschnitte beschreiben die verschiedenen <em>MapType</em>s,
+die verwendet werden können, und geben Beispiele für jeden.</p>
+  </section>
+
+  <section id="int">
+    <title>int: Interne Funktion</title>
+
+    <p>Wenn ein MapType von <code>int</code> verwendet wird, ist die
+    MapSource eine der verfügbaren internen
+    <directive module="mod_rewrite">RewriteMap</directive>-Funktionen.
+    Modulautoren können zusätzliche interne Funktionen bereitstellen,
+    indem sie diese mit der <code>ap_register_rewrite_mapfunc</code>-API
+    registrieren. Die standardmäßig bereitgestellten Funktionen sind:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             Konvertiert den Schlüssel in Großbuchstaben.</li>
+      <li><strong>tolower</strong>:<br/>
+             Konvertiert den Schlüssel in Kleinbuchstaben.</li>
+      <li><strong>escape</strong>:<br/>
+             Übersetzt Sonderzeichen im Schlüssel in
+            Hex-Kodierungen.</li>
+      <li><strong>unescape</strong>:<br/>
+             Übersetzt Hex-Kodierungen im Schlüssel zurück in
+            Sonderzeichen.</li>
+    </ul>
+
+    <p>
+    Um eine dieser Funktionen zu verwenden, erstellen Sie eine
+    <directive module="mod_rewrite">RewriteMap</directive>, die auf die
+    int-Funktion verweist, und verwenden Sie diese dann in Ihrer
+    <directive module="mod_rewrite">RewriteRule</directive>:
+    </p>
+
+   <p><strong>Eine URI auf eine komplett kleingeschriebene Version umleiten</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>Bitte beachten Sie, dass das hier angebotene Beispiel nur zur
+    Veranschaulichung dient und keine Empfehlung ist. Wenn Sie URLs
+    unabhängig von der Groß-/Kleinschreibung machen möchten, ziehen Sie
+    stattdessen die Verwendung von <module>mod_speling</module> in
+    Betracht.
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt: Klartext-Maps</title>
+
+    <p>Wenn ein MapType von <code>txt</code> verwendet wird, ist die
+    MapSource ein Dateisystempfad zu einer Klartext-Zuordnungsdatei,
+    die ein durch Leerzeichen getrenntes Schlüssel/Wert-Paar pro Zeile
+    enthält. Optional kann eine Zeile einen Kommentar enthalten, der
+    mit einem '#'-Zeichen beginnt.</p>
+
+    <p>Eine gültige Text-Rewrite-Map-Datei hat die folgende Syntax:</p>
+
+    <example>
+      # Kommentarzeile<br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong><br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong> # Kommentar<br />
+    </example>
+
+    <p>Wenn die <directive module="mod_rewrite">RewriteMap</directive>
+    aufgerufen wird, wird das Argument im ersten Argument einer Zeile
+    gesucht und, falls gefunden, der Ersetzungswert zurückgegeben.</p>
+
+    <p>Beispielsweise können wir eine Map-Datei verwenden, um
+    Produktnamen in Produkt-IDs für leichter zu merkende URLs
+    zu übersetzen, mit dem folgenden Rezept:</p>
+<p><strong>Produkt-zu-ID-Konfiguration</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>Wir nehmen hier an, dass das <code>prods.php</code>-Skript weiß,
+    was zu tun ist, wenn es ein Argument von <code>id=NOTFOUND</code>
+    erhält, wenn ein Produkt nicht in der Nachschlagetabelle gefunden
+    wird.</p>
+
+    <p>Die Datei <code>/etc/apache2/productmap.txt</code> enthält dann
+    Folgendes:</p>
+
+    <example><title>Produkt-zu-ID-Map</title>
+##<br />
+##  productmap.txt - Produkt-zu-ID-Map-Datei<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>Wenn also <code>http://example.com/product/television</code>
+    angefordert wird, wird die <directive module="mod_rewrite">RewriteRule</directive>
+    angewendet und die Anfrage intern auf
+    <code>/prods.php?id=993</code> abgebildet.</p>
+
+    <note><title>Hinweis: .htaccess-Dateien</title>
+    Das gegebene Beispiel ist für die Verwendung im Server- oder
+    VirtualHost-Kontext konzipiert. Wenn Sie dies in einer
+    <code>.htaccess</code>-Datei verwenden möchten, müssen Sie den
+    führenden Schrägstrich aus dem Umschreibungsmuster entfernen, damit
+    es übereinstimmt:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>Zwischengespeicherte Nachschlagungen</title>
+    <p>
+    Die nachgeschlagenen Schlüssel werden von httpd zwischengespeichert,
+    bis sich die <code>mtime</code> (Änderungszeit) der Map-Datei ändert
+    oder der httpd-Server neu gestartet wird. Dies gewährleistet eine
+    bessere Leistung bei Maps, die von vielen Anfragen aufgerufen werden.
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd: Zufälliger Klartext</title>
+
+    <p>Wenn ein MapType von <code>rnd</code> verwendet wird, ist die
+    MapSource ein Dateisystempfad zu einer Klartext-Zuordnungsdatei,
+    wobei jede Zeile einen Schlüssel und einen oder mehrere durch
+    <code>|</code> getrennte Werte enthält. Einer dieser Werte wird
+    zufällig ausgewählt, wenn der Schlüssel übereinstimmt.</p>
+
+    <p>Sie können beispielsweise die folgende Map-Datei und Direktiven
+    verwenden, um eine zufällige Lastverteilung zwischen mehreren
+    Backend-Servern über einen Reverse-Proxy bereitzustellen. Bilder
+    werden an einen der Server im 'static'-Pool gesendet, während alles
+    andere an einen der Server im 'dynamic'-Pool gesendet wird.</p>
+
+    <example><title>Rewrite-Map-Datei</title>
+##<br />
+##  map.txt -- Umschreibungs-Map<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>Konfigurationsdirektiven</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>Wenn also ein Bild angefordert wird und die erste dieser Regeln
+    übereinstimmt, schlägt <directive module="mod_rewrite">RewriteMap</directive>
+    den String <code>static</code> in der Map-Datei nach, die einen der
+    angegebenen Hostnamen zufällig zurückgibt, der dann im
+    <directive module="mod_rewrite">RewriteRule</directive>-Ziel verwendet wird.</p>
+
+    <p>Wenn Sie möchten, dass einer der Server häufiger ausgewählt wird
+    (zum Beispiel, wenn einer der Server mehr Speicher hat und daher mehr
+    Anfragen verarbeiten kann), listen Sie ihn einfach häufiger in der
+    Map-Datei auf.</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm: DBM-Hash-Datei</title>
+
+    <p>Wenn ein MapType von <code>dbm</code> verwendet wird, ist die
+    MapSource ein Dateisystempfad zu einer DBM-Datenbankdatei, die
+    Schlüssel/Wert-Paare für die Zuordnung enthält. Dies funktioniert
+    genau wie die <code>txt</code>-Map, ist aber viel schneller, da eine
+    DBM indiziert ist, während eine Textdatei dies nicht ist. Dies
+    ermöglicht einen schnelleren Zugriff auf den gewünschten Schlüssel.</p>
+
+    <p>Sie können optional einen bestimmten DBM-Typ angeben:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>Der Typ kann <code>sdbm</code>, <code>gdbm</code>,
+    <code>ndbm</code> oder <code>db</code> sein. Es wird jedoch
+    empfohlen, einfach das mit dem Apache HTTP Server mitgelieferte
+    Dienstprogramm <a href="../programs/httxt2dbm.html">httxt2dbm</a>
+    zu verwenden, da es die korrekte DBM-Bibliothek verwendet, die mit
+    der beim Bau von httpd selbst verwendeten übereinstimmt.</p>
+
+    <p>Um eine DBM-Datei zu erstellen, erstellen Sie zunächst eine
+    Text-Map-Datei wie im Abschnitt <a href="#txt">txt</a> beschrieben.
+    Führen Sie dann <code>httxt2dbm</code> aus:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>Sie können dann die resultierende Datei in Ihrer
+<directive module="mod_rewrite">RewriteMap</directive>-Direktive
+referenzieren:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>Beachten Sie, dass bei einigen DBM-Typen mehr als eine Datei mit
+einem gemeinsamen Basisnamen erzeugt wird. Beispielsweise können zwei
+Dateien namens <code>mapfile.map.dir</code> und
+<code>mapfile.map.pag</code> vorhanden sein. Dies ist normal, und Sie
+müssen nur den Basisnamen <code>mapfile.map</code> in Ihrer
+<directive module="mod_rewrite">RewriteMap</directive>-Direktive
+verwenden.</p>
+</note>
+
+<note><title>Zwischengespeicherte Nachschlagungen</title>
+<p>
+Die nachgeschlagenen Schlüssel werden von httpd zwischengespeichert, bis
+sich die <code>mtime</code> (Änderungszeit) der Map-Datei ändert oder der
+httpd-Server neu gestartet wird. Dies gewährleistet eine bessere Leistung
+bei Maps, die von vielen Anfragen aufgerufen werden.
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg: Externes Umschreibungsprogramm</title>
+
+    <p>Wenn ein MapType von <code>prg</code> verwendet wird, ist die
+    MapSource ein Dateisystempfad zu einem ausführbaren Programm, das
+    das Zuordnungsverhalten bereitstellt. Dies kann eine kompilierte
+    Binärdatei oder ein Programm in einer interpretierten Sprache wie
+    Python oder Perl sein.</p>
+
+    <p>Dieses Programm wird einmal beim Start des Apache HTTP Servers
+    gestartet und kommuniziert dann mit der Umschreibungs-Engine über
+    <code>STDIN</code> und <code>STDOUT</code>. Für jede Map-Funktions-Nachschlagung
+    wird der Schlüssel auf das <code>STDIN</code> des Programms geschrieben,
+    gefolgt von einem Zeilenumbruch. Das Programm sollte eine Zeile von
+    <code>STDIN</code> lesen (bis einschließlich des Zeilenumbruchs) und
+    seine Antwort als einzelne durch einen Zeilenumbruch abgeschlossene
+    Zeile auf <code>STDOUT</code> schreiben. Schlüssel enthalten niemals
+    Zeilenumbrüche; wenn ein Schlüssel mit einem Zeilenumbruch angetroffen
+    wird, schlägt die Nachschlagung fehl.</p>
+
+    <p>Wenn es keinen entsprechenden Nachschlagewert gibt, sollte das
+    Map-Programm den vierstelligen String "<code>NULL</code>" zurückgeben,
+    um dies anzuzeigen. Beachten Sie, dass dieser Vergleich
+    Groß-/Kleinschreibung ignoriert, sodass "null", "Null" usw. ebenfalls
+    als fehlgeschlagene Nachschlagung behandelt werden. Folglich ist es
+    nicht möglich, dass ein Zuordnungsprogramm den literalen String "NULL"
+    als zugeordneten Wert zurückgibt.</p>
+
+    <p>Das <code>STDERR</code> des Programms wird vom httpd-Elternprozess
+    geerbt, sodass alles, was das Programm auf <code>STDERR</code> schreibt,
+    an derselben Stelle wie die eigene Fehlerausgabe von httpd erscheint
+    (typischerweise das <directive module="core">ErrorLog</directive>).</p>
+
+    <p>Externe Umschreibungsprogramme werden nicht gestartet, wenn sie in
+    einem Kontext definiert sind, der <directive
+    module="mod_rewrite">RewriteEngine</directive> nicht auf <code>on</code>
+    gesetzt hat.</p>
+
+    <p>Standardmäßig werden externe Umschreibungsprogramme als der
+    Benutzer:Gruppe ausgeführt, der httpd gestartet hat. Auf
+    UNIX-Systemen kann dies geändert werden, indem Benutzername und
+    Gruppenname als drittes Argument an
+    <directive module="mod_rewrite">RewriteMap</directive> im Format
+    <code>username:groupname</code> übergeben werden.</p>
+
+    <p>Diese Funktion nutzt den <code>rewrite-map</code>-Mutex, der
+    für eine zuverlässige Kommunikation mit dem Programm erforderlich ist.
+    Der Mutex-Mechanismus und die Sperrdatei können mit der
+    <directive module="core">Mutex</directive>-Direktive konfiguriert
+    werden.</p>
+
+    <p>Hier wird ein einfaches Beispiel gezeigt, das alle Bindestriche
+    in einem Anfrage-URI durch Unterstriche ersetzt.</p>
+
+    <p><strong>Umschreibungskonfiguration</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>Vorsicht!</title>
+<ul>
+<li>Halten Sie Ihr Rewrite-Map-Programm so einfach wie möglich. Wenn das
+Programm hängt, wartet httpd unbegrenzt auf eine Antwort von der Map,
+was wiederum dazu führt, dass httpd nicht mehr auf Anfragen reagiert.</li>
+<li>Stellen Sie sicher, dass Sie die Pufferung in Ihrem Programm
+deaktivieren. Im obigen Python-Beispiel geschieht dies durch Übergabe von
+<code>flush=True</code> an <code>print()</code>. Gepufferte I/O bewirkt,
+dass httpd auf die Ausgabe wartet und daher hängen bleibt.</li>
+<li>Denken Sie daran, dass nur eine Kopie des Programms existiert, die
+beim Serverstart gestartet wird. Alle Anfragen müssen durch diesen einen
+Engpass gehen. Dies kann bei vielen Anfragen oder bei einem sehr langsamen
+Skript zu erheblichen Verlangsamungen führen.</li>
+<li>Wenn das Zuordnungsprogramm beendet wird, wird es nicht automatisch
+neu gestartet. Nachfolgende Nachschlagungen werden fehlschlagen, bis der
+Server neu gestartet wird.</li>
+<li>Das Zuordnungsprogramm wird bei jedem Server-Neustart (ob
+graceful oder nicht) beendet und neu gestartet, unabhängig davon,
+ob sich die zugehörigen Konfigurationsdirektiven geändert haben. Beim
+Herunterfahren wird dem Programm <code>SIGTERM</code> gesendet; wenn
+es nicht innerhalb von 3 Sekunden beendet wird, wird <code>SIGKILL</code>
+gesendet.</li>
+</ul>
+</note>
+
+</section>
+
+  <section id="dbd">
+    <title>dbd oder fastdbd: SQL-Abfrage</title>
+
+    <p>Wenn ein MapType von <code>dbd</code> oder <code>fastdbd</code>
+    verwendet wird, ist die MapSource eine SQL-SELECT-Anweisung, die
+    ein einzelnes Argument entgegennimmt und einen einzelnen Wert
+    zurückgibt.</p>
+
+    <p><module>mod_dbd</module> muss so konfiguriert werden, dass es auf
+    die richtige Datenbank zeigt, damit diese Anweisung ausgeführt werden
+    kann.</p>
+
+    <p>Es gibt zwei Formen dieses MapType. Bei Verwendung eines MapType
+    von <code>dbd</code> wird die Abfrage bei jeder Map-Anfrage ausgeführt,
+    während bei <code>fastdbd</code> die Datenbank-Nachschlagungen intern
+    zwischengespeichert werden. Obwohl <code>fastdbd</code> effizienter
+    und daher schneller ist, werden Änderungen an der Datenbank erst nach
+    einem Neustart des Servers übernommen.</p>
+
+    <p>Wenn eine Abfrage mehr als eine Zeile zurückgibt, wird eine
+    zufällige Zeile aus der Ergebnismenge verwendet.</p>
+
+    <example><title>Beispiel</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>Hinweis</title>
+    <p>Der Abfragename wird als Label für eine vorbereitete
+    SQL-Anweisung an den Datenbanktreiber übergeben und muss daher alle
+    Regeln (wie Groß-/Kleinschreibung) einhalten, die Ihre Datenbank
+    erfordert.</p></note>
+
+  </section>
+  <section id="summary">
+    <title>Zusammenfassung</title>
+
+    <p>Die <directive module="mod_rewrite">RewriteMap</directive>-Direktive
+    kann mehrfach vorkommen. Verwenden Sie für jede Zuordnungsfunktion eine
+    <directive module="mod_rewrite">RewriteMap</directive>-Direktive, um
+    ihre Umschreibungs-Map-Datei zu deklarieren.</p>
+
+    <p>Obwohl Sie eine Map nicht im Verzeichniskontext
+    (<code>.htaccess</code>-Dateien oder
+    <directive module="core" type="section">Directory</directive>-Blöcke)
+    <strong>deklarieren</strong> können, ist es möglich, diese Map im
+    Verzeichniskontext zu <strong>verwenden</strong>.</p>
+
+  </section>
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/rewritemap.xml.es b/docs/manual/rewrite/rewritemap.xml.es
new file mode 100644 (file)
index 0000000..aab13ac
--- /dev/null
@@ -0,0 +1,486 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1932819 -->
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>Uso de RewriteMap</title>
+  <summary>
+
+    <p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+el uso de la directiva <directive module="mod_rewrite">RewriteMap</directive>,
+y proporciona ejemplos de cada uno de los diversos tipos de <directive module="mod_rewrite"
+>RewriteMap</directive>.</p>
+
+    <note type="warning">Tenga en cuenta que muchos de estos ejemplos no funcionarán sin cambios en su
+configuración particular del servidor, por lo que es importante que los
+entienda, en lugar de simplemente copiar y pegar los ejemplos en su
+configuración.</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+  <seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+  <seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+  <seealso><a href="access.html">Control de acceso</a></seealso>
+  <seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+  <seealso><a href="proxy.html">Proxy</a></seealso>
+  <seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+  <seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+  <section id="introduction">
+    <title>Introducción</title>
+
+   <p>
+   La directiva <directive module="mod_rewrite">RewriteMap</directive>
+   define una función externa que puede ser llamada en el contexto de
+   directivas <directive module="mod_rewrite">RewriteRule</directive> o
+   <directive module="mod_rewrite">RewriteCond</directive> para
+   realizar reescrituras que son demasiado complicadas, o demasiado especializadas para ser
+   realizadas solo con expresiones regulares. La fuente de esta búsqueda puede
+   ser cualquiera de los tipos listados en las secciones siguientes, y enumerados en
+   la documentación de referencia de <directive module="mod_rewrite">RewriteMap</directive>.</p>
+
+   <p>La sintaxis de la directiva <directive module="mod_rewrite">RewriteMap</directive>
+   es la siguiente:</p>
+
+<highlight language="config">
+RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
+</highlight>
+
+    <p>El <a id="mapfunc" name="mapfunc"><em>MapName</em></a> es un
+    nombre arbitrario que asigna al mapa, y que usará en
+    directivas más adelante. Los argumentos se pasan al mapa a través de la
+    siguiente sintaxis:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>MapName</em> <code>:</code> <em>LookupKey</em>
+        <code>}</code> <br/> <code>${</code> <em>MapName</em> <code>:</code>
+        <em>LookupKey</em> <code>|</code> <em>DefaultValue</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>Cuando se encuentra tal construcción, se consulta el mapa <em>MapName</em>
+      y se busca la clave <em>LookupKey</em>. Si la
+      clave se encuentra, la construcción de función de mapa se sustituye por
+      <em>SubstValue</em>. Si la clave no se encuentra entonces se
+      sustituye por <em>DefaultValue</em> o por la cadena vacía
+      si no se especificó <em>DefaultValue</em>.</p>
+
+    <p>Por ejemplo, puede definir un
+      <directive module="mod_rewrite">RewriteMap</directive> como:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>Entonces podrá usar este mapa en una
+      <directive module="mod_rewrite">RewriteRule</directive> de la siguiente manera:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>Se puede especificar un valor predeterminado en caso de que no se encuentre nada
+en el mapa:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>Contexto per-directorio y .htaccess</title>
+<p>
+La directiva <directive module="mod_rewrite">RewriteMap</directive> no puede usarse
+en secciones <directive module="core" type="section">Directory</directive> ni en
+archivos <code>.htaccess</code>. Debe
+declarar el mapa en contexto de servidor o virtualhost. Puede usar el mapa,
+una vez creado, en sus directivas <directive module="mod_rewrite">RewriteRule</directive> y
+<directive module="mod_rewrite">RewriteCond</directive> en esos
+ámbitos. Simplemente no puede <strong>declararlo</strong> en esos ámbitos.</p>
+</note>
+
+<p>Las secciones siguientes describen los diversos <em>MapType</em>s que
+pueden usarse, y dan ejemplos de cada uno.</p>
+  </section>
+
+  <section id="int">
+    <title>int: Función Interna</title>
+
+    <p>Cuando se usa un MapType de <code>int</code>, el MapSource es una
+    de las funciones internas disponibles de <directive module="mod_rewrite">RewriteMap</directive>.
+    Los autores de módulos pueden proporcionar
+    funciones internas adicionales registrándolas con la
+    API <code>ap_register_rewrite_mapfunc</code>.
+    Las funciones que se proporcionan por defecto son:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             Convierte la clave a todo mayúsculas.</li>
+      <li><strong>tolower</strong>:<br/>
+             Convierte la clave a todo minúsculas.</li>
+      <li><strong>escape</strong>:<br/>
+             Traduce caracteres especiales en la clave a
+            codificaciones hexadecimales.</li>
+      <li><strong>unescape</strong>:<br/>
+             Traduce codificaciones hexadecimales en la clave de vuelta a
+            caracteres especiales.</li>
+    </ul>
+
+    <p>
+    Para usar una de estas funciones, cree un <directive module="mod_rewrite"
+    >RewriteMap</directive> que referencie
+    la función int, y luego úselo en su <directive module="mod_rewrite"
+    >RewriteRule</directive>:
+    </p>
+
+   <p><strong>Redirigir una URI a una versión toda en minúsculas de sí misma</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>Por favor tenga en cuenta que el ejemplo ofrecido aquí es para
+    fines ilustrativos únicamente, y no es una recomendación. Si desea
+    hacer URLs insensibles a mayúsculas/minúsculas, considere usar
+    <module>mod_speling</module> en su lugar.
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt: Mapas de texto plano</title>
+
+    <p>Cuando se usa un MapType de <code>txt</code>, el MapSource es una ruta del sistema de archivos a un
+    archivo de mapeo de texto plano, que contiene un par clave/valor separado por espacios
+    por línea. Opcionalmente, una línea puede contener un comentario, comenzando con
+    un carácter '#'.</p>
+
+    <p>Un archivo de mapa de reescritura de texto válido tendrá la siguiente sintaxis:</p>
+
+    <example>
+      # Línea de comentario<br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong><br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong> # comentario<br />
+    </example>
+
+    <p>Cuando se invoca el <directive module="mod_rewrite">RewriteMap</directive>,
+    el argumento se busca en el
+    primer argumento de una línea, y, si se encuentra, se devuelve el valor de
+    sustitución.</p>
+
+    <p>Por ejemplo, podemos usar un archivo de mapa para traducir nombres de productos a
+    IDs de productos para URLs más fáciles de recordar, usando la siguiente
+    receta:</p>
+<p><strong>Configuración de Producto a ID</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>Asumimos aquí que el script <code>prods.php</code> sabe qué
+    hacer cuando recibe un argumento de <code>id=NOTFOUND</code> cuando
+    un producto no se encuentra en el mapa de búsqueda.</p>
+
+    <p>El archivo <code>/etc/apache2/productmap.txt</code> entonces contiene
+    lo siguiente:</p>
+
+    <example><title>Mapa de Producto a ID</title>
+##<br />
+##  productmap.txt - Archivo de mapa de Producto a ID<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>Así, cuando se solicita <code>http://example.com/product/television</code>,
+    se aplica la <directive module="mod_rewrite">RewriteRule</directive>,
+    y la solicitud
+    se mapea internamente a <code>/prods.php?id=993</code>.</p>
+
+    <note><title>Nota: archivos .htaccess</title>
+    El ejemplo dado está diseñado para usarse en contexto de servidor o virtualhost.
+    Si planea usarlo en un archivo <code>.htaccess</code>,
+    necesitará eliminar la barra inicial del patrón de
+    reescritura para que coincida con algo:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>Búsquedas en caché</title>
+    <p>
+    Las claves buscadas son almacenadas en caché por httpd hasta que el <code>mtime</code>
+    (tiempo de modificación) del archivo de mapa cambia, o el servidor httpd se
+    reinicia. Esto asegura un mejor rendimiento en mapas que son llamados
+    por muchas solicitudes.
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd: Texto Plano Aleatorizado</title>
+
+    <p>Cuando se usa un MapType de <code>rnd</code>, el MapSource es una
+    ruta del sistema de archivos a un archivo de mapeo de texto plano, cada línea del cual
+    contiene una clave, y uno o más valores separados por <code>|</code>.
+    Uno de estos valores se elegirá al azar si la clave
+    coincide.</p>
+
+    <p>Por ejemplo, puede usar el siguiente archivo de mapa
+    y directivas para proporcionar un balanceo de carga aleatorio entre
+    varios servidores backend, a través de un proxy inverso. Las imágenes se envían
+    a uno de los servidores en el grupo 'static', mientras que todo
+    lo demás se envía a uno del grupo 'dynamic'.</p>
+
+    <example><title>Archivo de mapa de reescritura</title>
+##<br />
+##  map.txt -- mapa de reescritura<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>Directivas de configuración</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>Así, cuando se solicita una imagen y la primera de estas reglas
+    coincide, <directive module="mod_rewrite">RewriteMap</directive> busca la cadena
+    <code>static</code> en el archivo de mapa, que devuelve uno de los
+    nombres de host especificados al azar, que luego se usa en el
+    destino de la <directive module="mod_rewrite">RewriteRule</directive>.</p>
+
+    <p>Si quisiera que uno de los servidores sea más probable de ser elegido
+    (por ejemplo, si uno de los servidores tiene más memoria que los otros,
+    y por lo tanto puede manejar más solicitudes) simplemente listelo más veces en el
+    archivo de mapa.</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm: Archivo Hash DBM</title>
+
+    <p>Cuando se usa un MapType de <code>dbm</code>, el MapSource es una
+    ruta del sistema de archivos a un archivo de base de datos DBM que contiene pares clave/valor para
+    ser usados en el mapeo. Esto funciona exactamente igual que el
+    mapa <code>txt</code>, pero es mucho más rápido, porque un DBM está indexado,
+    mientras que un archivo de texto no. Esto permite un acceso más rápido a la
+    clave deseada.</p>
+
+    <p>Opcionalmente puede especificar un tipo particular de dbm:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>El tipo puede ser <code>sdbm</code>, <code>gdbm</code>, <code>ndbm</code>
+    o <code>db</code>.
+    Sin embargo, se recomienda que simplemente use la utilidad <a
+    href="../programs/httxt2dbm.html">httxt2dbm</a> que se
+    proporciona con Apache HTTP Server, ya que usará la biblioteca DBM correcta,
+    que coincida con la que se usó cuando se compiló httpd mismo.</p>
+
+    <p>Para crear un archivo dbm, primero cree un archivo de mapa de texto como se describe
+    en la sección <a href="#txt">txt</a>. Luego ejecute
+    <code>httxt2dbm</code>:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>Luego puede referenciar el archivo resultante en su
+directiva <directive module="mod_rewrite">RewriteMap</directive>:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>Tenga en cuenta que con algunos tipos de dbm, se genera más de un archivo, con
+un nombre base común. Por ejemplo, puede tener dos archivos llamados
+<code>mapfile.map.dir</code> y <code>mapfile.map.pag</code>. Esto es
+normal, y solo necesita usar el nombre base <code>mapfile.map</code> en
+su directiva <directive module="mod_rewrite">RewriteMap</directive>.</p>
+</note>
+
+<note><title>Búsquedas en caché</title>
+<p>
+Las claves buscadas son almacenadas en caché por httpd hasta que el <code>mtime</code>
+(tiempo de modificación) del archivo de mapa cambia, o el servidor httpd se
+reinicia. Esto asegura un mejor rendimiento en mapas que son llamados
+por muchas solicitudes.
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg: Programa de Reescritura Externo</title>
+
+    <p>Cuando se usa un MapType de <code>prg</code>, el MapSource es una
+    ruta del sistema de archivos a un programa ejecutable que proporcionará el
+    comportamiento de mapeo. Puede ser un archivo binario compilado, o un programa
+    en un lenguaje interpretado como Python o Perl.</p>
+
+    <p>Este programa se inicia una vez, cuando se inicia Apache HTTP Server,
+    y luego se comunica con el motor de reescritura a través de
+    <code>STDIN</code> y <code>STDOUT</code>. Para cada búsqueda de función de mapa,
+    la clave se escribe en el <code>STDIN</code> del programa,
+    seguida de un carácter de nueva línea. El programa debería leer una línea
+    de <code>STDIN</code> (hasta e incluyendo la nueva línea), y
+    escribir su respuesta como una única línea terminada en nueva línea en
+    <code>STDOUT</code>. Las claves nunca contendrán caracteres de nueva línea;
+    si se encuentra una clave que contenga una nueva línea, la búsqueda
+    fallará.</p>
+
+    <p>Si no hay un valor de búsqueda correspondiente, el programa de mapa
+    debería devolver la cadena de cuatro caracteres "<code>NULL</code>" para
+    indicar esto. Tenga en cuenta que esta comparación no distingue entre mayúsculas y minúsculas, así que
+    "null", "Null", etc. también se tratan como una búsqueda fallida. Como
+    consecuencia, no es posible que un programa de mapeo devuelva
+    la cadena literal "NULL" como valor mapeado.</p>
+
+    <p>El <code>STDERR</code> del programa se hereda del
+    proceso padre de httpd, por lo que cualquier cosa que el programa escriba en
+    <code>STDERR</code> terminará en el mismo lugar que la propia
+    salida de errores de httpd (típicamente el <directive
+    module="core">ErrorLog</directive>).</p>
+
+    <p>Los programas de reescritura externos no se inician si están definidos en
+    un contexto que no tiene <directive
+    module="mod_rewrite">RewriteEngine</directive> establecido a
+    <code>on</code>.</p>
+
+    <p>Por defecto, los programas de reescritura externos se ejecutan como el
+    usuario:grupo que inició httpd. Esto puede cambiarse en sistemas UNIX
+    pasando nombre de usuario y nombre de grupo como tercer argumento a
+    <directive module="mod_rewrite">RewriteMap</directive> en el
+    formato <code>username:groupname</code>.</p>
+
+    <p>Esta característica utiliza el mutex <code>rewrite-map</code>,
+    que es necesario para una comunicación fiable con el programa.
+    El mecanismo de mutex y el archivo de bloqueo pueden configurarse con la
+    directiva <directive module="core">Mutex</directive>.</p>
+
+    <p>Aquí se muestra un ejemplo simple que reemplazará todos los guiones con
+    guiones bajos en una URI de solicitud.</p>
+
+    <p><strong>Configuración de reescritura</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>¡Precaución!</title>
+<ul>
+<li>Mantenga su programa de mapa de reescritura lo más simple posible. Si el programa
+se cuelga, causará que httpd espere indefinidamente por una respuesta del
+mapa, lo que a su vez causará que httpd deje de responder a
+solicitudes.</li>
+<li>Asegúrese de desactivar el buffering en su programa. En el ejemplo de Python
+anterior, esto se hace pasando <code>flush=True</code> a
+<code>print()</code>. La E/S con buffer causará que httpd espere la
+salida, y por lo tanto se colgará.</li>
+<li>Recuerde que solo hay una copia del programa, iniciada al
+arrancar el servidor. Todas las solicitudes necesitarán pasar por este único cuello de botella.
+Esto puede causar ralentizaciones significativas si muchas solicitudes deben pasar por
+este proceso, o si el script en sí es muy lento.</li>
+<li>Si el programa de mapeo termina, no se reiniciará automáticamente.
+Las búsquedas posteriores fallarán hasta que el servidor sea
+reiniciado.</li>
+<li>El programa de mapeo siempre se mata y reinicia en cualquier
+reinicio del servidor (graceful o de otro tipo), independientemente de si las
+directivas de configuración relacionadas han cambiado. Al apagar, se envía
+<code>SIGTERM</code> al programa; si no sale dentro de 3 segundos, se
+le envía <code>SIGKILL</code>.</li>
+</ul>
+</note>
+
+</section>
+
+
+  <section id="dbd">
+    <title>dbd o fastdbd: Consulta SQL</title>
+
+    <p>Cuando se usa un MapType de <code>dbd</code> o <code>fastdbd</code>,
+    el MapSource es una sentencia SQL SELECT que toma un solo
+    argumento y devuelve un solo valor.</p>
+
+    <p><module>mod_dbd</module> necesitará estar configurado para apuntar a
+    la base de datos correcta para que esta sentencia se ejecute.</p>
+
+    <p>Hay dos formas de este MapType.
+    Usar un MapType de <code>dbd</code> causa que la consulta se
+    ejecute con cada solicitud de mapa, mientras que usar <code>fastdbd</code>
+    almacena en caché las búsquedas de base de datos internamente. Así, mientras que
+    <code>fastdbd</code> es más eficiente, y por lo tanto más rápido, no
+    reflejará los cambios en la base de datos hasta que el servidor sea
+    reiniciado.</p>
+
+    <p>Si una consulta devuelve más de una fila, se usa una fila aleatoria del
+    conjunto de resultados.</p>
+
+    <example><title>Ejemplo</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>Nota</title>
+    <p>El nombre de la consulta se pasa al controlador de base de datos como una etiqueta para
+    una sentencia SQL preparada, y por lo tanto necesitará seguir cualquier regla
+    (como sensibilidad a mayúsculas/minúsculas) requerida por su base de datos.</p></note>
+
+  </section>
+  <section id="summary">
+    <title>Resumen</title>
+
+    <p>La directiva <directive module="mod_rewrite">RewriteMap</directive> puede
+    aparecer más de una vez. Para cada función de mapeo use una
+    directiva <directive module="mod_rewrite">RewriteMap</directive> para declarar
+    su archivo de mapa de reescritura.</p>
+
+    <p>Aunque no puede <strong>declarar</strong> un mapa en
+    contexto per-directorio (archivos <code>.htaccess</code> o
+    bloques <directive module="core" type="section">Directory</directive>) es
+    posible <strong>usar</strong> este mapa en contexto per-directorio.</p>
+
+  </section>
+</manualpage>
diff --git a/docs/manual/rewrite/rewritemap.xml.ja b/docs/manual/rewrite/rewritemap.xml.ja
new file mode 100644 (file)
index 0000000..558a049
--- /dev/null
@@ -0,0 +1,475 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1932819 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>RewriteMap の使用</title>
+  <summary>
+
+    <p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<directive module="mod_rewrite">RewriteMap</directive> ディレクティブの使用方法を
+説明し、さまざまな <directive module="mod_rewrite">RewriteMap</directive>
+タイプの例を提供します。</p>
+
+    <note type="warning">これらの例の多くは、特定のサーバ設定ではそのまま
+動作しないことに注意してください。そのため、単にコピー&ペーストするのではなく、
+内容を理解することが重要です。</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+  <seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+  <seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+  <seealso><a href="access.html">アクセス制御</a></seealso>
+  <seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+  <seealso><a href="proxy.html">プロキシ</a></seealso>
+  <seealso><a href="advanced.html">高度なテクニック</a></seealso>
+  <seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+  <section id="introduction">
+    <title>はじめに</title>
+
+   <p>
+   <directive module="mod_rewrite">RewriteMap</directive> ディレクティブは、
+   <directive module="mod_rewrite">RewriteRule</directive> または
+   <directive module="mod_rewrite">RewriteCond</directive> ディレクティブの
+   コンテキストで呼び出せる外部関数を定義し、正規表現だけでは実行が
+   複雑すぎたり特殊すぎたりする書き換えを行います。この検索のソースは、
+   以下のセクションに記載されているタイプのいずれかで、
+   <directive module="mod_rewrite">RewriteMap</directive> リファレンス
+   ドキュメントに列挙されています。</p>
+
+   <p><directive module="mod_rewrite">RewriteMap</directive>
+   ディレクティブの構文は以下の通りです:</p>
+
+<highlight language="config">
+RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
+</highlight>
+
+    <p><a id="mapfunc" name="mapfunc"><em>MapName</em></a> は、
+    マップに割り当てる任意の名前で、後のディレクティブで使用します。
+    引数は以下の構文でマップに渡されます:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>MapName</em> <code>:</code> <em>LookupKey</em>
+        <code>}</code> <br/> <code>${</code> <em>MapName</em> <code>:</code>
+        <em>LookupKey</em> <code>|</code> <em>DefaultValue</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>このような構文が出現すると、マップ <em>MapName</em> が参照され、
+      キー <em>LookupKey</em> が検索されます。キーが見つかった場合、
+      マップ関数の構文は <em>SubstValue</em> で置換されます。キーが
+      見つからなかった場合は、<em>DefaultValue</em> で置換されるか、
+      <em>DefaultValue</em> が指定されていない場合は空文字列で
+      置換されます。</p>
+
+    <p>例えば、<directive module="mod_rewrite">RewriteMap</directive> を
+      以下のように定義できます:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>その後、このマップを <directive module="mod_rewrite">RewriteRule</directive>
+      で以下のように使用できます:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>マップで何も見つからなかった場合に備えて、デフォルト値を指定
+できます:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>ディレクトリ単位および .htaccess コンテキスト</title>
+<p>
+<directive module="mod_rewrite">RewriteMap</directive> ディレクティブは
+<directive module="core" type="section">Directory</directive> セクションや
+<code>.htaccess</code> ファイルでは使用できません。マップはサーバまたは
+バーチャルホストのコンテキストで宣言する必要があります。作成したマップは、
+それらのスコープ内の <directive module="mod_rewrite">RewriteRule</directive>
+および <directive module="mod_rewrite">RewriteCond</directive>
+ディレクティブで使用できます。それらのスコープでマップを
+<strong>宣言</strong>することはできません。</p>
+</note>
+
+<p>以下のセクションでは、使用可能なさまざまな <em>MapType</em> を
+説明し、それぞれの例を示します。</p>
+  </section>
+
+  <section id="int">
+    <title>int: 内部関数</title>
+
+    <p>MapType に <code>int</code> を使用すると、MapSource は利用可能な
+    内部 <directive module="mod_rewrite">RewriteMap</directive> 関数の
+    いずれかになります。モジュール作成者は、
+    <code>ap_register_rewrite_mapfunc</code> API を使用して追加の内部
+    関数を登録できます。
+    デフォルトで提供される関数は以下の通りです:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             キーをすべて大文字に変換します。</li>
+      <li><strong>tolower</strong>:<br/>
+             キーをすべて小文字に変換します。</li>
+      <li><strong>escape</strong>:<br/>
+             キー内の特殊文字を 16 進エンコーディングに変換します。</li>
+      <li><strong>unescape</strong>:<br/>
+             キー内の 16 進エンコーディングを特殊文字に戻します。</li>
+    </ul>
+
+    <p>
+    これらの関数のいずれかを使用するには、int 関数を参照する
+    <directive module="mod_rewrite">RewriteMap</directive> を作成し、
+    <directive module="mod_rewrite">RewriteRule</directive> で使用します:
+    </p>
+
+   <p><strong>URI をすべて小文字のバージョンにリダイレクト</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>ここで提供されている例は説明目的のみであり、推奨ではありません。
+    URL を大文字小文字を区別しないようにしたい場合は、代わりに
+    <module>mod_speling</module> の使用を検討してください。
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt: プレーンテキストマップ</title>
+
+    <p>MapType に <code>txt</code> を使用すると、MapSource はプレーンテキストの
+    マッピングファイルへのファイルシステムパスで、1 行に 1 つのスペース区切りの
+    キー/値ペアが含まれます。オプションで、'#' 文字で始まるコメント行を
+    含めることができます。</p>
+
+    <p>有効なテキスト書き換えマップファイルの構文は以下の通りです:</p>
+
+    <example>
+      # コメント行<br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong><br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong> # コメント<br />
+    </example>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive> が呼び出されると、
+    引数が各行の最初の引数から検索され、見つかった場合は置換値が
+    返されます。</p>
+
+    <p>例えば、マップファイルを使用して製品名を製品 ID に変換し、
+    覚えやすい URL を実現するには、以下のレシピを使用できます:</p>
+<p><strong>製品から ID への設定</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>ここでは、<code>prods.php</code> スクリプトが
+    <code>id=NOTFOUND</code> という引数を受け取った場合の処理を
+    理解していると仮定しています (検索マップで製品が見つからなかった場合)。</p>
+
+    <p>ファイル <code>/etc/apache2/productmap.txt</code> には
+    以下が含まれます:</p>
+
+    <example><title>製品から ID へのマップ</title>
+##<br />
+##  productmap.txt - 製品から ID へのマップファイル<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>したがって、<code>http://example.com/product/television</code> が
+    リクエストされると、<directive module="mod_rewrite">RewriteRule</directive>
+    が適用され、リクエストは内部的に <code>/prods.php?id=993</code>
+    にマッピングされます。</p>
+
+    <note><title>注: .htaccess ファイル</title>
+    この例はサーバまたはバーチャルホストのスコープで使用するよう
+    作成されています。<code>.htaccess</code> ファイルで使用する場合は、
+    何かにマッチするように書き換えパターンから先頭のスラッシュを
+    削除する必要があります:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>キャッシュされた検索</title>
+    <p>
+    検索されたキーは、マップファイルの <code>mtime</code> (変更時刻) が
+    変更されるか、httpd サーバが再起動されるまで httpd にキャッシュ
+    されます。これにより、多くのリクエストで呼び出されるマップの
+    パフォーマンスが向上します。
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd: ランダム化プレーンテキスト</title>
+
+    <p>MapType に <code>rnd</code> を使用すると、MapSource はプレーンテキストの
+    マッピングファイルへのファイルシステムパスで、各行にはキーと
+    <code>|</code> で区切られた 1 つ以上の値が含まれます。キーが
+    マッチすると、これらの値の 1 つがランダムに選択されます。</p>
+
+    <p>例えば、以下のマップファイルとディレクティブを使用して、
+    リバースプロキシ経由で複数のバックエンドサーバ間のランダムな
+    ロードバランシングを提供できます。画像は 'static' プール内の
+    サーバの 1 つに送信され、それ以外は 'dynamic' プールの 1 つに
+    送信されます。</p>
+
+    <example><title>書き換えマップファイル</title>
+##<br />
+##  map.txt -- 書き換えマップ<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>設定ディレクティブ</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>画像がリクエストされ、最初のルールがマッチすると、
+    <directive module="mod_rewrite">RewriteMap</directive> はマップファイルで
+    文字列 <code>static</code> を検索し、指定されたホスト名の 1 つを
+    ランダムに返します。それが <directive module="mod_rewrite">RewriteRule</directive>
+    のターゲットで使用されます。</p>
+
+    <p>サーバの 1 つがより多く選択されるようにしたい場合
+    (例えば、サーバの 1 つがより多くのメモリを持ち、より多くの
+    リクエストを処理できる場合)、マップファイルにそのサーバを
+    複数回記述してください。</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm: DBM ハッシュファイル</title>
+
+    <p>MapType に <code>dbm</code> を使用すると、MapSource はマッピングで
+    使用されるキー/値ペアを含む DBM データベースファイルへの
+    ファイルシステムパスです。これは <code>txt</code> マップと
+    まったく同じように動作しますが、DBM はインデックス化されており
+    テキストファイルはそうではないため、はるかに高速です。これにより、
+    目的のキーへのアクセスが高速になります。</p>
+
+    <p>特定の dbm タイプをオプションで指定できます:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>タイプは <code>sdbm</code>、<code>gdbm</code>、<code>ndbm</code>、
+    または <code>db</code> です。
+    ただし、Apache HTTP Server に付属の <a
+    href="../programs/httxt2dbm.html">httxt2dbm</a> ユーティリティを
+    使用することを推奨します。httpd 自体のビルド時に使用されたものと
+    マッチする正しい DBM ライブラリを使用するためです。</p>
+
+    <p>dbm ファイルを作成するには、まず <a href="#txt">txt</a> セクションで
+    説明されているテキストマップファイルを作成し、次に
+    <code>httxt2dbm</code> を実行します:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>その後、<directive module="mod_rewrite">RewriteMap</directive>
+ディレクティブで結果のファイルを参照できます:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>dbm タイプによっては、共通のベース名で複数のファイルが生成される
+ことがあることに注意してください。例えば、<code>mapfile.map.dir</code>
+と <code>mapfile.map.pag</code> という 2 つのファイルが存在する
+場合があります。これは正常であり、<directive module="mod_rewrite">RewriteMap</directive>
+ディレクティブではベース名 <code>mapfile.map</code> のみを使用
+してください。</p>
+</note>
+
+<note><title>キャッシュされた検索</title>
+<p>
+検索されたキーは、マップファイルの <code>mtime</code> (変更時刻) が
+変更されるか、httpd サーバが再起動されるまで httpd にキャッシュ
+されます。これにより、多くのリクエストで呼び出されるマップの
+パフォーマンスが向上します。
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg: 外部書き換えプログラム</title>
+
+    <p>MapType に <code>prg</code> を使用すると、MapSource はマッピング動作を
+    提供する実行可能プログラムへのファイルシステムパスです。これは
+    コンパイル済みバイナリファイル、または Python や Perl などの
+    インタプリタ言語のプログラムです。</p>
+
+    <p>このプログラムは Apache HTTP Server の起動時に一度起動され、
+    <code>STDIN</code> と <code>STDOUT</code> を通じて書き換えエンジンと
+    通信します。各マップ関数の検索では、キーがプログラムの
+    <code>STDIN</code> に書き込まれ、その後に改行文字が続きます。
+    プログラムは <code>STDIN</code> から 1 行 (改行を含む) を読み取り、
+    応答を改行で終わる 1 行として <code>STDOUT</code> に書き込む
+    必要があります。キーに改行文字が含まれることはありません。
+    改行を含むキーが検出された場合、検索は失敗します。</p>
+
+    <p>対応する検索値がない場合、マッププログラムは 4 文字の
+    文字列 "<code>NULL</code>" を返して、これを示す必要があります。
+    この比較は大文字小文字を区別しないため、"null"、"Null" 等も
+    検索失敗として扱われます。その結果、マッピングプログラムが
+    リテラル文字列 "NULL" をマップされた値として返すことは
+    できません。</p>
+
+    <p>プログラムの <code>STDERR</code> は httpd 親プロセスから
+    継承されるため、プログラムが <code>STDERR</code> に書き込む内容は
+    httpd 自体のエラー出力 (通常は <directive
+    module="core">ErrorLog</directive>) と同じ場所に記録されます。</p>
+
+    <p>外部書き換えプログラムは、<directive
+    module="mod_rewrite">RewriteEngine</directive> が <code>on</code> に
+    設定されていないコンテキストで定義されている場合は起動されません。</p>
+
+    <p>デフォルトでは、外部書き換えプログラムは httpd を起動した
+    ユーザ:グループとして実行されます。これは UNIX システムでは
+    <directive module="mod_rewrite">RewriteMap</directive> の 3 番目の
+    引数として <code>username:groupname</code> 形式でユーザ名と
+    グループ名を渡すことで変更できます。</p>
+
+    <p>この機能は <code>rewrite-map</code> ミューテックスを使用しており、
+    プログラムとの信頼性のある通信に必要です。ミューテックスの
+    メカニズムとロックファイルは <directive module="core">Mutex</directive>
+    ディレクティブで設定できます。</p>
+
+    <p>リクエスト URI 内のすべてのダッシュをアンダースコアに置き換える
+    シンプルな例を以下に示します。</p>
+
+    <p><strong>書き換え設定</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>注意!</title>
+<ul>
+<li>書き換えマッププログラムはできるだけシンプルに保ってください。
+プログラムがハングすると、httpd はマップからのレスポンスを
+無期限に待つことになり、その結果 httpd がリクエストへの応答を
+停止します。</li>
+<li>プログラムでバッファリングを必ずオフにしてください。上記の
+Python の例では、<code>print()</code> に <code>flush=True</code> を
+渡すことでこれを行っています。バッファされた I/O は httpd が
+出力を待つ原因となり、ハングします。</li>
+<li>プログラムは 1 コピーのみで、サーバ起動時に開始されることを
+忘れないでください。すべてのリクエストはこの 1 つのボトルネックを
+通過する必要があります。多くのリクエストがこのプロセスを通過する
+必要がある場合や、スクリプト自体が非常に遅い場合、これは
+著しい速度低下を引き起こす可能性があります。</li>
+<li>マッピングプログラムが終了しても、自動的に再起動されません。
+以降の検索はサーバが再起動されるまで失敗します。</li>
+<li>マッピングプログラムは、関連する設定ディレクティブが変更されたか
+どうかに関係なく、サーバの再起動 (graceful またはそれ以外) 時に
+常に kill され再起動されます。シャットダウン時にプログラムには
+<code>SIGTERM</code> が送信されます。3 秒以内に終了しない場合は
+<code>SIGKILL</code> が送信されます。</li>
+</ul>
+</note>
+
+</section>
+
+
+  <section id="dbd">
+    <title>dbd または fastdbd: SQL クエリ</title>
+
+    <p>MapType に <code>dbd</code> または <code>fastdbd</code> を使用すると、
+    MapSource は単一の引数を取り、単一の値を返す SQL SELECT 文です。</p>
+
+    <p>この文を実行するために、<module>mod_dbd</module> を正しい
+    データベースを指すように設定する必要があります。</p>
+
+    <p>この MapType には 2 つの形式があります。
+    MapType に <code>dbd</code> を使用すると、各マップリクエストで
+    クエリが実行されますが、<code>fastdbd</code> を使用すると
+    データベース検索が内部的にキャッシュされます。したがって、
+    <code>fastdbd</code> はより効率的で高速ですが、サーバが
+    再起動されるまでデータベースの変更を検出しません。</p>
+
+    <p>クエリが複数の行を返す場合、結果セットからランダムな行が
+    使用されます。</p>
+
+    <example><title>例</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>注</title>
+    <p>クエリ名は SQL プリペアドステートメントのラベルとして
+    データベースドライバに渡されるため、データベースで必要な
+    ルール (大文字小文字の区別など) に従う必要があります。</p></note>
+
+  </section>
+  <section id="summary">
+    <title>まとめ</title>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive> ディレクティブは
+    複数回使用できます。各マッピング関数に対して 1 つの
+    <directive module="mod_rewrite">RewriteMap</directive> ディレクティブを
+    使用して書き換えマップファイルを宣言してください。</p>
+
+    <p>ディレクトリ単位のコンテキスト (<code>.htaccess</code> ファイルや
+    <directive module="core" type="section">Directory</directive> ブロック)
+    ではマップを<strong>宣言</strong>できませんが、ディレクトリ単位の
+    コンテキストでこのマップを<strong>使用</strong>することは可能です。</p>
+
+  </section>
+</manualpage>
diff --git a/docs/manual/rewrite/rewritemap.xml.ko b/docs/manual/rewrite/rewritemap.xml.ko
new file mode 100644 (file)
index 0000000..686edd7
--- /dev/null
@@ -0,0 +1,486 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1932819 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>RewriteMap 사용하기</title>
+  <summary>
+
+    <p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<directive module="mod_rewrite">RewriteMap</directive> 지시어의
+사용법을 설명하고 다양한 <directive module="mod_rewrite"
+>RewriteMap</directive> 유형의 예제를 제공합니다.</p>
+
+    <note type="warning">이 예제들 중 많은 것이 특정 서버 설정에서
+그대로 작동하지 않을 수 있으므로, 단순히 예제를 복사하여
+설정에 붙여넣기보다는 이해하는 것이 중요합니다.</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+  <seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+  <seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+  <seealso><a href="access.html">접근 제어</a></seealso>
+  <seealso><a href="vhosts.html">가상 호스트</a></seealso>
+  <seealso><a href="proxy.html">프록시</a></seealso>
+  <seealso><a href="advanced.html">고급 기술</a></seealso>
+  <seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+  <section id="introduction">
+    <title>소개</title>
+
+   <p>
+   <directive module="mod_rewrite">RewriteMap</directive> 지시어는
+   <directive module="mod_rewrite">RewriteRule</directive> 또는
+   <directive module="mod_rewrite">RewriteCond</directive> 지시어의
+   컨텍스트에서 호출할 수 있는 외부 함수를 정의하여
+   정규 표현식만으로는 너무 복잡하거나 너무 전문화된
+   재작성을 수행합니다. 이 조회의 소스는 아래 섹션에
+   나열되고 <directive module="mod_rewrite">RewriteMap</directive>
+   참조 문서에 열거된 유형 중 하나일 수 있습니다.</p>
+
+   <p><directive module="mod_rewrite">RewriteMap</directive>
+   지시어의 구문은 다음과 같습니다:</p>
+
+<highlight language="config">
+RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
+</highlight>
+
+    <p><a id="mapfunc" name="mapfunc"><em>MapName</em></a>은
+    맵에 할당하는 임의의 이름이며, 이후 지시어에서
+    사용합니다. 인수는 다음 구문을 통해 맵에 전달됩니다:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>MapName</em> <code>:</code> <em>LookupKey</em>
+        <code>}</code> <br/> <code>${</code> <em>MapName</em> <code>:</code>
+        <em>LookupKey</em> <code>|</code> <em>DefaultValue</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>이러한 구조가 발생하면 맵 <em>MapName</em>이
+      조회되고 키 <em>LookupKey</em>가 검색됩니다. 키가
+      발견되면 맵 함수 구조는 <em>SubstValue</em>로
+      대체됩니다. 키를 찾지 못하면 <em>DefaultValue</em>로
+      대체되거나, <em>DefaultValue</em>가 지정되지 않은
+      경우 빈 문자열로 대체됩니다.</p>
+
+    <p>예를 들어 다음과 같이
+      <directive module="mod_rewrite">RewriteMap</directive>을
+      정의할 수 있습니다:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>그러면 <directive module="mod_rewrite">RewriteRule</directive>에서
+      다음과 같이 이 맵을 사용할 수 있습니다:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>맵에서 아무것도 찾지 못한 경우를 대비하여 기본값을
+지정할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>디렉토리별 및 .htaccess 컨텍스트</title>
+<p>
+<directive module="mod_rewrite">RewriteMap</directive> 지시어는
+<directive module="core" type="section">Directory</directive> 섹션이나
+<code>.htaccess</code> 파일에서 사용할 수 없습니다. 서버 또는
+가상호스트 컨텍스트에서 맵을 선언해야 합니다. 일단 생성된 맵은
+해당 범위의 <directive module="mod_rewrite">RewriteRule</directive>과
+<directive module="mod_rewrite">RewriteCond</directive> 지시어에서
+사용할 수 있습니다. 해당 범위에서 <strong>선언</strong>할 수
+없을 뿐입니다.</p>
+</note>
+
+<p>다음 섹션에서는 사용할 수 있는 다양한 <em>MapType</em>을
+설명하고 각각의 예제를 제공합니다.</p>
+  </section>
+
+  <section id="int">
+    <title>int: 내부 함수</title>
+
+    <p>MapType이 <code>int</code>인 경우 MapSource는 사용 가능한
+    내부 <directive module="mod_rewrite">RewriteMap</directive>
+    함수 중 하나입니다. 모듈 작성자는
+    <code>ap_register_rewrite_mapfunc</code> API를 등록하여
+    추가 내부 함수를 제공할 수 있습니다.
+    기본적으로 제공되는 함수는 다음과 같습니다:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             키를 모두 대문자로 변환합니다.</li>
+      <li><strong>tolower</strong>:<br/>
+             키를 모두 소문자로 변환합니다.</li>
+      <li><strong>escape</strong>:<br/>
+             키의 특수 문자를 16진수 인코딩으로 변환합니다.</li>
+      <li><strong>unescape</strong>:<br/>
+             키의 16진수 인코딩을 다시 특수 문자로 변환합니다.</li>
+    </ul>
+
+    <p>
+    이러한 함수 중 하나를 사용하려면 int 함수를 참조하는
+    <directive module="mod_rewrite">RewriteMap</directive>을
+    생성한 다음 <directive module="mod_rewrite"
+    >RewriteRule</directive>에서 사용합니다:
+    </p>
+
+   <p><strong>URI를 모두 소문자 버전으로 리다이렉트</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>여기에 제공된 예제는 설명 목적으로만 제공되며
+    권장 사항이 아닙니다. URL을 대소문자 구분 없이
+    만들려면 대신 <module>mod_speling</module> 사용을
+    고려하십시오.
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt: 일반 텍스트 맵</title>
+
+    <p>MapType이 <code>txt</code>인 경우 MapSource는
+    한 줄에 하나의 공백으로 구분된 키/값 쌍을 포함하는
+    일반 텍스트 매핑 파일의 파일 시스템 경로입니다.
+    선택적으로 '#' 문자로 시작하는 주석이 포함될 수
+    있습니다.</p>
+
+    <p>유효한 텍스트 재작성 맵 파일은 다음과 같은 구문을
+    가집니다:</p>
+
+    <example>
+      # 주석 줄<br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong><br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong> # 주석<br />
+    </example>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive>이
+    호출되면 인수가 줄의 첫 번째 인수에서 검색되고,
+    발견되면 치환 값이 반환됩니다.</p>
+
+    <p>예를 들어, 기억하기 쉬운 URL을 위해 제품 이름을
+    제품 ID로 변환하는 맵 파일을 사용할 수 있습니다:</p>
+<p><strong>제품에서 ID로의 설정</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>여기서 <code>prods.php</code> 스크립트는 조회 맵에서
+    제품을 찾지 못했을 때 <code>id=NOTFOUND</code> 인수를
+    받으면 어떻게 해야 하는지 알고 있다고 가정합니다.</p>
+
+    <p><code>/etc/apache2/productmap.txt</code> 파일에는
+    다음이 포함됩니다:</p>
+
+    <example><title>제품에서 ID로의 맵</title>
+##<br />
+##  productmap.txt - 제품에서 ID로의 맵 파일<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>따라서 <code>http://example.com/product/television</code>이
+    요청되면 <directive module="mod_rewrite">RewriteRule</directive>이
+    적용되고 요청은 내부적으로
+    <code>/prods.php?id=993</code>에 매핑됩니다.</p>
+
+    <note><title>참고: .htaccess 파일</title>
+    주어진 예제는 서버 또는 가상호스트 범위에서 사용하도록
+    작성되었습니다. <code>.htaccess</code> 파일에서 사용할
+    계획이라면, 무엇이든 일치하도록 재작성 패턴에서 앞의
+    슬래시를 제거해야 합니다:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>캐시된 조회</title>
+    <p>
+    조회된 키는 맵 파일의 <code>mtime</code>(수정 시간)이
+    변경되거나 httpd 서버가 재시작될 때까지 httpd에 의해
+    캐시됩니다. 이는 많은 요청에 의해 호출되는 맵의
+    성능을 향상시킵니다.
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd: 무작위 일반 텍스트</title>
+
+    <p>MapType이 <code>rnd</code>인 경우 MapSource는 일반
+    텍스트 매핑 파일의 파일 시스템 경로이며, 각 줄에는
+    키와 <code>|</code>로 구분된 하나 이상의 값이 포함됩니다.
+    키가 일치하면 이 값 중 하나가 무작위로 선택됩니다.</p>
+
+    <p>예를 들어, 리버스 프록시를 통한 무작위 부하 분산을
+    위해 다음 맵 파일과 지시어를 사용할 수 있습니다.
+    이미지는 'static' 풀의 서버 중 하나로 전송되고,
+    나머지는 'dynamic' 풀의 서버 중 하나로 전송됩니다.</p>
+
+    <example><title>재작성 맵 파일</title>
+##<br />
+##  map.txt -- 재작성 맵<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>설정 지시어</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>따라서 이미지가 요청되고 이 규칙 중 첫 번째가
+    일치하면 <directive module="mod_rewrite">RewriteMap</directive>은
+    맵 파일에서 문자열 <code>static</code>을 조회하고
+    지정된 호스트명 중 하나를 무작위로 반환하여
+    <directive module="mod_rewrite">RewriteRule</directive>
+    대상에서 사용합니다.</p>
+
+    <p>서버 중 하나가 선택될 확률을 높이려면(예를 들어
+    서버 중 하나가 더 많은 메모리를 가지고 있어 더 많은
+    요청을 처리할 수 있는 경우) 맵 파일에 해당 서버를
+    더 많이 나열하면 됩니다.</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm: DBM 해시 파일</title>
+
+    <p>MapType이 <code>dbm</code>인 경우 MapSource는
+    매핑에 사용할 키/값 쌍을 포함하는 DBM 데이터베이스
+    파일의 파일 시스템 경로입니다. 이것은 <code>txt</code>
+    맵과 정확히 같은 방식으로 작동하지만, DBM은 인덱싱되어
+    있는 반면 텍스트 파일은 그렇지 않으므로 훨씬 빠릅니다.
+    이를 통해 원하는 키에 더 빠르게 접근할 수 있습니다.</p>
+
+    <p>선택적으로 특정 dbm 유형을 지정할 수 있습니다:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>유형은 <code>sdbm</code>, <code>gdbm</code>,
+    <code>ndbm</code> 또는 <code>db</code>일 수 있습니다.
+    그러나 httpd 자체가 빌드될 때 사용된 것과 일치하는
+    올바른 DBM 라이브러리를 사용하므로 Apache HTTP Server와
+    함께 제공되는 <a href="../programs/httxt2dbm.html">httxt2dbm</a>
+    유틸리티를 사용하는 것이 좋습니다.</p>
+
+    <p>dbm 파일을 생성하려면 먼저 <a href="#txt">txt</a>
+    섹션에 설명된 대로 텍스트 맵 파일을 생성합니다. 그런 다음
+    <code>httxt2dbm</code>을 실행합니다:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>그런 다음 <directive module="mod_rewrite">RewriteMap</directive>
+지시어에서 결과 파일을 참조할 수 있습니다:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>일부 dbm 유형에서는 공통 기본 이름을 가진 둘 이상의
+파일이 생성됩니다. 예를 들어 <code>mapfile.map.dir</code>과
+<code>mapfile.map.pag</code>라는 두 파일이 있을 수 있습니다.
+이것은 정상이며 <directive module="mod_rewrite">RewriteMap</directive>
+지시어에서 기본 이름인 <code>mapfile.map</code>만 사용하면
+됩니다.</p>
+</note>
+
+<note><title>캐시된 조회</title>
+<p>
+조회된 키는 맵 파일의 <code>mtime</code>(수정 시간)이
+변경되거나 httpd 서버가 재시작될 때까지 httpd에 의해
+캐시됩니다. 이는 많은 요청에 의해 호출되는 맵의
+성능을 향상시킵니다.
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg: 외부 재작성 프로그램</title>
+
+    <p>MapType이 <code>prg</code>인 경우 MapSource는
+    매핑 동작을 제공할 실행 가능한 프로그램의 파일 시스템
+    경로입니다. 이것은 컴파일된 바이너리 파일이거나
+    Python이나 Perl과 같은 인터프리터 언어의 프로그램일 수
+    있습니다.</p>
+
+    <p>이 프로그램은 Apache HTTP Server가 시작될 때 한 번
+    시작되며, <code>STDIN</code>과 <code>STDOUT</code>을
+    통해 재작성 엔진과 통신합니다. 각 맵 함수 조회에 대해
+    키가 프로그램의 <code>STDIN</code>에 기록되고 그 뒤에
+    줄바꿈 문자가 옵니다. 프로그램은 <code>STDIN</code>에서
+    한 줄을 읽고(줄바꿈 포함) 응답을
+    <code>STDOUT</code>에 줄바꿈으로 끝나는 한 줄로
+    작성해야 합니다. 키에는 줄바꿈 문자가 포함되지
+    않으며, 줄바꿈이 포함된 키가 발견되면 조회가
+    실패합니다.</p>
+
+    <p>대응하는 조회 값이 없으면 맵 프로그램은
+    네 문자 문자열 "<code>NULL</code>"을 반환하여 이를
+    나타내야 합니다. 이 비교는 대소문자를 구분하지
+    않으므로 "null", "Null" 등도 실패한 조회로
+    처리됩니다. 결과적으로 매핑 프로그램이 매핑된 값으로
+    리터럴 문자열 "NULL"을 반환하는 것은 불가능합니다.</p>
+
+    <p>프로그램의 <code>STDERR</code>은 httpd 부모
+    프로세스에서 상속되므로 프로그램이 <code>STDERR</code>에
+    쓰는 모든 것은 httpd의 자체 오류 출력과 같은 곳(일반적으로
+    <directive module="core">ErrorLog</directive>)에
+    기록됩니다.</p>
+
+    <p>외부 재작성 프로그램은 <directive
+    module="mod_rewrite">RewriteEngine</directive>이
+    <code>on</code>으로 설정되지 않은 컨텍스트에서
+    정의된 경우 시작되지 않습니다.</p>
+
+    <p>기본적으로 외부 재작성 프로그램은 httpd를 시작한
+    user:group으로 실행됩니다. 이것은 UNIX 시스템에서
+    <directive module="mod_rewrite">RewriteMap</directive>의
+    세 번째 인수로 <code>username:groupname</code> 형식으로
+    사용자 이름과 그룹 이름을 전달하여 변경할 수 있습니다.</p>
+
+    <p>이 기능은 프로그램과의 안정적인 통신에 필요한
+    <code>rewrite-map</code> 뮤텍스를 활용합니다.
+    뮤텍스 메커니즘과 잠금 파일은 <directive
+    module="core">Mutex</directive> 지시어로 구성할 수
+    있습니다.</p>
+
+    <p>여기에 요청 URI에서 모든 대시를 밑줄로 대체하는
+    간단한 예제가 나와 있습니다.</p>
+
+    <p><strong>재작성 설정</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>주의!</title>
+<ul>
+<li>재작성 맵 프로그램을 가능한 한 간단하게 유지하십시오.
+프로그램이 멈추면 httpd가 맵의 응답을 무한정 기다리게 되고,
+이는 다시 httpd가 요청에 응답하지 못하게 합니다.</li>
+<li>프로그램에서 버퍼링을 끄십시오. 위의 Python 예제에서는
+<code>print()</code>에 <code>flush=True</code>를 전달하여
+이를 수행합니다. 버퍼링된 I/O는 httpd가 출력을 기다리게
+하므로 멈추게 됩니다.</li>
+<li>서버 시작 시 시작되는 프로그램의 복사본은 하나뿐입니다.
+모든 요청이 이 하나의 병목을 통과해야 합니다. 많은 요청이
+이 프로세스를 통과해야 하거나 스크립트 자체가 매우 느린
+경우 상당한 속도 저하를 초래할 수 있습니다.</li>
+<li>매핑 프로그램이 종료되면 자동으로 다시 시작되지 않습니다.
+서버가 재시작될 때까지 후속 조회가 실패합니다.</li>
+<li>매핑 프로그램은 관련 설정 지시어가 변경되었는지 여부에
+관계없이 서버 재시작(graceful 또는 기타) 시 항상 종료되고
+다시 시작됩니다. 종료 시 프로그램에 <code>SIGTERM</code>이
+전송되며, 3초 이내에 종료되지 않으면
+<code>SIGKILL</code>이 전송됩니다.</li>
+</ul>
+</note>
+
+</section>
+
+
+  <section id="dbd">
+    <title>dbd 또는 fastdbd: SQL 쿼리</title>
+
+    <p>MapType이 <code>dbd</code> 또는 <code>fastdbd</code>인
+    경우 MapSource는 단일 인수를 받아 단일 값을 반환하는
+    SQL SELECT 문입니다.</p>
+
+    <p>이 문이 실행되려면 올바른 데이터베이스를 가리키도록
+    <module>mod_dbd</module>를 구성해야 합니다.</p>
+
+    <p>이 MapType에는 두 가지 형태가 있습니다.
+    <code>dbd</code> MapType을 사용하면 각 맵 요청마다
+    쿼리가 실행되고, <code>fastdbd</code>를 사용하면
+    데이터베이스 조회가 내부적으로 캐시됩니다. 따라서
+    <code>fastdbd</code>가 더 효율적이고 빠르지만,
+    서버가 재시작될 때까지 데이터베이스 변경 사항을
+    반영하지 않습니다.</p>
+
+    <p>쿼리가 둘 이상의 행을 반환하면 결과 세트에서
+    무작위 행이 사용됩니다.</p>
+
+    <example><title>예제</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>참고</title>
+    <p>쿼리 이름은 SQL 준비된 문의 레이블로 데이터베이스
+    드라이버에 전달되므로 데이터베이스에 필요한 모든
+    규칙(대소문자 구분 등)을 따라야 합니다.</p></note>
+
+  </section>
+  <section id="summary">
+    <title>요약</title>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive> 지시어는
+    여러 번 사용할 수 있습니다. 각 매핑 함수에 대해 하나의
+    <directive module="mod_rewrite">RewriteMap</directive> 지시어를
+    사용하여 재작성 맵 파일을 선언합니다.</p>
+
+    <p>디렉토리별 컨텍스트(<code>.htaccess</code> 파일이나
+    <directive module="core" type="section">Directory</directive>
+    블록)에서는 맵을 <strong>선언</strong>할 수 없지만
+    디렉토리별 컨텍스트에서 이 맵을 <strong>사용</strong>하는
+    것은 가능합니다.</p>
+
+  </section>
+</manualpage>
index b77e9e616859e53cbd6bc2e85e816187bead9617..e9a5bc67ef91c0d4c8a384ff53064eb04ebadf7c 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/rewritemap.xml.tr b/docs/manual/rewrite/rewritemap.xml.tr
new file mode 100644 (file)
index 0000000..de9b19a
--- /dev/null
@@ -0,0 +1,506 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1932819 -->
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>RewriteMap Kullanımı</title>
+  <summary>
+
+    <p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+<directive module="mod_rewrite">RewriteMap</directive> yönergesinin
+kullanımını açıklar ve çeşitli <directive module="mod_rewrite"
+>RewriteMap</directive> türlerinin her birine örnekler sunar.</p>
+
+    <note type="warning">Bu örneklerin birçoğunun sizin sunucu
+yapılandırmanızda değişiklik yapılmadan çalışmayacağını unutmayın; bu
+nedenle örnekleri yapılandırmanıza kopyalayıp yapıştırmak yerine
+anlamanız önemlidir.</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+  <seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+  <seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+  <seealso><a href="access.html">Erişim denetimi</a></seealso>
+  <seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+  <seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+  <seealso><a href="advanced.html">İleri teknikler</a></seealso>
+  <seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+  <section id="introduction">
+    <title>Giriş</title>
+
+   <p>
+   <directive module="mod_rewrite">RewriteMap</directive> yönergesi,
+   düzenli ifadelerle gerçekleştirilmesi çok karmaşık veya çok özel
+   olan yeniden yazma işlemlerini yapmak üzere
+   <directive module="mod_rewrite">RewriteRule</directive> veya
+   <directive module="mod_rewrite">RewriteCond</directive> yönergeleri
+   bağlamında çağrılabilecek harici bir işlev tanımlar. Bu aramanın
+   kaynağı, aşağıdaki bölümlerde listelenen türlerden herhangi biri
+   olabilir ve <directive module="mod_rewrite">RewriteMap</directive>
+   başvuru belgelerinde numaralandırılmıştır.</p>
+
+   <p><directive module="mod_rewrite">RewriteMap</directive>
+   yönergesinin sözdizimi şöyledir:</p>
+
+<highlight language="config">
+RewriteMap <em>EşlemAdı</em> <em>EşlemTürü</em>:<em>EşlemKaynağı</em>
+</highlight>
+
+    <p><a id="mapfunc" name="mapfunc"><em>EşlemAdı</em></a>, eşleme
+    için atadığınız keyfi bir addır ve daha sonra yönergelerde
+    kullanacaksınız. Argümanlar eşlemeye aşağıdaki sözdizimi ile
+    iletilir:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>EşlemAdı</em> <code>:</code> <em>AramaAnahtarı</em>
+        <code>}</code> <br/> <code>${</code> <em>EşlemAdı</em> <code>:</code>
+        <em>AramaAnahtarı</em> <code>|</code> <em>ÖntanımlıDeğer</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>Böyle bir yapı oluştuğunda, <em>EşlemAdı</em> eşlemine
+      başvurulur ve <em>AramaAnahtarı</em> aranır. Anahtar bulunursa
+      eşlem-işlev yapısı <em>DeğiştirmeDeğeri</em> ile değiştirilir.
+      Anahtar bulunamazsa <em>ÖntanımlıDeğer</em> ile veya hiçbir
+      <em>ÖntanımlıDeğer</em> belirtilmemişse boş dizgeyle
+      değiştirilir.</p>
+
+    <p>Örneğin, bir
+      <directive module="mod_rewrite">RewriteMap</directive> şöyle
+      tanımlayabilirsiniz:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>Daha sonra bu eşlemi bir
+      <directive module="mod_rewrite">RewriteRule</directive>
+      içinde şöyle kullanabilirsiniz:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>Eşlemde hiçbir şey bulunamazsa öntanımlı bir değer
+belirtilebilir:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>Dizin başına ve .htaccess bağlamı</title>
+<p>
+<directive module="mod_rewrite">RewriteMap</directive> yönergesi
+<directive module="core" type="section">Directory</directive>
+bölümlerinde veya <code>.htaccess</code> dosyalarında kullanılamaz.
+Eşlemi sunucu veya sanal konak bağlamında bildirmelisiniz. Eşlemi
+oluşturduktan sonra, <directive
+module="mod_rewrite">RewriteRule</directive> ve <directive
+module="mod_rewrite">RewriteCond</directive> yönergelerinizde bu
+kapsamlarda kullanabilirsiniz. Ancak bu kapsamlarda
+<strong>bildirme</strong> yapamazsınız.</p>
+</note>
+
+<p>Aşağıdaki bölümler kullanılabilecek çeşitli <em>EşlemTürü</em>
+değerlerini açıklar ve her birine örnekler verir.</p>
+  </section>
+
+  <section id="int">
+    <title>int: Dahili İşlev</title>
+
+    <p><code>int</code> EşlemTürü kullanıldığında, EşlemKaynağı
+    kullanılabilir dahili <directive
+    module="mod_rewrite">RewriteMap</directive> işlevlerinden biridir.
+    Modül yazarları, <code>ap_register_rewrite_mapfunc</code> API'sini
+    kullanarak ek dahili işlevler sağlayabilir. Öntanımlı olarak
+    sağlanan işlevler şunlardır:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             Anahtarı tamamen büyük harfe dönüştürür.</li>
+      <li><strong>tolower</strong>:<br/>
+             Anahtarı tamamen küçük harfe dönüştürür.</li>
+      <li><strong>escape</strong>:<br/>
+             Anahtardaki özel karakterleri onaltılık kodlamaya
+            çevirir.</li>
+      <li><strong>unescape</strong>:<br/>
+             Anahtardaki onaltılık kodlamaları özel karakterlere geri
+            çevirir.</li>
+    </ul>
+
+    <p>
+    Bu işlevlerden birini kullanmak için, int işlevine başvuran bir
+    <directive module="mod_rewrite">RewriteMap</directive> oluşturun
+    ve ardından bunu <directive
+    module="mod_rewrite">RewriteRule</directive> yönergenizde
+    kullanın:
+    </p>
+
+   <p><strong>Bir URI'yi tamamen küçük harfli sürümüne
+   yönlendir</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>Burada sunulan örneğin yalnızca açıklama amaçlı olduğunu ve
+    bir öneri olmadığını lütfen unutmayın. URL'leri büyük/küçük harf
+    duyarsız yapmak istiyorsanız, bunun yerine
+    <module>mod_speling</module> kullanmayı düşünün.
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt: Düz Metin Eşlemleri</title>
+
+    <p><code>txt</code> EşlemTürü kullanıldığında, EşlemKaynağı satır
+    başına bir boşlukla ayrılmış anahtar/değer çifti içeren düz metin
+    eşlem dosyasının bir dosya sistemi yoludur. İsteğe bağlı olarak,
+    bir satır '#' karakteriyle başlayan bir açıklama içerebilir.</p>
+
+    <p>Geçerli bir metin yeniden yazma eşlem dosyası aşağıdaki
+    sözdizimine sahip olacaktır:</p>
+
+    <example>
+      # Açıklama satırı<br />
+      <strong><em>EşleşenAnahtar</em> <em>DeğiştirmeDeğeri</em></strong><br />
+      <strong><em>EşleşenAnahtar</em> <em>DeğiştirmeDeğeri</em></strong> # açıklama<br />
+    </example>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive>
+    çağrıldığında, argüman bir satırın ilk argümanında aranır ve
+    bulunursa değiştirme değeri döndürülür.</p>
+
+    <p>Örneğin, daha kolay hatırlanan URL'ler için ürün adlarını
+    ürün kimliklerine çevirmek üzere aşağıdaki tarifi kullanarak bir
+    eşlem dosyası kullanabiliriz:</p>
+<p><strong>Ürün-kimlik yapılandırması</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>Burada <code>prods.php</code> betiğinin, bir ürün arama
+    eşleminde bulunmadığında <code>id=NOTFOUND</code> argümanını
+    aldığında ne yapacağını bildiğini varsayıyoruz.</p>
+
+    <p><code>/etc/apache2/productmap.txt</code> dosyası daha sonra
+    şunları içerir:</p>
+
+    <example><title>Ürün-kimlik eşlem dosyası</title>
+##<br />
+##  productmap.txt - Ürün-Kimlik eşlem dosyası<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>Böylece, <code>http://example.com/product/television</code>
+    istendiğinde, <directive module="mod_rewrite">RewriteRule</directive>
+    uygulanır ve istek dahili olarak
+    <code>/prods.php?id=993</code> ile eşlenir.</p>
+
+    <note><title>Not: .htaccess dosyaları</title>
+    Verilen örnek sunucu veya sanal konak kapsamında kullanılmak üzere
+    hazırlanmıştır. Bunu bir <code>.htaccess</code> dosyasında
+    kullanmayı planlıyorsanız, herhangi bir şeyle eşleşebilmesi için
+    yeniden yazma kalıbından baştaki eğik çizgiyi kaldırmanız
+    gerekecektir:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>Önbelleğe alınmış aramalar</title>
+    <p>
+    Aranan anahtarlar, eşlem dosyasının <code>mtime</code>
+    (değiştirme zamanı) değişene veya httpd sunucusu yeniden
+    başlatılana kadar httpd tarafından önbelleğe alınır. Bu, birçok
+    istek tarafından çağrılan eşlemler için daha iyi performans
+    sağlar.
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd: Rastgeleleştirilmiş Düz Metin</title>
+
+    <p><code>rnd</code> EşlemTürü kullanıldığında, EşlemKaynağı her
+    satırı bir anahtar ve <code>|</code> ile ayrılmış bir veya daha
+    fazla değer içeren düz metin eşlem dosyasının bir dosya sistemi
+    yoludur. Anahtar eşleşirse bu değerlerden biri rastgele
+    seçilir.</p>
+
+    <p>Örneğin, ters vekil aracılığıyla birkaç arka uç sunucu
+    arasında rastgele yük dengeleme sağlamak için aşağıdaki eşlem
+    dosyasını ve yönergeleri kullanabilirsiniz. Resimler 'static'
+    havuzundaki sunuculardan birine gönderilirken, diğer her şey
+    'dynamic' havuzuna gönderilir.</p>
+
+    <example><title>Yeniden yazma eşlem dosyası</title>
+##<br />
+##  map.txt -- yeniden yazma eşlem dosyası<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>Yapılandırma yönergeleri</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>Böylece, bir resim istendiğinde ve bu kurallardan ilki
+    eşleştiğinde, <directive module="mod_rewrite">RewriteMap</directive>
+    eşlem dosyasında <code>static</code> dizgesini arar ve belirtilen
+    konak adlarından birini rastgele döndürür; bu daha sonra
+    <directive module="mod_rewrite">RewriteRule</directive> hedefinde
+    kullanılır.</p>
+
+    <p>Sunuculardan birinin daha sık seçilmesini istiyorsanız (örneğin,
+    sunuculardan birinin daha fazla belleği varsa ve daha fazla isteği
+    işleyebiliyorsa), onu eşlem dosyasında daha fazla kez listeleyin.</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm: DBM Adresleme Dosyası</title>
+
+    <p><code>dbm</code> EşlemTürü kullanıldığında, EşlemKaynağı
+    eşlemede kullanılacak anahtar/değer çiftleri içeren bir DBM
+    veritabanı dosyasının dosya sistemi yoludur. Bu, <code>txt</code>
+    eşlemiyle tamamen aynı şekilde çalışır, ancak DBM dizinlendiğinden
+    ve metin dosyası dizinlenmediğinden çok daha hızlıdır. Bu, istenen
+    anahtara daha hızlı erişim sağlar.</p>
+
+    <p>İsteğe bağlı olarak belirli bir dbm türü belirtebilirsiniz:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>Tür <code>sdbm</code>, <code>gdbm</code>, <code>ndbm</code>
+    veya <code>db</code> olabilir. Ancak, Apache HTTP Sunucusu ile
+    sağlanan <a href="../programs/httxt2dbm.html">httxt2dbm</a>
+    aracını kullanmanız önerilir; çünkü httpd'nin kendisi
+    oluşturulurken kullanılan doğru DBM kitaplığını kullanacaktır.</p>
+
+    <p>Bir dbm dosyası oluşturmak için önce <a href="#txt">txt</a>
+    bölümünde açıklandığı gibi bir metin eşlem dosyası oluşturun.
+    Ardından <code>httxt2dbm</code>'yi çalıştırın:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>Daha sonra ortaya çıkan dosyaya <directive
+module="mod_rewrite">RewriteMap</directive> yönergenizde
+başvurabilirsiniz:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>Bazı dbm türleriyle, ortak bir temel adla birden fazla dosya
+oluşturulduğunu unutmayın. Örneğin, <code>mapfile.map.dir</code>
+ve <code>mapfile.map.pag</code> adlı iki dosyanız olabilir. Bu
+normaldir ve <directive module="mod_rewrite">RewriteMap</directive>
+yönergenizde yalnızca <code>mapfile.map</code> temel adını
+kullanmanız yeterlidir.</p>
+</note>
+
+<note><title>Önbelleğe alınmış aramalar</title>
+<p>
+Aranan anahtarlar, eşlem dosyasının <code>mtime</code>
+(değiştirme zamanı) değişene veya httpd sunucusu yeniden
+başlatılana kadar httpd tarafından önbelleğe alınır. Bu, birçok
+istek tarafından çağrılan eşlemler için daha iyi performans
+sağlar.
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg: Harici Yeniden Yazma Programı</title>
+
+    <p><code>prg</code> EşlemTürü kullanıldığında, EşlemKaynağı
+    eşleme davranışını sağlayacak çalıştırılabilir bir programın
+    dosya sistemi yoludur. Bu, derlenmiş bir ikili dosya veya Python
+    ya da Perl gibi yorumlanan bir dilde yazılmış bir program
+    olabilir.</p>
+
+    <p>Bu program, Apache HTTP Sunucusu başlatıldığında bir kez
+    başlatılır ve ardından yeniden yazma motoruyla
+    <code>STDIN</code> ve <code>STDOUT</code> aracılığıyla
+    iletişim kurar. Her eşlem işlevi aramasında, anahtar programın
+    <code>STDIN</code>'ine yazılır ve ardından bir satırsonu karakteri
+    gelir. Program, <code>STDIN</code>'den bir satır okumalı (satırsonu
+    dahil) ve yanıtını <code>STDOUT</code>'a tek bir satırsonu ile
+    sonlandırılmış satır olarak yazmalıdır. Anahtarlar hiçbir zaman
+    satırsonu karakteri içermez; satırsonu içeren bir anahtarla
+    karşılaşılırsa arama başarısız olur.</p>
+
+    <p>Karşılık gelen bir arama değeri yoksa, eşlem programı bunu
+    belirtmek için dört karakterlik "<code>NULL</code>" dizgesini
+    döndürmelidir. Bu karşılaştırmanın büyük/küçük harf duyarsız
+    olduğunu unutmayın; "null", "Null" vb. de başarısız arama olarak
+    değerlendirilir. Sonuç olarak, bir eşleme programının eşlenen
+    değer olarak "NULL" birebir dizgesini döndürmesi mümkün
+    değildir.</p>
+
+    <p>Programın <code>STDERR</code>'si httpd üst sürecinden
+    miras alınır; bu nedenle programın <code>STDERR</code>'ye
+    yazdığı her şey httpd'nin kendi hata çıktısıyla (genellikle
+    <directive module="core">ErrorLog</directive>) aynı yere
+    gider.</p>
+
+    <p>Harici yeniden yazma programları, <directive
+    module="mod_rewrite">RewriteEngine</directive> <code>on</code>
+    olarak ayarlanmamış bir bağlamda tanımlanmışlarsa
+    başlatılmaz.</p>
+
+    <p>Öntanımlı olarak, harici yeniden yazma programları httpd'yi
+    başlatan kullanıcı:grup olarak çalıştırılır. Bu, UNIX
+    sistemlerinde <directive module="mod_rewrite">RewriteMap</directive>
+    yönergesine üçüncü argüman olarak
+    <code>kullanıcıadı:grupadı</code> biçiminde kullanıcı adı ve
+    grup adı geçirilerek değiştirilebilir.</p>
+
+    <p>Bu özellik, programla güvenilir iletişim için gerekli olan
+    <code>rewrite-map</code> mutex'ini kullanır. Mutex mekanizması
+    ve kilit dosyası <directive module="core">Mutex</directive>
+    yönergesiyle yapılandırılabilir.</p>
+
+    <p>Burada, bir istek URI'sindeki tüm tireleri alt çizgilerle
+    değiştirecek basit bir örnek gösterilmektedir.</p>
+
+    <p><strong>Yeniden yazma yapılandırması</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>Dikkat!</title>
+<ul>
+<li>Yeniden yazma eşlem programınızı olabildiğince basit tutun.
+Program askıda kalırsa, httpd'nin eşlemden yanıt beklerken süresiz
+olarak beklemesine neden olur ve bu da httpd'nin isteklere yanıt
+vermesini durduracaktır.</li>
+<li>Programınızda arabelleğe almayı kapattığınızdan emin olun.
+Yukarıdaki Python örneğinde bu, <code>print()</code> işlevine
+<code>flush=True</code> geçirilerek yapılır. Arabelleğe alınmış G/Ç,
+httpd'nin çıktıyı beklemesine neden olur ve askıda kalmasına
+yol açar.</li>
+<li>Sunucu başlangıcında başlatılan programın yalnızca bir kopyası
+olduğunu unutmayın. Tüm isteklerin bu tek darboğazdan geçmesi
+gerekecektir. Birçok istek bu süreçten geçmek zorundaysa veya
+betiğin kendisi çok yavaşsa bu önemli yavaşlamalara neden
+olabilir.</li>
+<li>Eşleme programı sonlanırsa otomatik olarak yeniden
+başlatılmaz. Sonraki aramalar, sunucu yeniden başlatılana kadar
+başarısız olur.</li>
+<li>Eşleme programı, ilgili yapılandırma yönergelerinin değişip
+değişmediğine bakılmaksızın herhangi bir sunucu yeniden
+başlatmasında (zarif veya başka türlü) her zaman sonlandırılır
+ve yeniden başlatılır. Kapatmada programa <code>SIGTERM</code>
+gönderilir; 3 saniye içinde çıkmazsa <code>SIGKILL</code>
+gönderilir.</li>
+</ul>
+</note>
+
+</section>
+
+
+  <section id="dbd">
+    <title>dbd veya fastdbd: SQL Sorgusu</title>
+
+    <p><code>dbd</code> veya <code>fastdbd</code> EşlemTürü
+    kullanıldığında, EşlemKaynağı tek bir argüman alan ve tek bir
+    değer döndüren bir SQL SELECT deyimidir.</p>
+
+    <p>Bu deyimin yürütülmesi için <module>mod_dbd</module> modülünün
+    doğru veritabanına işaret edecek şekilde yapılandırılması
+    gerekir.</p>
+
+    <p>Bu EşlemTürünün iki biçimi vardır. <code>dbd</code> EşlemTürü
+    kullanmak, sorgunun her eşlem isteğinde yürütülmesine neden
+    olurken, <code>fastdbd</code> kullanmak veritabanı aramalarını
+    dahili olarak önbelleğe alır. Böylece <code>fastdbd</code> daha
+    verimli ve dolayısıyla daha hızlı olsa da, sunucu yeniden
+    başlatılana kadar veritabanındaki değişiklikleri almaz.</p>
+
+    <p>Bir sorgu birden fazla satır döndürürse, sonuç kümesinden
+    rastgele bir satır kullanılır.</p>
+
+    <example><title>Örnek</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>Not</title>
+    <p>Sorgu adı veritabanı sürücüsüne bir SQL hazır deyimi için
+    etiket olarak iletilir ve bu nedenle veritabanınız için gereken
+    tüm kuralları (büyük/küçük harf duyarlılığı gibi) izlemelidir.</p>
+    </note>
+
+  </section>
+  <section id="summary">
+    <title>Özet</title>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive> yönergesi
+    birden fazla kez kullanılabilir. Her eşleme-işlevi için yeniden
+    yazma eşlem dosyasını bildirmek üzere bir
+    <directive module="mod_rewrite">RewriteMap</directive> yönergesi
+    kullanın.</p>
+
+    <p>Dizin başına bağlamda (<code>.htaccess</code> dosyaları veya
+    <directive module="core" type="section">Directory</directive>
+    blokları) bir eşlem <strong>bildirmeniz</strong> mümkün olmasa da,
+    bu eşlemi dizin başına bağlamda <strong>kullanmanız</strong>
+    mümkündür.</p>
+
+  </section>
+</manualpage>
diff --git a/docs/manual/rewrite/rewritemap.xml.zh-cn b/docs/manual/rewrite/rewritemap.xml.zh-cn
new file mode 100644 (file)
index 0000000..c0547a7
--- /dev/null
@@ -0,0 +1,436 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1932819 -->
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<manualpage metafile="rewritemap.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+  <title>使用 RewriteMap</title>
+  <summary>
+
+    <p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了
+<directive module="mod_rewrite">RewriteMap</directive> 指令的使用方法,
+并提供了各种 <directive module="mod_rewrite">RewriteMap</directive>
+类型的示例。</p>
+
+    <note type="warning">请注意,这些示例中的许多在你的特定服务器配置中
+不会原封不动地工作,因此理解它们非常重要,
+而不是仅仅将示例复制粘贴到你的配置中。</note>
+
+  </summary>
+  <seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+  <seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+  <seealso><a href="remapping.html">重定向和重映射</a></seealso>
+  <seealso><a href="access.html">访问控制</a></seealso>
+  <seealso><a href="vhosts.html">虚拟主机</a></seealso>
+  <seealso><a href="proxy.html">代理</a></seealso>
+  <seealso><a href="advanced.html">高级技术</a></seealso>
+  <seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+  <section id="introduction">
+    <title>介绍</title>
+
+   <p>
+   <directive module="mod_rewrite">RewriteMap</directive> 指令定义了一个外部函数,
+   可以在 <directive module="mod_rewrite">RewriteRule</directive> 或
+   <directive module="mod_rewrite">RewriteCond</directive>
+   指令的上下文中调用,以执行过于复杂或过于专业化而无法仅通过正则表达式完成的重写。
+   此查找的来源可以是下面各节中列出的任何类型,
+   并在 <directive module="mod_rewrite">RewriteMap</directive>
+   参考文档中有详细说明。</p>
+
+   <p><directive module="mod_rewrite">RewriteMap</directive>
+   指令的语法如下:</p>
+
+<highlight language="config">
+RewriteMap <em>MapName</em> <em>MapType</em>:<em>MapSource</em>
+</highlight>
+
+    <p><a id="mapfunc" name="mapfunc"><em>MapName</em></a>
+    是你分配给映射的任意名称,稍后将在指令中使用。
+    通过以下语法将参数传递给映射:</p>
+
+    <p class="indent">
+      <strong>
+        <code>${</code> <em>MapName</em> <code>:</code> <em>LookupKey</em>
+        <code>}</code> <br/> <code>${</code> <em>MapName</em> <code>:</code>
+        <em>LookupKey</em> <code>|</code> <em>DefaultValue</em> <code>}</code>
+      </strong>
+    </p>
+
+    <p>当出现这样的结构时,将查询映射 <em>MapName</em>
+      并查找键 <em>LookupKey</em>。如果找到该键,
+      映射函数结构将被替换为 <em>SubstValue</em>。
+      如果未找到该键,则替换为 <em>DefaultValue</em>,
+      如果未指定 <em>DefaultValue</em> 则替换为空字符串。</p>
+
+    <p>例如,你可以定义一个
+      <directive module="mod_rewrite">RewriteMap</directive> 如下:</p>
+    <highlight language="config">
+RewriteMap examplemap "txt:/path/to/file/map.txt"
+    </highlight>
+    <p>然后你可以在
+      <directive module="mod_rewrite">RewriteRule</directive> 中如下使用此映射:</p>
+      <highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1}"
+      </highlight>
+
+<p>在映射中未找到任何内容时,可以指定默认值:</p>
+
+<highlight language="config">
+RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}"
+</highlight>
+
+<note><title>目录级和 .htaccess 上下文</title>
+<p>
+<directive module="mod_rewrite">RewriteMap</directive> 指令不能在
+<directive module="core" type="section">Directory</directive> 配置段或
+<code>.htaccess</code> 文件中使用。你必须在服务器或虚拟主机上下文中声明映射。
+创建映射后,你可以在这些范围内的
+<directive module="mod_rewrite">RewriteRule</directive> 和
+<directive module="mod_rewrite">RewriteCond</directive>
+指令中<strong>使用</strong>它。只是不能在这些范围内<strong>声明</strong>它。</p>
+</note>
+
+<p>以下各节描述了可以使用的各种 <em>MapType</em>,并给出了每种类型的示例。</p>
+  </section>
+
+  <section id="int">
+    <title>int:内部函数</title>
+
+    <p>当 MapType 为 <code>int</code> 时,MapSource 是可用的
+    <directive module="mod_rewrite">RewriteMap</directive>
+    内部函数之一。模块作者可以通过使用
+    <code>ap_register_rewrite_mapfunc</code> API 注册来提供额外的内部函数。
+    默认提供的函数有:
+    </p>
+
+    <ul>
+      <li><strong>toupper</strong>:<br/>
+             将键转换为全大写。</li>
+      <li><strong>tolower</strong>:<br/>
+             将键转换为全小写。</li>
+      <li><strong>escape</strong>:<br/>
+             将键中的特殊字符转换为十六进制编码。</li>
+      <li><strong>unescape</strong>:<br/>
+             将键中的十六进制编码转换回特殊字符。</li>
+    </ul>
+
+    <p>
+    要使用这些函数之一,创建一个引用 int 函数的
+    <directive module="mod_rewrite">RewriteMap</directive>,
+    然后在你的
+    <directive module="mod_rewrite">RewriteRule</directive> 中使用它:
+    </p>
+
+   <p><strong>将 URI 重定向到其全小写版本</strong></p>
+    <highlight language="config">
+RewriteMap lc int:tolower
+RewriteRule "(.*)" "${lc:$1}" [R]
+    </highlight>
+
+    <note>
+    <p>请注意,此处提供的示例仅用于说明目的,并非建议。
+    如果你想使 URL 不区分大小写,请考虑使用
+    <module>mod_speling</module> 代替。
+    </p>
+    </note>
+
+  </section>
+
+  <section id="txt">
+    <title>txt:纯文本映射</title>
+
+    <p>当 MapType 为 <code>txt</code> 时,MapSource 是一个纯文本映射文件的
+    文件系统路径,每行包含一个以空格分隔的键/值对。
+    可选地,一行可以包含以 '#' 字符开头的注释。</p>
+
+    <p>有效的文本重写映射文件将具有以下语法:</p>
+
+    <example>
+      # 注释行<br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong><br />
+      <strong><em>MatchingKey</em> <em>SubstValue</em></strong> # 注释<br />
+    </example>
+
+    <p>当调用 <directive module="mod_rewrite">RewriteMap</directive> 时,
+    在行的第一个参数中查找该参数,如果找到,则返回替换值。</p>
+
+    <p>例如,我们可以使用映射文件将产品名称转换为产品 ID,
+    以获得更易记的 URL,使用以下配方:</p>
+<p><strong>产品到 ID 的配置</strong></p>
+    <highlight language="config">
+RewriteMap product2id "txt:/etc/apache2/productmap.txt"
+RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+
+    <p>我们假设 <code>prods.php</code> 脚本知道在收到
+    <code>id=NOTFOUND</code> 参数时如何处理——当在查找映射中找不到产品时。</p>
+
+    <p>文件 <code>/etc/apache2/productmap.txt</code> 包含以下内容:</p>
+
+    <example><title>产品到 ID 的映射</title>
+##<br />
+##  productmap.txt - 产品到 ID 的映射文件<br />
+##<br />
+<br />
+television 993<br />
+stereo     198<br />
+fishingrod 043<br />
+basketball 418<br />
+telephone  328
+    </example>
+
+    <p>因此,当请求 <code>http://example.com/product/television</code> 时,
+    <directive module="mod_rewrite">RewriteRule</directive> 被应用,
+    请求在内部被映射到 <code>/prods.php?id=993</code>。</p>
+
+    <note><title>注意:.htaccess 文件</title>
+    此处给出的示例是为在服务器或虚拟主机范围内使用而设计的。
+    如果你计划在 <code>.htaccess</code> 文件中使用,
+    则需要从重写模式中删除前导斜杠才能匹配任何内容:
+    <highlight language="config">
+RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]
+    </highlight>
+    </note>
+
+    <note><title>缓存查找</title>
+    <p>
+    查找的键会被 httpd 缓存,直到映射文件的 <code>mtime</code>
+    (修改时间)发生变化或 httpd 服务器重启。
+    这确保了被许多请求调用的映射有更好的性能。
+    </p>
+    </note>
+
+  </section>
+  <section id="rnd">
+    <title>rnd:随机纯文本</title>
+
+    <p>当 MapType 为 <code>rnd</code> 时,MapSource 是一个纯文本映射文件的
+    文件系统路径,每行包含一个键和一个或多个由 <code>|</code>
+    分隔的值。如果键匹配,将随机选择其中一个值。</p>
+
+    <p>例如,你可以使用以下映射文件和指令通过反向代理在多个后端服务器之间
+    提供随机负载均衡。图像被发送到 'static' 池中的某个服务器,
+    而其他所有内容被发送到 'dynamic' 池中的某个服务器。</p>
+
+    <example><title>重写映射文件</title>
+##<br />
+##  map.txt -- 重写映射<br />
+##<br />
+<br />
+static   www1|www2|www3|www4<br />
+dynamic  www5|www6
+    </example>
+<p><strong>配置指令</strong></p>
+    <highlight language="config">
+RewriteMap servers "rnd:/path/to/file/map.txt"
+
+RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1"  [NC,P,L]
+RewriteRule "^/(.*)"                "http://${servers:dynamic}/$1" [P,L]
+    </highlight>
+
+    <p>因此,当请求图像并且第一条规则匹配时,
+    <directive module="mod_rewrite">RewriteMap</directive>
+    在映射文件中查找字符串 <code>static</code>,
+    随机返回指定主机名之一,然后将其用于
+    <directive module="mod_rewrite">RewriteRule</directive> 目标。</p>
+
+    <p>如果你想让某个服务器更有可能被选中(例如,
+    如果某个服务器比其他服务器有更多内存,因此可以处理更多请求),
+    只需在映射文件中多次列出它即可。</p>
+
+    <example>
+static   www1|www1|www2|www3|www4
+    </example>
+
+  </section>
+
+  <section id="dbm">
+    <title>dbm:DBM 哈希文件</title>
+
+    <p>当 MapType 为 <code>dbm</code> 时,MapSource 是一个 DBM
+    数据库文件的文件系统路径,其中包含用于映射的键/值对。
+    其工作方式与 <code>txt</code> 映射完全相同,但速度更快,
+    因为 DBM 是有索引的,而文本文件没有索引。
+    这允许更快地访问所需的键。</p>
+
+    <p>你可以选择指定特定的 dbm 类型:</p>
+
+ <highlight language="config">
+RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"
+ </highlight>
+
+    <p>类型可以是 <code>sdbm</code>、<code>gdbm</code>、<code>ndbm</code>
+    或 <code>db</code>。但建议你使用 Apache HTTP Server 提供的
+    <a href="../programs/httxt2dbm.html">httxt2dbm</a> 工具,
+    因为它会使用正确的 DBM 库,与构建 httpd 本身时使用的库相匹配。</p>
+
+    <p>要创建 dbm 文件,首先按照 <a href="#txt">txt</a>
+    节中的描述创建文本映射文件。然后运行
+    <code>httxt2dbm</code>:</p>
+
+<example>
+$ httxt2dbm -i mapfile.txt -o mapfile.map
+</example>
+
+<p>然后你可以在
+<directive module="mod_rewrite">RewriteMap</directive>
+指令中引用生成的文件:</p>
+
+<highlight language="config">
+RewriteMap mapname "dbm:/etc/apache/mapfile.map"
+</highlight>
+
+<note>
+<p>请注意,对于某些 dbm 类型,会生成多个文件,它们具有共同的基本名称。
+例如,你可能有两个名为 <code>mapfile.map.dir</code> 和
+<code>mapfile.map.pag</code> 的文件。这是正常的,你只需在
+<directive module="mod_rewrite">RewriteMap</directive>
+指令中使用基本名称 <code>mapfile.map</code> 即可。</p>
+</note>
+
+<note><title>缓存查找</title>
+<p>
+查找的键会被 httpd 缓存,直到映射文件的 <code>mtime</code>
+(修改时间)发生变化或 httpd 服务器重启。
+这确保了被许多请求调用的映射有更好的性能。
+</p>
+</note>
+
+  </section>
+
+  <section id="prg"><title>prg:外部重写程序</title>
+
+    <p>当 MapType 为 <code>prg</code> 时,MapSource 是一个可执行程序的
+    文件系统路径,该程序将提供映射行为。这可以是编译的二进制文件,
+    也可以是 Python 或 Perl 等解释型语言的程序。</p>
+
+    <p>此程序在 Apache HTTP Server 启动时启动一次,
+    然后通过 <code>STDIN</code> 和 <code>STDOUT</code>
+    与重写引擎通信。对于每次映射函数查找,
+    键被写入程序的 <code>STDIN</code>,后跟换行符。
+    程序应从 <code>STDIN</code> 读取一行(直到并包括换行符),
+    并在 <code>STDOUT</code> 上写入其响应作为单个以换行符终止的行。
+    键永远不会包含换行符;如果遇到包含换行符的键,查找将失败。</p>
+
+    <p>如果没有对应的查找值,映射程序应返回四字符字符串
+    "<code>NULL</code>" 来表示这一点。请注意,此比较不区分大小写,
+    因此 "null"、"Null" 等也被视为查找失败。
+    因此,映射程序不可能返回字面量字符串 "NULL" 作为映射值。</p>
+
+    <p>程序的 <code>STDERR</code> 继承自 httpd 父进程,
+    因此程序写入 <code>STDERR</code> 的任何内容都将与 httpd
+    自身的错误输出出现在相同的位置(通常是
+    <directive module="core">ErrorLog</directive>)。</p>
+
+    <p>如果外部重写程序定义在未将
+    <directive module="mod_rewrite">RewriteEngine</directive>
+    设置为 <code>on</code> 的上下文中,则不会启动。</p>
+
+    <p>默认情况下,外部重写程序以启动 httpd 的用户:组身份运行。
+    在 UNIX 系统上,可以通过将用户名和组名作为第三个参数传递给
+    <directive module="mod_rewrite">RewriteMap</directive>,
+    以 <code>username:groupname</code> 格式进行更改。</p>
+
+    <p>此功能使用 <code>rewrite-map</code> 互斥锁,
+    这是与程序可靠通信所必需的。互斥锁机制和锁文件可以通过
+    <directive module="core">Mutex</directive> 指令进行配置。</p>
+
+    <p>这里展示了一个简单的示例,它将请求 URI 中的所有破折号替换为下划线。</p>
+
+    <p><strong>重写配置</strong></p>
+    <highlight language="config">
+RewriteMap d2u "prg:/www/bin/dash2under.py" apache:apache
+RewriteRule "-" "${d2u:%{REQUEST_URI}}"
+    </highlight>
+
+    <p><strong>dash2under.py</strong></p>
+    <highlight language="python">
+#!/usr/bin/env python3
+import sys
+
+for line in sys.stdin:
+    print(line.strip().replace('-', '_'), flush=True)
+    </highlight>
+
+<note><title>注意!</title>
+<ul>
+<li>保持你的重写映射程序尽可能简单。如果程序挂起,
+它将导致 httpd 无限期地等待映射的响应,
+这反过来会导致 httpd 停止响应请求。</li>
+<li>确保在你的程序中关闭缓冲。在上面的 Python 示例中,
+这是通过向 <code>print()</code> 传递 <code>flush=True</code> 来完成的。
+缓冲的 I/O 将导致 httpd 等待输出,从而挂起。</li>
+<li>请记住,程序只有一个副本,在服务器启动时启动。
+所有请求都需要通过这一个瓶颈。如果许多请求必须通过此进程,
+或者脚本本身非常慢,这可能会导致显著的性能下降。</li>
+<li>如果映射程序终止,它不会自动重启。后续查找将失败,
+直到服务器重启。</li>
+<li>无论相关配置指令是否发生更改,映射程序在任何服务器重启
+(优雅重启或其他方式)时都会被终止并重新启动。
+关闭时,程序会收到 <code>SIGTERM</code> 信号;
+如果在 3 秒内未退出,则会收到 <code>SIGKILL</code> 信号。</li>
+</ul>
+</note>
+
+</section>
+
+
+  <section id="dbd">
+    <title>dbd 或 fastdbd:SQL 查询</title>
+
+    <p>当 MapType 为 <code>dbd</code> 或 <code>fastdbd</code> 时,
+    MapSource 是一个接受单个参数并返回单个值的 SQL SELECT 语句。</p>
+
+    <p>需要配置 <module>mod_dbd</module>
+    指向正确的数据库才能执行此语句。</p>
+
+    <p>此 MapType 有两种形式。使用 <code>dbd</code> 的 MapType
+    会在每次映射请求时执行查询,而使用 <code>fastdbd</code>
+    则在内部缓存数据库查找结果。因此,虽然 <code>fastdbd</code>
+    更高效、更快,但它不会在服务器重启之前获取数据库的更改。</p>
+
+    <p>如果查询返回多行,将从结果集中随机使用一行。</p>
+
+    <example><title>示例</title>
+    <highlight language="config">
+RewriteMap myquery "fastdbd:SELECT destination FROM rewrite WHERE source = %s"
+    </highlight>
+    </example>
+
+    <note><title>注意</title>
+    <p>查询名称作为 SQL 预处理语句的标签传递给数据库驱动程序,
+    因此需要遵循数据库要求的任何规则(例如大小写敏感性)。</p></note>
+
+  </section>
+  <section id="summary">
+    <title>总结</title>
+
+    <p><directive module="mod_rewrite">RewriteMap</directive>
+    指令可以出现多次。对于每个映射函数,使用一个
+    <directive module="mod_rewrite">RewriteMap</directive>
+    指令来声明其重写映射文件。</p>
+
+    <p>虽然你不能在目录级上下文(<code>.htaccess</code> 文件或
+    <directive module="core" type="section">Directory</directive> 块)中
+    <strong>声明</strong>映射,但可以在目录级上下文中<strong>使用</strong>此映射。</p>
+
+  </section>
+</manualpage>
diff --git a/docs/manual/rewrite/tech.xml.de b/docs/manual/rewrite/tech.xml.de
new file mode 100644 (file)
index 0000000..7f4c7cd
--- /dev/null
@@ -0,0 +1,197 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Technische Details zu Apache mod_rewrite</title>
+
+<summary>
+<p>Dieses Dokument behandelt einige der technischen Details von
+<module>mod_rewrite</module> und der URL-Zuordnung.</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">Verwendung von RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="InternalAPI"><title>API-Phasen</title>
+
+    <p>Der Apache HTTP Server bearbeitet Anfragen in mehreren Phasen.
+    In jeder dieser Phasen können ein oder mehrere Module aufgerufen
+    werden, um diesen Teil des Anfrage-Lebenszyklus zu behandeln. Zu
+    den Phasen gehören Dinge wie URL-zu-Dateiname-Übersetzung,
+    Authentifizierung, Autorisierung, Inhalt und Protokollierung. (Dies
+    ist keine vollständige Liste.)</p>
+
+    <p><module>mod_rewrite</module> wirkt in zwei dieser Phasen (oder "Hooks", wie
+    sie oft genannt werden), um zu beeinflussen, wie URLs umgeschrieben
+    werden können.</p>
+
+    <p>Erstens verwendet es den URL-zu-Dateiname-Übersetzungs-Hook, der
+    nach dem Lesen der HTTP-Anfrage stattfindet, aber bevor eine
+    Autorisierung beginnt. Zweitens verwendet es den Fixup-Hook, der
+    nach den Autorisierungsphasen und nach dem Lesen der
+    verzeichnisbezogenen Konfigurationsdateien
+    (<code>.htaccess</code>-Dateien) stattfindet, aber bevor der
+    Inhalts-Handler aufgerufen wird.</p>
+
+    <p>Nachdem eine Anfrage eingegangen ist und ein entsprechender Server
+    oder virtueller Host bestimmt wurde, beginnt die Umschreibungs-Engine
+    mit der Verarbeitung aller <module>mod_rewrite</module>-Direktiven in der
+    Server-Konfiguration. (d.h. in der Hauptserverkonfigurationsdatei und
+    in <directive module="core" type="section">Virtualhost</directive>-Abschnitten.)
+    Dies geschieht in der URL-zu-Dateiname-Phase.</p>
+
+    <p>Einige Schritte später, nachdem die endgültigen Datenverzeichnisse
+    gefunden wurden, werden die verzeichnisbezogenen
+    Konfigurationsdirektiven (<code>.htaccess</code>-Dateien und
+    <directive module="core" type="section">Directory</directive>-Blöcke)
+    angewendet. Dies geschieht in der Fixup-Phase.</p>
+
+    <p>In jedem dieser Fälle schreibt <module>mod_rewrite</module> die
+    <code>REQUEST_URI</code> entweder auf eine neue URL oder auf einen
+    Dateinamen um.</p>
+
+    <p>Im Verzeichniskontext (d.h. in <code>.htaccess</code>-Dateien und
+    <code>Directory</code>-Blöcken) werden diese Regeln angewendet,
+    nachdem eine URL bereits in einen Dateinamen übersetzt wurde. Aus
+    diesem Grund ist der URL-Pfad, gegen den <module>mod_rewrite</module>
+    zunächst die <directive module="mod_rewrite">RewriteRule</directive>-Direktiven
+    abgleicht, der vollständige Dateisystempfad zum übersetzten
+    Dateinamen, wobei der Pfad des aktuellen Verzeichnisses (einschließlich
+    eines abschließenden Schrägstrichs) vom Anfang entfernt wurde.</p>
+
+    <p>Zur Veranschaulichung: Wenn Regeln in /var/www/foo/.htaccess stehen
+    und eine Anfrage für /foo/bar/baz verarbeitet wird, würde ein Ausdruck
+    wie ^bar/baz$ übereinstimmen.</p>
+
+    <p>Wenn eine Ersetzung im Verzeichniskontext vorgenommen wird, wird
+    eine neue interne Unteranfrage mit der neuen URL ausgelöst, die die
+    Verarbeitung der Anfragephasen neu startet. Wenn die Ersetzung ein
+    relativer Pfad ist, bestimmt die
+    <directive module="mod_rewrite">RewriteBase</directive>-Direktive
+    das URL-Pfad-Präfix, das der Ersetzung vorangestellt wird. Im
+    Verzeichniskontext muss darauf geachtet werden, Regeln zu erstellen,
+    die letztendlich (in einer zukünftigen "Runde" der verzeichnisbezogenen
+    Umschreibungsverarbeitung) keine Ersetzung durchführen, um Schleifen
+    zu vermeiden. (Siehe <a
+    href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>
+    für eine weitere Diskussion dieses Problems.)</p>
+
+    <p>Aufgrund dieser weiteren Manipulation der URL im Verzeichniskontext
+    müssen Sie Ihre Umschreibungsregeln in diesem Kontext anders
+    gestalten. Insbesondere denken Sie daran, dass der führende
+    Verzeichnispfad vom URL-Pfad abgeschnitten wird, den Ihre
+    Umschreibungsregeln sehen. Betrachten Sie die folgenden Beispiele
+    zur weiteren Verdeutlichung.</p>
+
+    <table border="1">
+
+        <tr>
+            <th>Ort der Regel</th>
+            <th>Regel</th>
+        </tr>
+
+        <tr>
+            <td>VirtualHost-Abschnitt</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>.htaccess-Datei im Document Root</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>.htaccess-Datei im images-Verzeichnis</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p>Für noch mehr Einblick, wie <module>mod_rewrite</module> URLs in
+    verschiedenen Kontexten manipuliert, sollten Sie die
+    <a href="../mod/mod_rewrite.html#logging">Protokolleinträge</a>
+    konsultieren, die während der Umschreibung erstellt werden.</p>
+
+</section>
+
+<section id="InternalRuleset"><title>Regelsatz-Verarbeitung</title>
+
+      <p>Wenn <module>mod_rewrite</module> in diesen beiden API-Phasen
+      ausgelöst wird, liest es die konfigurierten Regelsätze aus seiner
+      Konfigurationsstruktur (die entweder beim Start für den
+      Server-Kontext oder während des Verzeichnisdurchlaufs des
+      Apache-Kerns für den Verzeichniskontext erstellt wurde). Dann wird
+      die URL-Umschreibungs-Engine mit dem enthaltenen Regelsatz gestartet
+      (eine oder mehrere Regeln zusammen mit ihren Bedingungen). Die
+      Funktionsweise der URL-Umschreibungs-Engine ist für beide
+      Konfigurationskontexte genau gleich. Nur die endgültige
+      Ergebnisverarbeitung ist unterschiedlich.</p>
+
+      <p>Die Reihenfolge der Regeln im Regelsatz ist wichtig, da die
+      Umschreibungs-Engine sie in einer speziellen (und nicht sehr
+      offensichtlichen) Reihenfolge verarbeitet. Die Regel lautet:
+      Die Umschreibungs-Engine durchläuft den Regelsatz Regel für Regel
+      (<directive module="mod_rewrite">RewriteRule</directive>-Direktiven)
+      und wenn eine bestimmte Regel übereinstimmt, durchläuft sie optional
+      die vorhandenen zugehörigen Bedingungen (<code>RewriteCond</code>-Direktiven).
+      Aus historischen Gründen werden die Bedingungen zuerst angegeben,
+      sodass der Kontrollfluss etwas umständlich ist. Siehe Abbildung 1
+      für weitere Details.</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="Ablauf der RewriteRule- und RewriteCond-Zuordnung" /><br />
+      <dfn>Abbildung 1:</dfn>Der Kontrollfluss durch den Umschreibungsregelsatz
+</p>
+      <p>Zuerst wird die URL gegen das <em>Pattern</em> jeder Regel
+      abgeglichen. Wenn es fehlschlägt, stoppt <module>mod_rewrite</module>
+      sofort die Verarbeitung dieser Regel und fährt mit der nächsten Regel
+      fort. Wenn das <em>Pattern</em> übereinstimmt, sucht
+      <module>mod_rewrite</module> nach zugehörigen Regelbedingungen
+      (RewriteCond-Direktiven, die in der Konfiguration unmittelbar über
+      der RewriteRule stehen). Wenn keine vorhanden sind, ersetzt es die
+      URL durch einen neuen Wert, der aus dem String <em>Substitution</em>
+      konstruiert wird, und fährt mit seiner Regelschleife fort. Wenn
+      jedoch Bedingungen vorhanden sind, startet es eine innere Schleife
+      zur Verarbeitung dieser in der Reihenfolge, in der sie aufgeführt
+      sind. Für Bedingungen ist die Logik anders: Wir gleichen kein
+      Muster gegen die aktuelle URL ab. Stattdessen erstellen wir zuerst
+      einen String <em>TestString</em> durch Expansion von Variablen,
+      Rückreferenzen, Map-Nachschlagungen <em>usw.</em>, und dann
+      versuchen wir, <em>CondPattern</em> dagegen abzugleichen. Wenn das
+      Muster nicht übereinstimmt, schlägt die gesamte Menge von
+      Bedingungen und die zugehörige Regel fehl. Wenn das Muster
+      übereinstimmt, wird die nächste Bedingung verarbeitet, bis keine
+      weiteren Bedingungen verfügbar sind. Wenn alle Bedingungen
+      übereinstimmen, wird die Verarbeitung mit der Ersetzung der URL
+      durch <em>Substitution</em> fortgesetzt.</p>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/tech.xml.es b/docs/manual/rewrite/tech.xml.es
new file mode 100644 (file)
index 0000000..436d018
--- /dev/null
@@ -0,0 +1,189 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Detalles Técnicos de Apache mod_rewrite</title>
+
+<summary>
+<p>Este documento discute algunos de los detalles técnicos de <module>mod_rewrite</module>
+y la coincidencia de URLs.</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">Uso de RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="InternalAPI"><title>Fases de la API</title>
+
+    <p>Apache HTTP Server maneja las solicitudes en varias fases. En
+    cada una de estas fases, uno o más módulos pueden ser llamados para
+    manejar esa porción del ciclo de vida de la solicitud. Las fases incluyen cosas
+    como traducción de URL a nombre de archivo, autenticación, autorización,
+    contenido, y registro. (Esta no es una lista exhaustiva.)</p>
+
+    <p><module>mod_rewrite</module> actúa en dos de estas fases (o "hooks", como se les
+    suele llamar) para influir en cómo las URLs pueden ser reescritas.</p>
+
+    <p>Primero, usa el hook de traducción de URL a nombre de archivo, que ocurre
+    después de que la solicitud HTTP ha sido leída, pero antes de que cualquier autorización
+    comience. Segundo, usa el hook de Fixup, que es después de las
+    fases de autorización, y después de que los archivos de configuración per-directorio
+    (archivos <code>.htaccess</code>) han sido leídos, pero antes de que el
+    manejador de contenido sea llamado.</p>
+
+    <p>Después de que una solicitud llega y se ha determinado un servidor o
+    host virtual correspondiente, el motor de reescritura comienza a
+    procesar cualquier directiva de <module>mod_rewrite</module> que aparezca en la
+    configuración per-servidor. (es decir, en el archivo de configuración principal del servidor
+    y secciones <directive module="core" type="section">Virtualhost</directive>.)
+    Esto sucede en la fase de traducción de URL a nombre de archivo.</p>
+
+    <p>Unos pasos más tarde, una vez que se han encontrado los directorios de datos finales,
+    se aplican las directivas de configuración per-directorio (archivos <code>.htaccess</code>
+    y bloques <directive module="core"
+    type="section">Directory</directive>). Esto
+    sucede en la fase de Fixup.</p>
+
+    <p>En cada uno de estos casos, <module>mod_rewrite</module> reescribe el
+    <code>REQUEST_URI</code> ya sea a una nueva URL, o a un nombre de archivo.</p>
+
+    <p>En contexto per-directorio (es decir, dentro de archivos <code>.htaccess</code>
+    y bloques <code>Directory</code>), estas reglas se están aplicando
+    después de que una URL ya ha sido traducida a un nombre de archivo. Debido a
+    esto, la ruta URL contra la que <module>mod_rewrite</module> inicialmente compara las directivas
+    <directive module="mod_rewrite">RewriteRule</directive>
+    es la ruta completa del sistema de archivos al nombre de archivo traducido con la ruta del
+    directorio actual (incluyendo una barra final) eliminada del frente.</p>
+
+    <p>Para ilustrar: Si las reglas están en /var/www/foo/.htaccess y se está procesando una solicitud
+    para /foo/bar/baz, una expresión como ^bar/baz$ coincidiría.</p>
+
+    <p>Si se hace una sustitución en contexto per-directorio, se emite una nueva
+    sub-solicitud interna con la nueva URL, que reinicia el procesamiento de las
+    fases de la solicitud. Si la sustitución es una ruta relativa, la directiva <directive
+    module="mod_rewrite">RewriteBase</directive>
+    determina el prefijo de ruta URL que se antepone a la sustitución.
+    En contexto per-directorio, se debe tener cuidado de
+    crear reglas que eventualmente (en alguna "ronda" futura de procesamiento de reescritura
+    per-directorio) no realicen una sustitución para evitar bucles.
+    (Vea <a href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>
+    para más discusión de este problema.)</p>
+
+    <p>Debido a esta manipulación adicional de la URL en contexto per-directorio,
+    necesitará tener cuidado de crear sus reglas de reescritura
+    de manera diferente en ese contexto. En particular, recuerde que la
+    ruta de directorio principal se eliminará de la URL que sus
+    reglas de reescritura verán. Considere los ejemplos siguientes para más
+    clarificación.</p>
+
+    <table border="1">
+
+        <tr>
+            <th>Ubicación de la regla</th>
+            <th>Regla</th>
+        </tr>
+
+        <tr>
+            <td>Sección VirtualHost</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>Archivo .htaccess en la raíz del documento</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>Archivo .htaccess en el directorio images</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p>Para aún más información sobre cómo <module>mod_rewrite</module> manipula URLs en
+    diferentes contextos, debería consultar las <a
+    href="../mod/mod_rewrite.html#logging">entradas del log</a> realizadas durante
+    la reescritura.</p>
+
+</section>
+
+<section id="InternalRuleset"><title>Procesamiento del Conjunto de Reglas</title>
+
+      <p>Ahora cuando <module>mod_rewrite</module> se activa en estas dos fases de la API, lee
+      los conjuntos de reglas configurados desde su estructura de
+      configuración (que a su vez fue creada al inicio para
+      contexto per-servidor o durante el recorrido de directorios del
+      núcleo de Apache para contexto per-directorio). Entonces el motor de reescritura
+      de URLs se inicia con el conjunto de reglas contenido (una o más
+      reglas junto con sus condiciones). La operación del
+      motor de reescritura de URLs es exactamente la misma para ambos
+      contextos de configuración. Solo el procesamiento del resultado final es
+      diferente.</p>
+
+      <p>El orden de las reglas en el conjunto de reglas es importante porque el
+      motor de reescritura las procesa en un orden especial (y no muy
+      obvio). La regla es esta: El motor de reescritura recorre
+      el conjunto de reglas regla por regla (directivas
+      <directive module="mod_rewrite">RewriteRule</directive>) y
+      cuando una regla particular coincide, opcionalmente recorre
+      las condiciones correspondientes existentes (directivas <code>RewriteCond</code>).
+      Por razones históricas las condiciones se dan
+      primero, y por lo tanto el flujo de control es un poco
+      enrevesado. Vea la Figura 1 para más detalles.</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="Flujo de coincidencia de RewriteRule y RewriteCond" /><br />
+      <dfn>Figura 1:</dfn>El flujo de control a través del conjunto de reglas de reescritura
+</p>
+      <p>Primero la URL se compara contra el
+      <em>Pattern</em> de cada regla. Si falla, <module>mod_rewrite</module>
+      inmediatamente deja de procesar esta regla, y continúa con la
+      siguiente regla. Si el <em>Pattern</em> coincide, <module>mod_rewrite</module> busca
+      las condiciones de regla correspondientes (directivas RewriteCond,
+      que aparecen inmediatamente encima de la RewriteRule en la configuración).
+      Si no hay ninguna, sustituye la URL con un nuevo valor, que se
+      construye a partir de la cadena <em>Substitution</em>, y continúa
+      con su bucle de reglas. Pero si existen condiciones, inicia un
+      bucle interno para procesarlas en el orden en que están
+      listadas. Para las condiciones, la lógica es diferente: no comparamos
+      un patrón contra la URL actual. En su lugar, primero creamos una
+      cadena <em>TestString</em> expandiendo variables,
+      referencias inversas, búsquedas en mapas, <em>etc.</em> y luego intentamos
+      comparar <em>CondPattern</em> contra ella. Si el patrón
+      no coincide, el conjunto completo de condiciones y la
+      regla correspondiente fallan. Si el patrón coincide, entonces se
+      procesa la siguiente condición hasta que no haya más condiciones
+      disponibles. Si todas las condiciones coinciden, el procesamiento continúa
+      con la sustitución de la URL con
+      <em>Substitution</em>.</p>
+
+</section>
+
+
+</manualpage>
index 6c8750edfa30b7ed3c93eb6ef76df538d97ba109..4ac7ce0249ff9e038cd20cdb74536c48c4b6693f 100644 (file)
@@ -1,7 +1,7 @@
-<?xml version="1.0" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
 <?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1933069:1933438 (outdated) -->
+<!-- English Revision: 1933438 -->
 <!-- French translation : Lucien GENTIS -->
 <!-- Reviewed by : Vincent Deffontaines -->
 
 <manualpage metafile="tech.xml.meta">
 <parentdocument href="./">Rewrite</parentdocument>
 
-  <title>D&eacute;tails techniques sur le module Apache mod_rewrite</title>
+  <title>Détails techniques sur le module Apache mod_rewrite</title>
 
 <summary>
-<p>Ce document passe en revue certains d&eacute;tails techniques &agrave; propos du
+<p>Ce document passe en revue certains détails techniques à propos du
 module <module>mod_rewrite</module> et de la mise en correspondance des URLs</p>
 </summary>
 <seealso><a href="../mod/mod_rewrite.html">Documentation du module mod_rewrite</a></seealso>
-<seealso><a href="intro.html">Introduction &agrave; mod_rewrite</a></seealso>
+<seealso><a href="intro.html">Introduction à mod_rewrite</a></seealso>
 <seealso><a href="remapping.html">Redirection et remise en
 correspondance</a></seealso>
-<seealso><a href="access.html">Contr&ocirc;le d'acc&egrave;s</a></seealso>
+<seealso><a href="access.html">Contrôle d'accès</a></seealso>
 <seealso><a href="vhosts.html">Serveurs virtuels</a></seealso>
 <seealso><a href="proxy.html">Mise en cache</a></seealso>
 <seealso><a href="rewritemap.html">Utilisation de RewriteMap</a></seealso>
-<seealso><a href="advanced.html">Techniques avanc&eacute;es</a></seealso>
+<seealso><a href="advanced.html">Techniques avancées</a></seealso>
 <seealso><a href="avoid.html">Quand ne pas utiliser mod_rewrite</a></seealso>
 
 <section id="InternalAPI"><title>Phases de l'API</title>
 
-      <p>Le traitement des requ&ecirc;tes par le serveur HTTP Apache se
-      d&eacute;roule en plusieurs phases. Au cours de chaque phase, un ou
-      plusieurs modules peuvent &ecirc;tre appel&eacute;s pour traiter la partie
-      concern&eacute;e du cycle de vie de la requ&ecirc;te. Les diff&eacute;rentes phases
+      <p>Le traitement des requêtes par le serveur HTTP Apache se
+      déroule en plusieurs phases. Au cours de chaque phase, un ou
+      plusieurs modules peuvent être appelés pour traiter la partie
+      concernée du cycle de vie de la requête. Les différentes phases
       peuvent consister en traduction d'URL en nom de fichier,
       authentification, autorisation, gestion de contenu ou journalisation (la
       liste n'est pas exhaustive).</p>
 
     <p><module>mod_rewrite</module> agit dans deux de ces phases (ou accroches - hooks -
-    comme on les nomme souvent) pour la r&eacute;&eacute;criture des URLs.</p>
+    comme on les nomme souvent) pour la réécriture des URLs.</p>
 
     <p>Tout d'abord, il utilise le hook traduction URL vers nom de
-    fichier qui intervient apr&egrave;s la lecture de la requ&ecirc;te HTTP, mais
+    fichier qui intervient après la lecture de la requête HTTP, mais
     avant le processus d'autorisation. Ensuite, il utilise le hook
-    Fixup, qui intervient apr&egrave;s les phases d'autorisation, apr&egrave;s la
-    lecture des fichiers de configuration de niveau r&eacute;pertoire (fichiers
+    Fixup, qui intervient après les phases d'autorisation, après la
+    lecture des fichiers de configuration de niveau répertoire (fichiers
     <code>.htaccess</code>), mais avant l'appel du gestionnaire de
     contenu.</p>
 
-    <p>Lorsqu'une requ&ecirc;te arrive et une fois le serveur
-    correspondant ou le serveur virtuel d&eacute;termin&eacute;, le moteur de
-    r&eacute;&eacute;criture commence &agrave; traiter toute directive apparaissant dans la
+    <p>Lorsqu'une requête arrive et une fois le serveur
+    correspondant ou le serveur virtuel déterminé, le moteur de
+    réécriture commence à traiter toute directive <module>mod_rewrite</module> apparaissant dans la
     configuration de niveau serveur (autrement dit dans le
     fichier de configuration principal du serveur et les sections
     <directive module="core" type="section">Virtualhost</directive>).
-    Tout ce processus s'ex&eacute;cute au cours de la phase de traduction URL
+    Tout ce processus s'exécute au cours de la phase de traduction URL
     vers nom de fichier.</p>
 
-    <p>Quelques &eacute;tapes plus loin, une fois les r&eacute;pertoires de donn&eacute;es
-    finaux trouv&eacute;s, les directives de configuration de niveau r&eacute;pertoire
+    <p>Quelques étapes plus loin, une fois les répertoires de données
+    finaux trouvés, les directives de configuration de niveau répertoire
     (fichiers <code>.htaccess</code> et sections <directive module="core"
-    type="section">Directory</directive>) sont appliqu&eacute;es. Ce processus
-    s'ex&eacute;cute au cours de la phase Fixup.</p>
+    type="section">Directory</directive>) sont appliquées. Ce processus
+    s'exécute au cours de la phase Fixup.</p>
 
-    <p>Dans tous ces cas, <module>mod_rewrite</module> r&eacute;&eacute;crit le
+    <p>Dans tous ces cas, <module>mod_rewrite</module> réécrit le
     <code>REQUEST_URI</code> soit vers une nouvelle URL, soit vers un
     nom de fichier.</p>
 
-    <p>Dans un contexte de niveau r&eacute;pertoire (autrement dit dans les
+    <p>Dans un contexte de niveau répertoire (autrement dit dans les
     fichiers <code>.htaccess</code> et les sections
-    <code>Directory</code>), les r&egrave;gles de r&eacute;&eacute;criture s'appliquent apr&egrave;s
+    <code>Directory</code>), les règles de réécriture s'appliquent après
     la traduction de l'URL en nom de fichier. C'est pourquoi le chemin
     URL auquel <module>mod_rewrite</module> compare initialement les directives
     <directive  module="mod_rewrite">RewriteRule</directive> est le
-    chemin complet vers le nom de fichier traduit amput&eacute; de la partie
-    r&eacute;pertoires (y compris le dernier slash).</p>
+    chemin complet vers le nom de fichier traduit amputé de la partie
+    répertoires (y compris le dernier slash).</p>
 
-    <p>Un exemple : si les r&egrave;gles se trouvent dans
-    /var/www/foo/.htaccess et si une requ&ecirc;te pour /foo/bar/baz est
-    trait&eacute;, une expression comme ^bar/baz$ correspondra.</p>
+    <p>Un exemple : si les règles se trouvent dans
+    /var/www/foo/.htaccess et si une requête pour /foo/bar/baz est
+    traité, une expression comme ^bar/baz$ correspondra.</p>
 
-    <p>Si une substitution intervient dans un contexte de r&eacute;pertoire,
-    une nouvelle sous-requ&ecirc;te interne est g&eacute;n&eacute;r&eacute;e avec la nouvelle URL,
-    ce qui relance le traitement des phases de la requ&ecirc;te. Si la
+    <p>Si une substitution intervient dans un contexte de répertoire,
+    une nouvelle sous-requête interne est générée avec la nouvelle URL,
+    ce qui relance le traitement des phases de la requête. Si la
     substitution est un chemin relatif, la directive <directive
-    module="mod_rewrite">RewriteBase</directive> d&eacute;termine le chemin URL
-    devant pr&eacute;fixer cette substitution. Dans un contexte de r&eacute;pertoire,
-    il faut s'assurer de cr&eacute;er des r&egrave;gles qui
+    module="mod_rewrite">RewriteBase</directive> détermine le chemin URL
+    devant préfixer cette substitution. Dans un contexte de répertoire,
+    il faut s'assurer de créer des règles qui
     n'effectueront pas de substitution au
-    cours d'une passe ult&eacute;rieure du processus de r&eacute;&eacute;criture au niveau
-    r&eacute;pertoire afin d'&eacute;viter les bouclages . Voir <a
+    cours d'une passe ultérieure du processus de réécriture au niveau
+    répertoire afin d'éviter les bouclages . Voir <a
     href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">Bouclage dans le
-    processus de r&eacute;&eacute;criture</a> pour une discussion plus d&eacute;taill&eacute;e &agrave;
-    propos de ce probl&egrave;me.</p>
-
-    <p>En cons&eacute;quence de cette manipulation de l'URL , vous devrez
-    pensez &agrave; confectionner diff&eacute;remment vos r&egrave;gles de r&eacute;&eacute;criture dans un
-    contexte de niveau r&eacute;pertoire. En particulier, rappelez-vous que le
-    chemin de r&eacute;pertoire sera absent de l'URL que vos r&egrave;gles de
-    r&eacute;&eacute;criture verront. Voici quelques exemples qui permettront de
+    processus de réécriture</a> pour une discussion plus détaillée à
+    propos de ce problème.</p>
+
+    <p>En conséquence de cette manipulation de l'URL , vous devrez
+    pensez à confectionner différemment vos règles de réécriture dans un
+    contexte de niveau répertoire. En particulier, rappelez-vous que le
+    chemin de répertoire sera absent de l'URL que vos règles de
+    réécriture verront. Voici quelques exemples qui permettront de
     clarifier les choses :</p>
 
     <table border="1">
 
         <tr>
-            <th>Position de la r&egrave;gle</th>
-            <th>R&egrave;gle</th>
+            <th>Position de la règle</th>
+            <th>Règle</th>
         </tr>
 
         <tr>
@@ -129,82 +129,81 @@ correspondance</a></seealso>
         </tr>
 
         <tr>
-            <td>Fichier .htaccess &agrave; la racine des documents</td>
+            <td>Fichier .htaccess à la racine des documents</td>
             <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
         </tr>
 
         <tr>
-            <td>Fichier .htaccess dans le r&eacute;pertoire images</td>
+            <td>Fichier .htaccess dans le répertoire images</td>
             <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
         </tr>
 
     </table>
 
-    <p>Pour une &eacute;tude plus approfondie de la mani&egrave;re dont <module>mod_rewrite</module>
-    manipule les URLs dans les diff&eacute;rents contextes, vous pouvez
-    consulter les <a href="../mod/mod_rewrite.html#logging">entr&eacute;es du
-    journal</a> g&eacute;n&eacute;r&eacute;es au cours du processus de r&eacute;&eacute;criture.</p>
+    <p>Pour une étude plus approfondie de la manière dont <module>mod_rewrite</module>
+    manipule les URLs dans les différents contextes, vous pouvez
+    consulter les <a href="../mod/mod_rewrite.html#logging">entrées du
+    journal</a> générées au cours du processus de réécriture.</p>
 
 </section>
 
-<section id="InternalRuleset"><title>Traitement du jeu de r&egrave;gles</title>
+<section id="InternalRuleset"><title>Traitement du jeu de règles</title>
 
       <p>Maintenant, quand <module>mod_rewrite</module> se lance dans ces deux phases de
-      l'API, il lit le jeu de r&egrave;gles configur&eacute;es depuis la structure
-      contenant sa configuration (qui a &eacute;t&eacute; elle-m&ecirc;me cr&eacute;&eacute;e soit au
-      d&eacute;marrage d'Apache pour le contexte du serveur, soit lors du
-      parcours des r&eacute;pertoires par le noyau d'Apache pour le contexte de
-      r&eacute;pertoire). Puis le moteur de r&eacute;&eacute;criture est d&eacute;marr&eacute; avec le jeu
-      de r&egrave;gles contenu (une ou plusieurs r&egrave;gles associ&eacute;es &agrave; leurs
-      conditions). En lui-m&ecirc;me, le mode op&eacute;ratoire du moteur de
-      r&eacute;&eacute;criture d'URLs est exactement le m&ecirc;me dans les deux contextes
-      de configuration. Seul le traitement du r&eacute;sultat final diff&egrave;re.</p>
-
-      <p>L'ordre dans lequel les r&egrave;gles sont d&eacute;finies est important car
-      le moteur de r&eacute;&eacute;criture les traite selon une chronologie
-      particuli&egrave;re (et pas tr&egrave;s &eacute;vidente). Le principe est le suivant :
-      le moteur de r&eacute;&eacute;criture traite les r&egrave;gles (les directives <directive
+      l'API, il lit le jeu de règles configurées depuis la structure
+      contenant sa configuration (qui a été elle-même créée soit au
+      démarrage d'Apache pour le contexte du serveur, soit lors du
+      parcours des répertoires par le noyau d'Apache pour le contexte de
+      répertoire). Puis le moteur de réécriture est démarré avec le jeu
+      de règles contenu (une ou plusieurs règles associées à leurs
+      conditions). En lui-même, le mode opératoire du moteur de
+      réécriture d'URLs est exactement le même dans les deux contextes
+      de configuration. Seul le traitement du résultat final diffère.</p>
+
+      <p>L'ordre dans lequel les règles sont définies est important car
+      le moteur de réécriture les traite selon une chronologie
+      particulière (et pas très évidente). Le principe est le suivant :
+      le moteur de réécriture traite les règles (les directives <directive
       module="mod_rewrite">RewriteRule</directive>) les unes
-      &agrave; la suite des autres, et lorsqu'une r&egrave;gle s'applique, il parcourt
-      les &eacute;ventuelles conditions (directives
-      <code>RewriteCond</code>directives) associ&eacute;es.
+      à la suite des autres, et lorsqu'une règle s'applique, il parcourt
+      les éventuelles conditions (directives
+      <code>RewriteCond</code>directives) associées.
       Pour des raisons historiques, les
-      conditions pr&eacute;c&egrave;dent les r&egrave;gles, si bien que le d&eacute;roulement du
-      contr&ocirc;le est un peu compliqu&eacute;. Voir la figure 1 pour plus de
-      d&eacute;tails.</p>
+      conditions précèdent les règles, si bien que le déroulement du
+      contrôle est un peu compliqué. Voir la figure 1 pour plus de
+      détails.</p>
 <p class="figure">
       <img src="../images/rewrite_process_uri.png"
           alt="Flux des comparaisons des directives RewriteRule et RewriteCond" /><br />
-      <dfn>Figure 1:</dfn>D&eacute;roulement du contr&ocirc;le &agrave; travers le jeu de
-      r&egrave;gles de r&eacute;&eacute;criture
+      <dfn>Figure 1:</dfn>Déroulement du contrôle à travers le jeu de
+      règles de réécriture
 </p>
-      <p>L'URL est tout d'abord compar&eacute;e au
-      <em>Mod&egrave;le</em> de chaque r&egrave;gle. Lorsqu'une r&egrave;gle ne s'applique
-      pas, <module>mod_rewrite</module> stoppe imm&eacute;diatement le traitement de cette r&egrave;gle
-      et passe &agrave; la r&egrave;gle suivante. Si l'URL correspond au
-      <em>Mod&egrave;le</em>, <module>mod_rewrite</module> recherche la pr&eacute;sence de conditions
+      <p>L'URL est tout d'abord comparée au
+      <em>Modèle</em> de chaque règle. Lorsqu'une règle ne s'applique
+      pas, <module>mod_rewrite</module> stoppe immédiatement le traitement de cette règle
+      et passe à la règle suivante. Si l'URL correspond au
+      <em>Modèle</em>, <module>mod_rewrite</module> recherche la présence de conditions
       correspondantes (les directives Rewritecond apparaissant dans la
       configuration juste
-      avant les r&egrave;gles de r&eacute;&eacute;criture). S'il n'y en a pas, <module>mod_rewrite</module> remplace
-      l'URL par une cha&icirc;ne &eacute;labor&eacute;e &agrave; partir de la cha&icirc;ne de
-      <em>Substitution</em>, puis passe &agrave; la r&egrave;gle suivante. Si des
-      conditions sont pr&eacute;sentes, <module>mod_rewrite</module> lance un bouclage
+      avant les règles de réécriture). S'il n'y en a pas, <module>mod_rewrite</module> remplace
+      l'URL par une chaîne élaborée à partir de la chaîne de
+      <em>Substitution</em>, puis passe à la règle suivante. Si des
+      conditions sont présentes, <module>mod_rewrite</module> lance un bouclage
       secondaire afin de les traiter selon l'ordre dans lequel elles
-      sont d&eacute;finies. La logique de traitement des conditions est
-      diff&eacute;rente : on ne compare pas l'URL &agrave; un mod&egrave;le. Une cha&icirc;ne de
-      test <em>TestString</em> est tout d'abord &eacute;labor&eacute;e en d&eacute;veloppant
-      des variables, des r&eacute;f&eacute;rences arri&egrave;res, des recherches dans des
-      tables de correspondances, etc..., puis cette cha&icirc;ne de test est
-      compar&eacute;e au mod&egrave;le de condition <em>CondPattern</em>. Si le mod&egrave;le
+      sont définies. La logique de traitement des conditions est
+      différente : on ne compare pas l'URL à un modèle. Une chaîne de
+      test <em>TestString</em> est tout d'abord élaborée en développant
+      des variables, des références arrières, des recherches dans des
+      tables de correspondances, etc..., puis cette chaîne de test est
+      comparée au modèle de condition <em>CondPattern</em>. Si le modèle
       ne correspond pas, les autres conditions du jeu ne sont pas
-      examin&eacute;es et la r&egrave;gle correspondante ne s'applique pas. Si le
-      mod&egrave;le correspond, la condition suivante est examin&eacute;e et ainsi de
-      suite jusqu'&agrave; la derni&egrave;re condition. Si toutes les conditions sont
-      satisfaites, le traitement de la r&egrave;gle en cours se poursuit avec
-      le remplacement de l'URL par la cha&icirc;ne de <em>Substitution</em>.</p>
+      examinées et la règle correspondante ne s'applique pas. Si le
+      modèle correspond, la condition suivante est examinée et ainsi de
+      suite jusqu'à la dernière condition. Si toutes les conditions sont
+      satisfaites, le traitement de la règle en cours se poursuit avec
+      le remplacement de l'URL par la chaîne de <em>Substitution</em>.</p>
 
 </section>
 
 
 </manualpage>
-
diff --git a/docs/manual/rewrite/tech.xml.ja b/docs/manual/rewrite/tech.xml.ja
new file mode 100644 (file)
index 0000000..f82afcc
--- /dev/null
@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 技術的詳細</title>
+
+<summary>
+<p>このドキュメントでは、<module>mod_rewrite</module> と URL マッチングの
+技術的な詳細について説明します。</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap の使用</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="InternalAPI"><title>API フェーズ</title>
+
+    <p>Apache HTTP Server は、いくつかのフェーズでリクエストを処理します。
+    各フェーズでは、リクエストライフサイクルのその部分を処理するために
+    1 つ以上のモジュールが呼び出される可能性があります。フェーズには、
+    URL からファイル名への変換、認証、認可、コンテンツ、ロギングなどが
+    含まれます。(これは完全なリストではありません。)</p>
+
+    <p><module>mod_rewrite</module> は、URL の書き換え方法に影響を与えるために、
+    これらのフェーズ (しばしば「フック」と呼ばれます) のうち 2 つで
+    動作します。</p>
+
+    <p>まず、URL からファイル名への変換フックを使用します。これは
+    HTTP リクエストが読み取られた後、認可が開始される前に発生します。
+    次に、Fixup フックを使用します。これは認可フェーズの後、
+    ディレクトリ単位の設定ファイル (<code>.htaccess</code> ファイル)
+    が読み取られた後、コンテンツハンドラが呼び出される前です。</p>
+
+    <p>リクエストが到着し、対応するサーバまたはバーチャルホストが
+    決定された後、書き換えエンジンはサーバ単位の設定に含まれる
+    <module>mod_rewrite</module> ディレクティブの処理を開始します。
+    (つまり、メインサーバ設定ファイルと
+    <directive module="core" type="section">Virtualhost</directive>
+    セクション内のディレクティブです。) これは URL からファイル名への
+    変換フェーズで発生します。</p>
+
+    <p>数ステップ後、最終的なデータディレクトリが見つかると、
+    ディレクトリ単位の設定ディレクティブ (<code>.htaccess</code>
+    ファイルと <directive module="core"
+    type="section">Directory</directive> ブロック) が適用されます。
+    これは Fixup フェーズで発生します。</p>
+
+    <p>これらの各ケースで、<module>mod_rewrite</module> は
+    <code>REQUEST_URI</code> を新しい URL またはファイル名に
+    書き換えます。</p>
+
+    <p>ディレクトリ単位のコンテキスト (つまり <code>.htaccess</code>
+    ファイルと <code>Directory</code> ブロック内) では、URL が既に
+    ファイル名に変換された後にこれらのルールが適用されます。このため、
+    <module>mod_rewrite</module> が最初に <directive
+    module="mod_rewrite">RewriteRule</directive> ディレクティブと比較する
+    URL パスは、変換されたファイル名のフルファイルシステムパスから、
+    現在のディレクトリのパス (末尾のスラッシュを含む) を先頭から
+    削除したものになります。</p>
+
+    <p>例として: ルールが /var/www/foo/.htaccess にあり、
+    /foo/bar/baz へのリクエストが処理されている場合、^bar/baz$ のような
+    式がマッチします。</p>
+
+    <p>ディレクトリ単位のコンテキストで置換が行われた場合、新しい URL で
+    新しい内部サブリクエストが発行され、リクエストフェーズの処理が
+    再開されます。置換が相対パスの場合、<directive
+    module="mod_rewrite">RewriteBase</directive> ディレクティブが
+    置換の前に付加する URL パスプレフィックスを決定します。
+    ディレクトリ単位のコンテキストでは、ループを避けるために、
+    最終的に (将来のディレクトリ単位の書き換え処理の「ラウンド」で)
+    置換を行わないルールを作成するよう注意する必要があります。
+    (この問題の詳細については
+    <a href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>
+    を参照してください。)</p>
+
+    <p>ディレクトリ単位のコンテキストでの URL のさらなる操作のため、
+    そのコンテキストでは書き換えルールを異なるように作成するよう
+    注意する必要があります。特に、先頭のディレクトリパスが書き換えルールが
+    認識する URL から削除されることを忘れないでください。詳細については
+    以下の例を参照してください。</p>
+
+    <table border="1">
+
+        <tr>
+            <th>ルールの場所</th>
+            <th>ルール</th>
+        </tr>
+
+        <tr>
+            <td>VirtualHost セクション</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>ドキュメントルートの .htaccess ファイル</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>images ディレクトリの .htaccess ファイル</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p><module>mod_rewrite</module> がさまざまなコンテキストで URL をどのように
+    操作するかについてさらに詳しくは、書き換え中に作成される
+    <a href="../mod/mod_rewrite.html#logging">ログエントリ</a>を
+    参照してください。</p>
+
+</section>
+
+<section id="InternalRuleset"><title>ルールセットの処理</title>
+
+      <p>これら 2 つの API フェーズで <module>mod_rewrite</module> がトリガー
+      されると、設定構造体 (サーバ単位のコンテキストではスタートアップ時に
+      作成されたもの、ディレクトリ単位のコンテキストでは Apache カーネルの
+      ディレクトリウォーク中に作成されたもの) から設定済みのルールセットを
+      読み取ります。次に、含まれるルールセット (1 つ以上のルールとその
+      条件のセット) を使用して URL 書き換えエンジンが起動されます。
+      URL 書き換えエンジン自体の動作は、両方の設定コンテキストで
+      まったく同じです。最終結果の処理のみが異なります。</p>
+
+      <p>ルールセット内のルールの順序は重要です。書き換えエンジンは
+      特殊な (あまり直感的ではない) 順序でルールを処理するためです。
+      ルールは次のとおりです: 書き換えエンジンはルールセットをルールごとに
+      (<directive module="mod_rewrite">RewriteRule</directive>
+      ディレクティブ) ループし、特定のルールがマッチすると、対応する
+      条件 (<code>RewriteCond</code> ディレクティブ) をオプションで
+      ループします。歴史的な理由により、条件が先に記述されるため、
+      制御フローは少し冗長になります。詳細は図 1 を参照してください。</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="RewriteRule と RewriteCond マッチングのフロー" /><br />
+      <dfn>図 1:</dfn> 書き換えルールセットを通る制御フロー
+</p>
+      <p>まず、URL が各ルールの <em>Pattern</em> に対してマッチされます。
+      マッチしない場合、<module>mod_rewrite</module> はそのルールの処理を
+      直ちに停止し、次のルールに進みます。<em>Pattern</em> がマッチすると、
+      <module>mod_rewrite</module> は対応するルール条件 (設定内の RewriteRule の
+      直前に記述される RewriteCond ディレクティブ) を探します。
+      条件がない場合、URL を <em>Substitution</em> 文字列から構築された
+      新しい値で置換し、ルールループを続行します。条件が存在する場合、
+      記述された順序で処理する内部ループを開始します。条件のロジックは
+      異なります: 現在の URL に対してパターンをマッチさせるのではなく、
+      まず変数の展開、バックリファレンス、マップ検索<em>等</em>を行って
+      <em>TestString</em> 文字列を作成し、それに対して
+      <em>CondPattern</em> をマッチさせようとします。パターンがマッチしない
+      場合、条件のセット全体と対応するルールが失敗します。パターンが
+      マッチすると、次の条件が処理され、条件がなくなるまで続きます。
+      すべての条件がマッチした場合、URL の <em>Substitution</em> による
+      置換の処理が続行されます。</p>
+
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/tech.xml.ko b/docs/manual/rewrite/tech.xml.ko
new file mode 100644 (file)
index 0000000..3547de1
--- /dev/null
@@ -0,0 +1,194 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 기술적 세부 사항</title>
+
+<summary>
+<p>이 문서는 <module>mod_rewrite</module>와 URL 매칭의 기술적
+세부 사항 일부를 논의합니다.</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<seealso><a href="vhosts.html">가상 호스트</a></seealso>
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap 사용하기</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="InternalAPI"><title>API 단계</title>
+
+    <p>Apache HTTP Server는 여러 단계로 요청을 처리합니다.
+    이러한 각 단계에서 요청 수명 주기의 해당 부분을 처리하기
+    위해 하나 이상의 모듈이 호출될 수 있습니다. 단계에는
+    URL에서 파일명으로의 변환, 인증, 인가, 콘텐츠, 로깅
+    등이 포함됩니다. (이것은 전체 목록이 아닙니다.)</p>
+
+    <p><module>mod_rewrite</module>는 URL이 재작성될 수 있는
+    방식에 영향을 미치기 위해 이러한 단계(또는 종종
+    "훅"이라 불리는) 중 두 가지에서 작동합니다.</p>
+
+    <p>첫째, HTTP 요청이 읽혀진 후 인가가 시작되기 전에
+    발생하는 URL에서 파일명으로의 변환 훅을 사용합니다.
+    둘째, 인가 단계 후 그리고 디렉토리별 설정 파일
+    (<code>.htaccess</code> 파일)이 읽힌 후 콘텐츠
+    핸들러가 호출되기 전에 발생하는 Fixup 훅을
+    사용합니다.</p>
+
+    <p>요청이 들어오고 해당 서버 또는 가상 호스트가
+    결정된 후, 재작성 엔진은 서버별 설정에 나타나는
+    모든 <module>mod_rewrite</module> 지시어의 처리를
+    시작합니다. (즉, 주 서버 설정 파일과
+    <directive module="core" type="section">Virtualhost</directive>
+    섹션에서.) 이것은 URL에서 파일명으로의 단계에서
+    발생합니다.</p>
+
+    <p>몇 단계 후, 최종 데이터 디렉토리가 발견되면
+    디렉토리별 설정 지시어(<code>.htaccess</code> 파일과
+    <directive module="core" type="section">Directory</directive>
+    블록)가 적용됩니다. 이것은 Fixup 단계에서
+    발생합니다.</p>
+
+    <p>이러한 각 경우에 <module>mod_rewrite</module>는
+    <code>REQUEST_URI</code>를 새 URL 또는 파일명으로
+    재작성합니다.</p>
+
+    <p>디렉토리별 컨텍스트(즉, <code>.htaccess</code> 파일과
+    <code>Directory</code> 블록 내)에서 이러한 규칙은
+    URL이 이미 파일명으로 변환된 후에 적용됩니다.
+    이 때문에 <module>mod_rewrite</module>가 처음에
+    <directive module="mod_rewrite">RewriteRule</directive>
+    지시어와 비교하는 URL 경로는 현재 디렉토리 경로(뒤에
+    슬래시 포함)가 앞에서 제거된 변환된 파일명의 전체
+    파일 시스템 경로입니다.</p>
+
+    <p>예를 들어: 규칙이 /var/www/foo/.htaccess에 있고
+    /foo/bar/baz에 대한 요청이 처리되고 있다면
+    ^bar/baz$와 같은 표현식이 일치합니다.</p>
+
+    <p>디렉토리별 컨텍스트에서 치환이 이루어지면
+    새 URL로 새로운 내부 서브요청이 발행되어 요청
+    단계의 처리가 다시 시작됩니다. 치환이 상대 경로인
+    경우 <directive module="mod_rewrite">RewriteBase</directive>
+    지시어가 치환 앞에 추가되는 URL 경로 접두사를
+    결정합니다. 디렉토리별 컨텍스트에서는 루핑을 피하기
+    위해 결국(미래의 디렉토리별 재작성 처리 "라운드"에서)
+    치환을 수행하지 않는 규칙을 작성하도록 주의해야
+    합니다. (이 문제에 대한 자세한 논의는
+    <a href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>을
+    참조하십시오.)</p>
+
+    <p>디렉토리별 컨텍스트에서의 이러한 추가 URL 조작
+    때문에 해당 컨텍스트에서 재작성 규칙을 다르게
+    작성하도록 주의해야 합니다. 특히 앞의 디렉토리 경로가
+    재작성 규칙이 보게 될 URL에서 제거된다는 것을
+    기억하십시오. 더 자세한 설명은 아래 예제를
+    참조하십시오.</p>
+
+    <table border="1">
+
+        <tr>
+            <th>규칙의 위치</th>
+            <th>규칙</th>
+        </tr>
+
+        <tr>
+            <td>VirtualHost 섹션</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>문서 루트의 .htaccess 파일</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>images 디렉토리의 .htaccess 파일</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p><module>mod_rewrite</module>가 다양한 컨텍스트에서
+    URL을 조작하는 방식에 대한 더 많은 통찰력을 얻으려면
+    재작성 중에 생성되는 <a
+    href="../mod/mod_rewrite.html#logging">로그 항목</a>을
+    참조해야 합니다.</p>
+
+</section>
+
+<section id="InternalRuleset"><title>규칙 세트 처리</title>
+
+      <p>이제 <module>mod_rewrite</module>가 이 두 API 단계에서
+      트리거되면 설정 구조에서 구성된 규칙 세트를 읽습니다
+      (이것은 서버별 컨텍스트의 경우 시작 시에 생성되거나
+      디렉토리별 컨텍스트의 경우 Apache 커널의 디렉토리 탐색
+      중에 생성됩니다). 그런 다음 포함된 규칙 세트(하나
+      이상의 규칙과 그 조건)로 URL 재작성 엔진이
+      시작됩니다. URL 재작성 엔진 자체의 동작은 두
+      설정 컨텍스트에서 정확히 동일합니다. 최종 결과
+      처리만 다릅니다.</p>
+
+      <p>규칙 세트에서 규칙의 순서는 재작성 엔진이
+      특별한(그리고 그다지 분명하지 않은) 순서로 처리하므로
+      중요합니다. 규칙은 다음과 같습니다: 재작성 엔진은
+      규칙 세트를 규칙별로(<directive
+      module="mod_rewrite">RewriteRule</directive> 지시어)
+      순회하고 특정 규칙이 일치하면 선택적으로 해당하는
+      기존 조건(<code>RewriteCond</code> 지시어)을
+      순회합니다. 역사적 이유로 조건이 먼저 주어지므로
+      제어 흐름이 약간 장황합니다. 자세한 내용은
+      그림 1을 참조하십시오.</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="RewriteRule과 RewriteCond 매칭의 흐름" /><br />
+      <dfn>그림 1:</dfn> 재작성 규칙 세트를 통한 제어 흐름
+</p>
+      <p>먼저 URL이 각 규칙의 <em>Pattern</em>과
+      비교됩니다. 실패하면 <module>mod_rewrite</module>는
+      즉시 이 규칙의 처리를 중지하고 다음 규칙으로
+      계속합니다. <em>Pattern</em>이 일치하면
+      <module>mod_rewrite</module>는 해당하는 규칙 조건
+      (설정에서 RewriteRule 바로 위에 나타나는
+      RewriteCond 지시어)을 찾습니다. 조건이 없으면
+      <em>Substitution</em> 문자열에서 구성된 새 값으로
+      URL을 치환하고 규칙 순회를 계속합니다. 그러나
+      조건이 있으면 나열된 순서대로 처리하기 위해 내부
+      루프를 시작합니다. 조건의 경우 로직이 다릅니다:
+      현재 URL에 대해 패턴을 매칭하지 않습니다. 대신
+      먼저 변수, 역참조, 맵 조회 <em>등</em>을 확장하여
+      문자열 <em>TestString</em>을 생성한 다음
+      <em>CondPattern</em>을 이에 대해 매칭하려고
+      합니다. 패턴이 일치하지 않으면 전체 조건 세트와
+      해당 규칙이 실패합니다. 패턴이 일치하면 더 이상
+      조건이 없을 때까지 다음 조건이 처리됩니다. 모든
+      조건이 일치하면 <em>Substitution</em>으로 URL을
+      치환하여 처리가 계속됩니다.</p>
+
+</section>
+
+
+</manualpage>
index f8fb2f4fda6e95795ba44d1ff66ee522d4b44474..0e04fe7d6c6db388257c875573757a8cc5407188 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant outdated="yes">fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/tech.xml.tr b/docs/manual/rewrite/tech.xml.tr
new file mode 100644 (file)
index 0000000..f7aa426
--- /dev/null
@@ -0,0 +1,191 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite Teknik Ayrıntıları</title>
+
+<summary>
+<p>Bu belge, <module>mod_rewrite</module> ve URL eşleştirmesinin bazı
+teknik ayrıntılarını tartışır.</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap Kullanımı</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="InternalAPI"><title>API Aşamaları</title>
+
+    <p>Apache HTTP Sunucusu, istekleri birkaç aşamada işler. Bu
+    aşamaların her birinde, istek yaşam döngüsünün o bölümünü
+    işlemek üzere bir veya daha fazla modül çağrılabilir. Aşamalar
+    URL-dosyaadı çevirisi, kimlik doğrulama, yetkilendirme, içerik
+    ve günlükleme gibi şeyleri içerir. (Bu kapsamlı bir liste
+    değildir.)</p>
+
+    <p><module>mod_rewrite</module>, URL'lerin nasıl yeniden
+    yazılabileceğini etkilemek için bu aşamalardan ikisinde (veya
+    sıklıkla çağrıldıkları şekliyle "kancalarda") çalışır.</p>
+
+    <p>İlk olarak, HTTP isteği okunduktan sonra ancak herhangi bir
+    yetkilendirme başlamadan önce gerçekleşen URL-dosyaadı çevirisi
+    kancasını kullanır. İkinci olarak, yetkilendirme aşamalarından
+    sonra ve dizin başına yapılandırma dosyaları
+    (<code>.htaccess</code> dosyaları) okunduktan sonra ancak içerik
+    işleyicisi çağrılmadan önce gerçekleşen Düzeltme (Fixup)
+    kancasını kullanır.</p>
+
+    <p>Bir istek geldikten ve karşılık gelen sunucu veya sanal konak
+    belirlendikten sonra, yeniden yazma motoru sunucu başına
+    yapılandırmada görünen <module>mod_rewrite</module> yönergelerini
+    işlemeye başlar. (Yani ana sunucu yapılandırma dosyası ve
+    <directive module="core" type="section">Virtualhost</directive>
+    bölümleri.) Bu, URL-dosyaadı aşamasında gerçekleşir.</p>
+
+    <p>Birkaç adım sonra, son veri dizinleri bulunduktan sonra dizin
+    başına yapılandırma yönergeleri (<code>.htaccess</code> dosyaları
+    ve <directive module="core" type="section">Directory</directive>
+    blokları) uygulanır. Bu, Düzeltme aşamasında gerçekleşir.</p>
+
+    <p>Bu durumların her birinde <module>mod_rewrite</module>,
+    <code>REQUEST_URI</code>'yi ya yeni bir URL'ye ya da bir dosya
+    adına yeniden yazar.</p>
+
+    <p>Dizin başına bağlamda (yani <code>.htaccess</code> dosyaları ve
+    <code>Directory</code> blokları içinde) bu kurallar, bir URL
+    zaten bir dosya adına çevrilmiş olduktan sonra uygulanır. Bu
+    nedenle, <module>mod_rewrite</module> modülünün <directive
+    module="mod_rewrite">RewriteRule</directive> yönergelerini
+    başlangıçta karşılaştırdığı URL yolu, çevrilen dosya adının tam
+    dosya sistemi yolu olup geçerli dizin yolu (sondaki eğik çizgi
+    dahil) öndeki kısımdan çıkarılmıştır.</p>
+
+    <p>Göstermek gerekirse: Kurallar /var/www/foo/.htaccess içindeyse
+    ve /foo/bar/baz isteği işleniyorsa, ^bar/baz$ gibi bir ifade
+    eşleşecektir.</p>
+
+    <p>Dizin başına bağlamda bir değiştirme yapılırsa, yeni URL ile
+    yeni bir dahili alt istek verilir ve bu da istek aşamalarının
+    işlenmesini yeniden başlatır. Değiştirme göreli bir yolsa,
+    <directive module="mod_rewrite">RewriteBase</directive> yönergesi
+    değiştirmenin önüne eklenen URL yolu önekini belirler. Dizin
+    başına bağlamda, döngüyü önlemek için sonunda (gelecekteki bir
+    dizin başına yeniden yazma işleme "turunda") değiştirme yapmayan
+    kurallar oluşturmaya dikkat edilmelidir. (Bu sorunun daha ayrıntılı
+    tartışması için <a
+    href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>
+    sayfasına bakın.)</p>
+
+    <p>Dizin başına bağlamda URL'nin bu ek işlenmesi nedeniyle, bu
+    bağlamda yeniden yazma kurallarınızı farklı şekilde oluşturmaya
+    dikkat etmeniz gerekecektir. Özellikle, baştaki dizin yolunun
+    yeniden yazma kurallarınızın göreceği URL'den çıkarılacağını
+    unutmayın. Daha fazla açıklama için aşağıdaki örneklere bakın.</p>
+
+    <table border="1">
+
+        <tr>
+            <th>Kuralın konumu</th>
+            <th>Kural</th>
+        </tr>
+
+        <tr>
+            <td>VirtualHost bölümü</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>Belge kökündeki .htaccess dosyası</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>images dizinindeki .htaccess dosyası</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p><module>mod_rewrite</module> modülünün farklı bağlamlarda
+    URL'leri nasıl değiştirdiği hakkında daha fazla bilgi için,
+    yeniden yazma sırasında oluşturulan <a
+    href="../mod/mod_rewrite.html#logging">günlük kayıtlarına</a>
+    başvurmalısınız.</p>
+
+</section>
+
+<section id="InternalRuleset"><title>Kural Kümesi İşleme</title>
+
+      <p>Şimdi <module>mod_rewrite</module> bu iki API aşamasında
+      tetiklendiğinde, yapılandırılmış kural kümelerini yapılandırma
+      yapısından okur (bu yapı sunucu başına bağlam için başlangıçta
+      veya dizin başına bağlam için Apache çekirdeğinin dizin
+      yürüyüşü sırasında oluşturulmuştur). Ardından URL yeniden
+      yazma motoru içerilen kural kümesiyle (bir veya daha fazla kural
+      ve bunların koşulları birlikte) başlatılır. URL yeniden yazma
+      motorunun çalışması her iki yapılandırma bağlamı için de
+      tamamen aynıdır. Yalnızca nihai sonuç işleme farklıdır.</p>
+
+      <p>Kural kümesindeki kuralların sırası önemlidir; çünkü yeniden
+      yazma motoru bunları özel (ve çok belirgin olmayan) bir sırada
+      işler. Kural şudur: Yeniden yazma motoru kural kümesini kural
+      kural (<directive module="mod_rewrite">RewriteRule</directive>
+      yönergeleri) döner ve belirli bir kural eşleştiğinde isteğe
+      bağlı olarak karşılık gelen koşulları (<code>RewriteCond</code>
+      yönergeleri) döner. Tarihsel nedenlerle koşullar önce verilir
+      ve bu nedenle kontrol akışı biraz dolambaçlıdır. Daha fazla
+      ayrıntı için Şekil 1'e bakın.</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="RewriteRule ve RewriteCond eşleştirme akışı" /><br />
+      <dfn>Şekil 1:</dfn>Yeniden yazma kural kümesindeki kontrol akışı
+</p>
+      <p>İlk olarak URL, her kuralın <em>Kalıp</em>'ıyla eşleştirilir.
+      Başarısız olursa <module>mod_rewrite</module> bu kuralı hemen
+      işlemeyi durdurur ve sonraki kuralla devam eder. <em>Kalıp</em>
+      eşleşirse <module>mod_rewrite</module> karşılık gelen kural
+      koşullarını (yapılandırmada RewriteRule'un hemen üstünde görünen
+      RewriteCond yönergeleri) arar. Hiçbiri yoksa, URL'yi
+      <em>Değiştirme</em> dizgesinden oluşturulan yeni bir değerle
+      değiştirir ve kural döngüsüne devam eder. Ancak koşullar
+      varsa, listelenme sırasına göre bunları işlemek için bir iç
+      döngü başlatır. Koşullar için mantık farklıdır: geçerli URL'ye
+      karşı bir kalıp eşleştirmeyiz. Bunun yerine, önce değişkenleri,
+      geri başvuruları, eşlem aramalarını <em>vb.</em> genişleterek
+      bir <em>SınamaDizgesi</em> oluştururuz ve ardından
+      <em>KoşulKalıbı</em>'nı bununla eşleştirmeye çalışırız. Kalıp
+      eşleşmezse, koşulların tamamı ve karşılık gelen kural başarısız
+      olur. Kalıp eşleşirse, daha fazla koşul kalmayana kadar bir
+      sonraki koşul işlenir. Tüm koşullar eşleşirse, URL'nin
+      <em>Değiştirme</em> ile değiştirilmesiyle işleme devam
+      eder.</p>
+
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/tech.xml.zh-cn b/docs/manual/rewrite/tech.xml.zh-cn
new file mode 100644 (file)
index 0000000..0bacf0f
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933438 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="tech.xml.meta">
+<parentdocument href="./">Rewrite</parentdocument>
+
+  <title>Apache mod_rewrite 技术细节</title>
+
+<summary>
+<p>本文档讨论 <module>mod_rewrite</module> 和 URL 匹配的一些技术细节。</p>
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<seealso><a href="vhosts.html">虚拟主机</a></seealso>
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">使用 RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="InternalAPI"><title>API 阶段</title>
+
+    <p>Apache HTTP 服务器分多个阶段处理请求。在每个阶段,
+    一个或多个模块可能被调用来处理请求生命周期的那个部分。
+    这些阶段包括 URL 到文件名转换、身份验证、授权、内容和日志记录等。
+    (这不是一个详尽的列表。)</p>
+
+    <p><module>mod_rewrite</module> 在其中两个阶段(或通常所说的"钩子")
+    中起作用,以影响 URL 的重写方式。</p>
+
+    <p>首先,它使用 URL 到文件名转换钩子,该钩子在 HTTP
+    请求被读取之后、但在任何授权开始之前触发。其次,它使用 Fixup 钩子,
+    该钩子在授权阶段之后、在目录级配置文件(<code>.htaccess</code> 文件)
+    被读取之后、但在内容处理程序被调用之前触发。</p>
+
+    <p>当请求进入并确定了对应的服务器或虚拟主机后,
+    重写引擎开始处理出现在服务器级配置中的所有 <module>mod_rewrite</module>
+    指令。(即在主服务器配置文件和 <directive module="core"
+    type="section">Virtualhost</directive> 配置段中。)
+    这发生在 URL 到文件名转换阶段。</p>
+
+    <p>几个步骤之后,一旦找到最终的数据目录,
+    就会应用目录级配置指令(<code>.htaccess</code> 文件和 <directive
+    module="core" type="section">Directory</directive> 块)。
+    这发生在 Fixup 阶段。</p>
+
+    <p>在每种情况下,<module>mod_rewrite</module> 都会将
+    <code>REQUEST_URI</code> 重写为新的 URL 或文件名。</p>
+
+    <p>在目录级上下文中(即在 <code>.htaccess</code> 文件和
+    <code>Directory</code> 块中),这些规则在 URL
+    已经被转换为文件名之后才被应用。因此,<module>mod_rewrite</module>
+    最初用来与 <directive module="mod_rewrite">RewriteRule</directive>
+    指令进行比较的 URL 路径是转换后的完整文件系统路径,
+    其中当前目录路径(包括尾部斜杠)已从前面被移除。</p>
+
+    <p>举例来说:如果规则位于 /var/www/foo/.htaccess 中,
+    正在处理对 /foo/bar/baz 的请求,则表达式 ^bar/baz$ 将会匹配。</p>
+
+    <p>如果在目录级上下文中进行了替换,将使用新的 URL
+    发出新的内部子请求,重新开始请求阶段的处理。如果替换是相对路径,
+    <directive module="mod_rewrite">RewriteBase</directive>
+    指令决定在替换前面添加的 URL 路径前缀。在目录级上下文中,
+    必须注意创建的规则最终(在未来某轮目录级重写处理中)不会执行替换,
+    以避免循环。(参见 <a
+    href="https://cwiki.apache.org/confluence/display/httpd/RewriteLooping">RewriteLooping</a>
+    以进一步讨论此问题。)</p>
+
+    <p>由于在目录级上下文中对 URL 进行了进一步操作,
+    你需要注意在该上下文中以不同方式编写重写规则。特别要记住,
+    前导目录路径将从你的重写规则所看到的 URL 中被去除。
+    请参考下面的示例以进一步说明。</p>
+
+    <table border="1">
+
+        <tr>
+            <th>规则位置</th>
+            <th>规则</th>
+        </tr>
+
+        <tr>
+            <td>VirtualHost 配置段</td>
+            <td>RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>文档根目录下的 .htaccess 文件</td>
+            <td>RewriteRule "^images/(.+)\.jpg" "images/$1.gif"</td>
+        </tr>
+
+        <tr>
+            <td>images 目录下的 .htaccess 文件</td>
+            <td>RewriteRule "^(.+)\.jpg" "$1.gif"</td>
+        </tr>
+
+    </table>
+
+    <p>要更深入地了解 <module>mod_rewrite</module> 如何在不同上下文中操作 URL,
+    你应该查阅重写期间生成的<a
+    href="../mod/mod_rewrite.html#logging">日志条目</a>。</p>
+
+</section>
+
+<section id="InternalRuleset"><title>规则集处理</title>
+
+      <p>现在当 <module>mod_rewrite</module> 在这两个 API 阶段被触发时,
+      它从其配置结构中读取已配置的规则集(该配置结构在服务器级上下文中于启动时创建,
+      或在目录级上下文中于 Apache 内核的目录遍历过程中创建)。
+      然后使用包含的规则集(一条或多条规则及其条件)启动 URL 重写引擎。
+      URL 重写引擎本身的操作在两种配置上下文中完全相同。
+      只有最终结果的处理方式不同。</p>
+
+      <p>规则集中规则的顺序很重要,因为重写引擎以一种特殊的(且不太直观的)
+      顺序处理它们。规则如下:重写引擎逐条遍历规则集中的规则
+      (<directive module="mod_rewrite">RewriteRule</directive> 指令),
+      当某条规则匹配时,它会可选地遍历对应的条件
+      (<code>RewriteCond</code> 指令)。由于历史原因,
+      条件写在前面,因此控制流程有点绕。参见图 1 了解更多细节。</p>
+<p class="figure">
+      <img src="../images/rewrite_process_uri.png"
+          alt="RewriteRule 和 RewriteCond 匹配流程" /><br />
+      <dfn>图 1:</dfn>重写规则集的控制流程
+</p>
+      <p>首先,URL 与每条规则的<em>模式</em>进行匹配。如果匹配失败,
+      <module>mod_rewrite</module> 立即停止处理该规则,并继续处理下一条规则。
+      如果<em>模式</em>匹配成功,<module>mod_rewrite</module>
+      会查找对应的规则条件(RewriteCond 指令,
+      在配置中紧接在 RewriteRule 之前出现)。
+      如果没有条件,则用从字符串<em>替换</em>构造的新值替换 URL,
+      并继续其规则循环。但如果存在条件,则启动一个内部循环,
+      按照条件列出的顺序处理它们。对于条件,逻辑是不同的:
+      我们不是将模式与当前 URL 匹配。而是首先通过展开变量、
+      反向引用、映射查找<em>等</em>来创建一个字符串 <em>TestString</em>,
+      然后尝试将 <em>CondPattern</em> 与之匹配。如果模式不匹配,
+      则整组条件和对应规则都失败。如果模式匹配,则处理下一个条件,
+      直到没有更多条件为止。如果所有条件都匹配,
+      则继续用<em>替换</em>替换 URL。</p>
+
+</section>
+
+
+</manualpage>
diff --git a/docs/manual/rewrite/vhosts.xml.de b/docs/manual/rewrite/vhosts.xml.de
new file mode 100644 (file)
index 0000000..796f77b
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.de.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Dynamische Massen-Virtual-Hosts mit mod_rewrite</title>
+
+<summary>
+
+<p>Dieses Dokument ergänzt die <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">Referenzdokumentation</a>. Es beschreibt,
+wie Sie <module>mod_rewrite</module> verwenden können, um dynamisch
+konfigurierte virtuelle Hosts zu erstellen.</p>
+
+<note type="warning"><module>mod_rewrite</module> ist normalerweise nicht der beste Weg,
+um virtuelle Hosts zu konfigurieren. Sie sollten zuerst die
+<a href="../vhosts/mass.html">Alternativen</a> in Betracht ziehen, bevor
+Sie auf mod_rewrite zurückgreifen. Siehe auch das Dokument
+"<a href="avoid.html#vhosts">Wie man mod_rewrite vermeidet</a>".</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Moduldokumentation</a></seealso>
+<seealso><a href="intro.html">Einführung in mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Umleitung und Neuzuordnung</a></seealso>
+<seealso><a href="access.html">Zugriffskontrolle</a></seealso>
+<!--<seealso><a href="vhosts.html">Virtuelle Hosts</a></seealso>-->
+<seealso><a href="proxy.html">Proxying</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Fortgeschrittene Techniken</a></seealso>
+<seealso><a href="avoid.html">Wann man mod_rewrite nicht verwenden sollte</a></seealso>
+
+<section id="per-hostname">
+
+  <title>Virtuelle Hosts für beliebige Hostnamen</title>
+
+  <dl>
+    <dt>Beschreibung:</dt>
+
+    <dd>
+    <p>Wir möchten automatisch einen virtuellen Host für jeden Hostnamen
+    erstellen, der in unserer Domain aufgelöst wird, ohne für jeden
+    eine neue VirtualHost-Sektion erstellen zu müssen.</p>
+
+    <p>In diesem Rezept nehmen wir an, dass wir den Hostnamen
+    <code><strong>SITE</strong>.example.com</code> für jeden Benutzer
+    verwenden und deren Inhalte aus
+    <code>/home/<strong>SITE</strong>/www</code> ausliefern. Wir möchten
+    jedoch, dass <code>www.example.com</code> von dieser Zuordnung
+    ausgenommen wird.</p>
+    </dd>
+
+    <dt>Lösung:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>Diskussion</dt>
+    <dd>
+
+    <note type="warning">Sie müssen sich um die DNS-Auflösung kümmern -
+    Apache übernimmt keine Namensauflösung. Sie müssen entweder
+    CNAME-Einträge für jeden Hostnamen oder einen DNS-Wildcard-Eintrag
+    erstellen. Die Erstellung von DNS-Einträgen liegt außerhalb des
+    Umfangs dieses Dokuments.</note>
+
+<p>Die interne <code>tolower</code>-RewriteMap-Direktive wird verwendet,
+um sicherzustellen, dass alle verwendeten Hostnamen in Kleinbuchstaben
+sind, sodass keine Mehrdeutigkeit in der Verzeichnisstruktur entsteht,
+die erstellt werden muss.</p>
+
+<p>Klammern in einer <directive module="mod_rewrite">RewriteCond</directive>
+werden in die Rückreferenzen <code>%1</code>, <code>%2</code> usw.
+erfasst, während Klammern in <directive module="mod_rewrite">RewriteRule</directive>
+in die Rückreferenzen <code>$1</code>, <code>$2</code> usw. erfasst
+werden.</p>
+
+<p>Die erste <code>RewriteCond</code> prüft, ob der Hostname mit
+<code>www.</code> beginnt, und wenn ja, wird die Umschreibung
+übersprungen.</p>
+
+<p>
+Wie bei vielen in diesem Dokument besprochenen Techniken ist
+<module>mod_rewrite</module> wirklich nicht der beste Weg, um diese Aufgabe
+zu erledigen. Sie sollten stattdessen die Verwendung von
+<module>mod_vhost_alias</module> in Betracht ziehen, da es alles jenseits
+der Auslieferung statischer Dateien wesentlich eleganter handhabt, wie
+dynamische Inhalte und Alias-Auflösung.
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title>Dynamische virtuelle Hosts mit
+    <module>mod_rewrite</module></title>
+
+    <p>Dieser Auszug aus <code>httpd.conf</code> bewirkt dasselbe wie
+    <a href="#per-hostname">das erste Beispiel</a>. Die erste Hälfte
+    ist dem entsprechenden Teil oben sehr ähnlich, mit einigen
+    Änderungen, die für die Abwärtskompatibilität und die korrekte
+    Funktionsweise des <module>mod_rewrite</module>-Teils erforderlich
+    sind; die zweite Hälfte konfiguriert <module>mod_rewrite</module>
+    für die eigentliche Arbeit.</p>
+
+    <p>Da <module>mod_rewrite</module> vor anderen URI-Übersetzungsmodulen
+    (z.B. <module>mod_alias</module>) läuft, muss <module>mod_rewrite</module>
+    angewiesen werden, alle URLs, die von diesen Modulen verarbeitet
+    worden wären, explizit zu ignorieren. Und da diese Regeln ansonsten
+    alle <code>ScriptAlias</code>-Direktiven umgehen würden, müssen
+    wir <module>mod_rewrite</module> diese Zuordnungen explizit durchführen
+    lassen.</p>
+
+<highlight language="config">
+# Den Servernamen aus dem Host:-Header ermitteln
+UseCanonicalName Off
+
+# Aufteilbare Protokolldateien
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ExecCGI wird hier benötigt, da wir die CGI-Ausführung
+    # nicht so erzwingen können wie ScriptAlias es tut
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# Ein vom Host:-Header abgeleiteter ServerName kann beliebige Groß-/Kleinschreibung haben
+RewriteMap  lowercase  "int:tolower"
+
+## Zuerst normale Dokumente behandeln:
+# Alias /icons/ zulassen - für andere Aliase wiederholen
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# CGIs zulassen
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# Die Magie ausführen
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## Nun CGIs behandeln - wir müssen einen Handler erzwingen
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>Verwendung einer separaten Konfigurationsdatei für virtuelle Hosts</title>
+
+    <p>Diese Anordnung verwendet fortgeschrittenere
+    <module>mod_rewrite</module>-Funktionen, um die Übersetzung vom
+    virtuellen Host zum Document Root aus einer separaten
+    Konfigurationsdatei abzuleiten. Dies bietet mehr Flexibilität,
+    erfordert aber eine kompliziertere Konfiguration.</p>
+
+    <p>Die <code>vhost.map</code>-Datei sollte in etwa so aussehen:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p>Die <code>httpd.conf</code> sollte Folgendes enthalten:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# Die Map-Datei definieren
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# Aliase wie oben behandeln
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# Dies führt die dateibasierte Neuzuordnung durch
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>
\ No newline at end of file
diff --git a/docs/manual/rewrite/vhosts.xml.es b/docs/manual/rewrite/vhosts.xml.es
new file mode 100644 (file)
index 0000000..68ba8c2
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.es.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>Hosts virtuales masivos dinámicos con mod_rewrite</title>
+
+<summary>
+
+<p>Este documento complementa la <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">documentación de referencia</a>. Describe
+cómo puede usar <module>mod_rewrite</module> para crear hosts virtuales
+configurados dinámicamente.</p>
+
+<note type="warning"><module>mod_rewrite</module> generalmente no es la mejor forma de configurar
+hosts virtuales. Debería considerar primero las <a
+href="../vhosts/mass.html">alternativas</a> antes de recurrir a
+mod_rewrite. Vea también el documento "<a href="avoid.html#vhosts">cómo evitar
+mod_rewrite</a>".</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Documentación del módulo</a></seealso>
+<seealso><a href="intro.html">Introducción a mod_rewrite</a></seealso>
+<seealso><a href="remapping.html">Redirección y remapeo</a></seealso>
+<seealso><a href="access.html">Control de acceso</a></seealso>
+<!--<seealso><a href="vhosts.html">Hosts virtuales</a></seealso>-->
+<seealso><a href="proxy.html">Proxy</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">Técnicas avanzadas</a></seealso>
+<seealso><a href="avoid.html">Cuándo no usar mod_rewrite</a></seealso>
+
+<section id="per-hostname">
+
+  <title>Hosts Virtuales para Nombres de Host Arbitrarios</title>
+
+  <dl>
+    <dt>Descripción:</dt>
+
+    <dd>
+    <p>Queremos crear automáticamente un host virtual para cada nombre de host
+    que resuelva en nuestro dominio, sin tener que crear
+    nuevas secciones VirtualHost.</p>
+
+    <p>En esta receta, asumimos que usaremos el nombre de host
+    <code><strong>SITIO</strong>.example.com</code> para cada
+    usuario, y serviremos su contenido desde
+    <code>/home/<strong>SITIO</strong>/www</code>. Sin embargo, queremos
+    que <code>www.example.com</code> sea omitido de este mapeo.</p>
+    </dd>
+
+    <dt>Solución:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>Discusión</dt>
+    <dd>
+
+    <note type="warning">Necesitará encargarse de la resolución DNS
+    - Apache no maneja la resolución de nombres. Necesitará crear registros CNAME
+    para cada nombre de host, o un registro DNS comodín. La creación de registros DNS
+    está fuera del alcance de este documento.</note>
+
+<p>La directiva interna <code>tolower</code> de RewriteMap se usa para
+asegurar que los nombres de host que se usen estén todos en minúsculas, de modo que no haya
+ambigüedad en la estructura de directorios que debe crearse.</p>
+
+<p>Los paréntesis usados en una <directive
+module="mod_rewrite">RewriteCond</directive> se capturan en las
+referencias inversas <code>%1</code>, <code>%2</code>, etc, mientras que los paréntesis
+usados en <directive module="mod_rewrite">RewriteRule</directive> se
+capturan en las referencias inversas <code>$1</code>, <code>$2</code>,
+etc.</p>
+
+<p>La primera <code>RewriteCond</code> verifica si el nombre de host
+comienza con <code>www.</code>, y si es así, la reescritura se
+omite.</p>
+
+<p>
+Como con muchas técnicas discutidas en este documento, <module>mod_rewrite</module> realmente
+no es la mejor forma de lograr esta tarea. Debería, en su lugar,
+considerar usar <module>mod_vhost_alias</module>, ya que manejará
+mucho más elegantemente cualquier cosa más allá de servir archivos estáticos, como cualquier
+contenido dinámico, y resolución de Alias.
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title>Hosts Virtuales
+    Dinámicos Usando <module>mod_rewrite</module></title>
+
+    <p>Este extracto de <code>httpd.conf</code> hace lo mismo
+    que <a href="#per-hostname">el primer ejemplo</a>. La primera
+    mitad es muy similar a la parte correspondiente anterior, excepto por
+    algunos cambios, necesarios para compatibilidad hacia atrás y para hacer que la
+    parte de <module>mod_rewrite</module> funcione correctamente; la segunda mitad
+    configura <module>mod_rewrite</module> para hacer el trabajo real.</p>
+
+    <p>Debido a que <module>mod_rewrite</module> se ejecuta antes que otros módulos de traducción
+    de URI (por ejemplo, <module>mod_alias</module>), se le debe decir a <module>mod_rewrite</module>
+    que ignore explícitamente cualquier URL que hubiera sido manejada
+    por esos módulos. Y, debido a que estas reglas de lo contrario evitarían
+    cualquier directiva <code>ScriptAlias</code>, debemos hacer que
+    <module>mod_rewrite</module> ejecute explícitamente esos mapeos.</p>
+
+<highlight language="config">
+# get the server name from the Host: header
+UseCanonicalName Off
+
+# splittable logs
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ExecCGI is needed here because we can't force
+    # CGI execution in the way that ScriptAlias does
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# a ServerName derived from a Host: header may be any case at all
+RewriteMap  lowercase  "int:tolower"
+
+## deal with normal documents first:
+# allow Alias /icons/ to work - repeat for other aliases
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# allow CGIs to work
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# do the magic
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## and now deal with CGIs - we have to force a handler
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>Usando un Archivo de Configuración de Host Virtual Separado</title>
+
+    <p>Este arreglo usa características más avanzadas de <module>mod_rewrite</module>
+    para determinar la traducción de host virtual a raíz de documento,
+    desde un archivo de configuración separado. Esto proporciona más
+    flexibilidad, pero requiere una configuración más complicada.</p>
+
+    <p>El archivo <code>vhost.map</code> debería verse algo como
+    esto:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p>El <code>httpd.conf</code> debería contener lo siguiente:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# define the map file
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# deal with aliases as above
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# this does the file-based remap
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/vhosts.xml.ja b/docs/manual/rewrite/vhosts.xml.ja
new file mode 100644 (file)
index 0000000..94a3410
--- /dev/null
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ja.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite を使った動的な大量バーチャルホスト</title>
+
+<summary>
+
+<p>このドキュメントは <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">リファレンスドキュメント</a>を補足するものです。
+<module>mod_rewrite</module> を使用して動的に設定されるバーチャルホストを
+作成する方法を説明します。</p>
+
+<note type="warning"><module>mod_rewrite</module> は通常、バーチャルホストを
+設定する最良の方法ではありません。mod_rewrite に頼る前に、まず
+<a href="../vhosts/mass.html">代替手段</a>を検討してください。
+「<a href="avoid.html#vhosts">mod_rewrite を避ける方法</a>」ドキュメントも
+参照してください。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">モジュールドキュメント</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 入門</a></seealso>
+<seealso><a href="remapping.html">リダイレクトとリマッピング</a></seealso>
+<seealso><a href="access.html">アクセス制御</a></seealso>
+<!--<seealso><a href="vhosts.html">バーチャルホスト</a></seealso>-->
+<seealso><a href="proxy.html">プロキシ</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高度なテクニック</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite を使わない場合</a></seealso>
+
+<section id="per-hostname">
+
+  <title>任意のホスト名に対するバーチャルホスト</title>
+
+  <dl>
+    <dt>説明:</dt>
+
+    <dd>
+    <p>ドメイン内で解決されるすべてのホスト名に対して、新しい
+    VirtualHost セクションを作成することなく、自動的にバーチャルホストを
+    作成したいとします。</p>
+
+    <p>このレシピでは、各ユーザに対してホスト名
+    <code><strong>SITE</strong>.example.com</code> を使用し、
+    コンテンツを <code>/home/<strong>SITE</strong>/www</code> から
+    提供すると仮定しています。ただし、<code>www.example.com</code> は
+    このマッピングから除外したいとします。</p>
+    </dd>
+
+    <dt>解決方法:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>議論</dt>
+    <dd>
+
+    <note type="warning">DNS 解決に注意する必要があります - Apache は
+    名前解決を処理しません。各ホスト名の CNAME レコードか、DNS
+    ワイルドカードレコードを作成する必要があります。DNS レコードの
+    作成はこのドキュメントの範囲外です。</note>
+
+<p>内部 <code>tolower</code> RewriteMap ディレクティブは、使用される
+ホスト名がすべて小文字であることを保証し、作成すべきディレクトリ構造に
+曖昧さがないようにします。</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive> で使用される
+括弧はバックリファレンス <code>%1</code>、<code>%2</code> 等に
+キャプチャされ、<directive module="mod_rewrite">RewriteRule</directive>
+で使用される括弧はバックリファレンス <code>$1</code>、<code>$2</code>
+等にキャプチャされます。</p>
+
+<p>最初の <code>RewriteCond</code> は、ホスト名が <code>www.</code> で
+始まるかどうかを確認し、始まる場合は書き換えがスキップされます。</p>
+
+<p>
+このドキュメントで説明されている多くのテクニックと同様に、
+<module>mod_rewrite</module> はこのタスクを達成する最良の方法では
+ありません。代わりに <module>mod_vhost_alias</module> の使用を検討して
+ください。静的ファイルの提供以外のこと、例えば動的コンテンツや
+Alias の解決をはるかに優雅に処理できます。
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title><module>mod_rewrite</module>
+    を使った動的バーチャルホスト</title>
+
+    <p>この <code>httpd.conf</code> からの抜粋は、
+    <a href="#per-hostname">最初の例</a>と同じことを行います。
+    前半は上記の対応する部分と非常に似ていますが、後方互換性のため、
+    および <module>mod_rewrite</module> 部分が正しく動作するように
+    いくつかの変更が加えられています。後半は <module>mod_rewrite</module>
+    に実際の作業を設定します。</p>
+
+    <p><module>mod_rewrite</module> は他の URI 変換モジュール
+    (例: <module>mod_alias</module>) よりも前に実行されるため、
+    それらのモジュールで処理されるはずの URL を明示的に無視するように
+    <module>mod_rewrite</module> に指示する必要があります。また、これらの
+    ルールは <code>ScriptAlias</code> ディレクティブをバイパスするため、
+    <module>mod_rewrite</module> にそれらのマッピングを明示的に実行させる
+    必要があります。</p>
+
+<highlight language="config">
+# get the server name from the Host: header
+UseCanonicalName Off
+
+# splittable logs
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ExecCGI is needed here because we can't force
+    # CGI execution in the way that ScriptAlias does
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# a ServerName derived from a Host: header may be any case at all
+RewriteMap  lowercase  "int:tolower"
+
+## deal with normal documents first:
+# allow Alias /icons/ to work - repeat for other aliases
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# allow CGIs to work
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# do the magic
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## and now deal with CGIs - we have to force a handler
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>個別のバーチャルホスト設定ファイルの使用</title>
+
+    <p>この構成では、<module>mod_rewrite</module> のより高度な機能を使用して、
+    個別の設定ファイルからバーチャルホストのドキュメントルートへの
+    変換を行います。これにより柔軟性が高まりますが、より複雑な設定が
+    必要になります。</p>
+
+    <p><code>vhost.map</code> ファイルは次のようになります:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p><code>httpd.conf</code> には以下を含める必要があります:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# define the map file
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# deal with aliases as above
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# this does the file-based remap
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/vhosts.xml.ko b/docs/manual/rewrite/vhosts.xml.ko
new file mode 100644 (file)
index 0000000..8e66415
--- /dev/null
@@ -0,0 +1,219 @@
+<?xml version='1.0' encoding='EUC-KR' ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite를 사용한 동적 대량 가상 호스트</title>
+
+<summary>
+
+<p>이 문서는 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">참조 문서</a>를 보충합니다.
+<module>mod_rewrite</module>를 사용하여 동적으로 구성된
+가상 호스트를 만드는 방법을 설명합니다.</p>
+
+<note type="warning"><module>mod_rewrite</module>는 보통 가상 호스트를
+구성하는 최선의 방법이 아닙니다. mod_rewrite에 의존하기 전에
+먼저 <a href="../vhosts/mass.html">대안</a>을 고려해야 합니다.
+"<a href="avoid.html#vhosts">mod_rewrite를 피하는 방법</a>"
+문서도 참조하십시오.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">모듈 문서</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 소개</a></seealso>
+<seealso><a href="remapping.html">리다이렉션과 재매핑</a></seealso>
+<seealso><a href="access.html">접근 제어</a></seealso>
+<!--<seealso><a href="vhosts.html">가상 호스트</a></seealso>-->
+<seealso><a href="proxy.html">프록시</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">고급 기술</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite를 사용하지 말아야 할 경우</a></seealso>
+
+<section id="per-hostname">
+
+  <title>임의 호스트명에 대한 가상 호스트</title>
+
+  <dl>
+    <dt>설명:</dt>
+
+    <dd>
+    <p>새로운 VirtualHost 섹션을 만들지 않고 도메인에서
+    해석되는 모든 호스트명에 대해 자동으로 가상 호스트를
+    만들고자 합니다.</p>
+
+    <p>이 레시피에서는 각 사용자에 대해 호스트명
+    <code><strong>SITE</strong>.example.com</code>을 사용하고
+    <code>/home/<strong>SITE</strong>/www</code>에서 콘텐츠를
+    제공한다고 가정합니다. 그러나
+    <code>www.example.com</code>은 이 매핑에서 제외하고자
+    합니다.</p>
+    </dd>
+
+    <dt>해결책:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>토론</dt>
+    <dd>
+
+    <note type="warning">DNS 해석을 직접 관리해야 합니다 -
+    Apache는 이름 해석을 처리하지 않습니다. 각 호스트명에
+    대한 CNAME 레코드 또는 DNS 와일드카드 레코드를
+    만들어야 합니다. DNS 레코드 생성은 이 문서의 범위를
+    벗어납니다.</note>
+
+<p>내부 <code>tolower</code> RewriteMap 지시어는 사용되는
+호스트명이 모두 소문자인지 확인하여 생성해야 하는 디렉토리
+구조에 모호함이 없도록 합니다.</p>
+
+<p><directive module="mod_rewrite">RewriteCond</directive>에서
+사용된 괄호는 역참조 <code>%1</code>, <code>%2</code> 등으로
+캡처되며, <directive module="mod_rewrite">RewriteRule</directive>에서
+사용된 괄호는 역참조 <code>$1</code>, <code>$2</code> 등으로
+캡처됩니다.</p>
+
+<p>첫 번째 <code>RewriteCond</code>는 호스트명이
+<code>www.</code>로 시작하는지 확인하고, 그렇다면 재작성이
+건너뛰어집니다.</p>
+
+<p>
+이 문서에서 논의된 많은 기술과 마찬가지로,
+<module>mod_rewrite</module>는 실제로 이 작업을 수행하는
+최선의 방법이 아닙니다. 대신 <module>mod_vhost_alias</module>
+사용을 고려해야 합니다. 이 모듈은 동적 콘텐츠와 Alias
+해석 등 정적 파일 제공 이상의 모든 것을 훨씬 더 우아하게
+처리합니다.
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title><module>mod_rewrite</module>를
+    사용한 동적 가상 호스트</title>
+
+    <p><code>httpd.conf</code>에서의 이 발췌는
+    <a href="#per-hostname">첫 번째 예제</a>와 동일한 작업을
+    수행합니다. 전반부는 위의 해당 부분과 매우 유사하지만
+    하위 호환성을 위해 그리고 <module>mod_rewrite</module>
+    부분이 올바르게 작동하도록 필요한 일부 변경이 있습니다.
+    후반부는 실제 작업을 수행하도록
+    <module>mod_rewrite</module>를 구성합니다.</p>
+
+    <p><module>mod_rewrite</module>는 다른 URI 변환 모듈(예:
+    <module>mod_alias</module>) 전에 실행되므로,
+    <module>mod_rewrite</module>에게 그러한 모듈이 처리했을
+    URL을 명시적으로 무시하도록 지시해야 합니다. 또한 이
+    규칙이 <code>ScriptAlias</code> 지시어를 우회하므로
+    <module>mod_rewrite</module>가 이러한 매핑을 명시적으로
+    수행하도록 해야 합니다.</p>
+
+<highlight language="config">
+# get the server name from the Host: header
+UseCanonicalName Off
+
+# splittable logs
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ExecCGI is needed here because we can't force
+    # CGI execution in the way that ScriptAlias does
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# a ServerName derived from a Host: header may be any case at all
+RewriteMap  lowercase  "int:tolower"
+
+## deal with normal documents first:
+# allow Alias /icons/ to work - repeat for other aliases
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# allow CGIs to work
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# do the magic
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## and now deal with CGIs - we have to force a handler
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>별도의 가상 호스트 설정 파일 사용</title>
+
+    <p>이 배치는 더 고급 <module>mod_rewrite</module> 기능을
+    사용하여 별도의 설정 파일에서 가상 호스트에서 문서
+    루트로의 변환을 수행합니다. 이는 더 많은 유연성을
+    제공하지만 더 복잡한 설정이 필요합니다.</p>
+
+    <p><code>vhost.map</code> 파일은 다음과 같은 형태여야
+    합니다:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p><code>httpd.conf</code>에는 다음이 포함되어야
+    합니다:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# define the map file
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# deal with aliases as above
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# this does the file-based remap
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>
index 02e019991d32131bda58588a8006bdd96abd1f15..23efe3a60b1f6b57018130eaa78efaeb21a108c1 100644 (file)
@@ -7,7 +7,13 @@
   <relpath>..</relpath>
 
   <variants>
+    <variant>de</variant>
     <variant>en</variant>
+    <variant>es</variant>
     <variant>fr</variant>
+    <variant>ja</variant>
+    <variant>ko</variant>
+    <variant>tr</variant>
+    <variant>zh-cn</variant>
   </variants>
 </metafile>
diff --git a/docs/manual/rewrite/vhosts.xml.tr b/docs/manual/rewrite/vhosts.xml.tr
new file mode 100644 (file)
index 0000000..149fe39
--- /dev/null
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>mod_rewrite ile Devingen Kitlesel Sanal Konaklar</title>
+
+<summary>
+
+<p>Bu belge, <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">başvuru belgelerini</a> tamamlar.
+Devingen olarak yapılandırılmış sanal konaklar oluşturmak için
+<module>mod_rewrite</module> modülünü nasıl kullanabileceğinizi
+açıklar.</p>
+
+<note type="warning"><module>mod_rewrite</module>, sanal konakları
+yapılandırmanın genellikle en iyi yolu değildir. mod_rewrite'a
+başvurmadan önce <a href="../vhosts/mass.html">alternatifleri</a>
+değerlendirmelisiniz. Ayrıca "<a href="avoid.html#vhosts">mod_rewrite
+kullanmaktan nasıl kaçınılır</a>" belgesine de bakın.</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">Modül belgeleri</a></seealso>
+<seealso><a href="intro.html">mod_rewrite'a giriş</a></seealso>
+<seealso><a href="remapping.html">Yeniden yönlendirme ve yeniden eşleme</a></seealso>
+<seealso><a href="access.html">Erişim denetimi</a></seealso>
+<!--<seealso><a href="vhosts.html">Sanal konaklar</a></seealso>-->
+<seealso><a href="proxy.html">Vekil kullanımı</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">İleri teknikler</a></seealso>
+<seealso><a href="avoid.html">mod_rewrite kullanılmaması gereken durumlar</a></seealso>
+
+<section id="per-hostname">
+
+  <title>Keyfi Konak Adları için Sanal Konaklar</title>
+
+  <dl>
+    <dt>Açıklama:</dt>
+
+    <dd>
+    <p>Alan adımızda çözümlenen her konak adı için, yeni VirtualHost
+    bölümleri oluşturmak zorunda kalmadan otomatik olarak bir sanal
+    konak oluşturmak istiyoruz.</p>
+
+    <p>Bu tarifle, her kullanıcı için
+    <code><strong>SITE</strong>.example.com</code> konak adını
+    kullanacağımızı ve içeriklerini
+    <code>/home/<strong>SITE</strong>/www</code> dizininden
+    sunacağımızı varsayıyoruz. Ancak
+    <code>www.example.com</code>'u bu eşlemeden hariç tutmak
+    istiyoruz.</p>
+    </dd>
+
+    <dt>Çözüm:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>Tartışma</dt>
+    <dd>
+
+    <note type="warning">DNS çözümlemesine dikkat etmeniz
+    gerekecektir - Apache ad çözümlemesini üstlenmez. Her konak adı
+    için CNAME kayıtları veya bir DNS joker kaydı oluşturmanız
+    gerekecektir. DNS kayıtları oluşturmak bu belgenin kapsamı
+    dışındadır.</note>
+
+<p>Kullanılan konak adlarının tümünün küçük harf olmasını sağlamak
+için dahili <code>tolower</code> RewriteMap yönergesi kullanılır;
+böylece oluşturulması gereken dizin yapısında belirsizlik olmaz.</p>
+
+<p>Bir <directive module="mod_rewrite">RewriteCond</directive>
+içinde kullanılan parantezler <code>%1</code>, <code>%2</code> vb.
+geri başvurulara yakalanırken, <directive
+module="mod_rewrite">RewriteRule</directive> içinde kullanılan
+parantezler <code>$1</code>, <code>$2</code> vb. geri başvurulara
+yakalanır.</p>
+
+<p>İlk <code>RewriteCond</code>, konak adının <code>www.</code> ile
+başlayıp başlamadığını kontrol eder ve başlıyorsa yeniden yazma
+atlanır.</p>
+
+<p>
+Bu belgede tartışılan birçok teknikte olduğu gibi, bu görevi
+gerçekleştirmek için <module>mod_rewrite</module> gerçekten en iyi
+yol değildir. Bunun yerine, statik dosyaların sunulmasının ötesinde
+devingen içerik ve Alias çözümlemesi gibi şeyleri çok daha zarif bir
+şekilde ele alacak olan <module>mod_vhost_alias</module> kullanmayı
+düşünmelisiniz.
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title><module>mod_rewrite</module>
+    Kullanılarak Devingen Sanal Konaklar</title>
+
+    <p>Bu <code>httpd.conf</code> alıntısı, <a
+    href="#per-hostname">ilk örnekle</a> aynı şeyi yapar. İlk yarısı
+    yukarıdaki karşılık gelen bölüme çok benzer; ancak geriye dönük
+    uyumluluk ve <module>mod_rewrite</module> bölümünün düzgün
+    çalışması için gereken bazı değişiklikler yapılmıştır; ikinci
+    yarısı ise <module>mod_rewrite</module> modülünü asıl işi yapacak
+    şekilde yapılandırır.</p>
+
+    <p><module>mod_rewrite</module>, diğer URI çeviri modüllerinden
+    (örneğin <module>mod_alias</module>) önce çalıştığından,
+    <module>mod_rewrite</module> modülüne bu modüller tarafından
+    işlenecek URL'leri açıkça yok sayması söylenmelidir. Ve bu
+    kurallar aksi takdirde <code>ScriptAlias</code> yönergelerini
+    atlayacağından, <module>mod_rewrite</module> modülünün bu
+    eşlemeleri açıkça uygulaması gerekir.</p>
+
+<highlight language="config">
+# Konak adını Host: başlığından al
+UseCanonicalName Off
+
+# bölünebilir günlükler
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ScriptAlias'ın yaptığı gibi CGI yürütmesini
+    # zorlayamadığımız için burada ExecCGI gereklidir
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# bir Host: başlığından türetilen ServerName herhangi bir durumda olabilir
+RewriteMap  lowercase  "int:tolower"
+
+## önce normal belgeleri ele al:
+# Alias /icons/ çalışmasına izin ver - diğer takma adlar için tekrarla
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# CGI'lerin çalışmasına izin ver
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# sihri yap
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## şimdi CGI'lerle ilgilen - bir işleyici zorlamalıyız
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>Ayrı Bir Sanal Konak Yapılandırma Dosyası Kullanımı</title>
+
+    <p>Bu düzenleme, sanal konaktan belge köküne çeviriyi ayrı bir
+    yapılandırma dosyasından çözmek için daha gelişmiş
+    <module>mod_rewrite</module> özelliklerini kullanır. Bu daha fazla
+    esneklik sağlar ancak daha karmaşık yapılandırma gerektirir.</p>
+
+    <p><code>vhost.map</code> dosyası şöyle görünmelidir:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p><code>httpd.conf</code> dosyası şunları içermelidir:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# eşlem dosyasını tanımla
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# takma adlarla yukarıdaki gibi ilgilen
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# dosya tabanlı yeniden eşlemeyi yap
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>
diff --git a/docs/manual/rewrite/vhosts.xml.zh-cn b/docs/manual/rewrite/vhosts.xml.zh-cn
new file mode 100644 (file)
index 0000000..144bd2e
--- /dev/null
@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
+<?xml-stylesheet type="text/xsl" href="../style/manual.zh-cn.xsl"?>
+<!-- English Revision: 1933071 -->
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<manualpage metafile="vhosts.xml.meta">
+  <parentdocument href="./">Rewrite</parentdocument>
+
+<title>使用 mod_rewrite 实现动态批量虚拟主机</title>
+
+<summary>
+
+<p>本文档是 <module>mod_rewrite</module>
+<a href="../mod/mod_rewrite.html">参考文档</a>的补充。它描述了如何使用
+<module>mod_rewrite</module> 来创建动态配置的虚拟主机。</p>
+
+<note type="warning"><module>mod_rewrite</module> 通常不是配置虚拟主机的最佳方式。
+你应该首先考虑<a href="../vhosts/mass.html">其他替代方案</a>,
+然后再求助于 mod_rewrite。另请参阅"<a href="avoid.html#vhosts">如何避免使用
+mod_rewrite</a>"文档。</note>
+
+</summary>
+<seealso><a href="../mod/mod_rewrite.html">模块文档</a></seealso>
+<seealso><a href="intro.html">mod_rewrite 简介</a></seealso>
+<seealso><a href="remapping.html">重定向和重映射</a></seealso>
+<seealso><a href="access.html">访问控制</a></seealso>
+<!--<seealso><a href="vhosts.html">虚拟主机</a></seealso>-->
+<seealso><a href="proxy.html">代理</a></seealso>
+<seealso><a href="rewritemap.html">RewriteMap</a></seealso>
+<seealso><a href="advanced.html">高级技术</a></seealso>
+<seealso><a href="avoid.html">何时不使用 mod_rewrite</a></seealso>
+
+<section id="per-hostname">
+
+  <title>任意主机名的虚拟主机</title>
+
+  <dl>
+    <dt>描述:</dt>
+
+    <dd>
+    <p>我们希望为域中解析的每个主机名自动创建虚拟主机,
+    而无需创建新的 VirtualHost 配置段。</p>
+
+    <p>在本配置方案中,我们假设对每个用户使用主机名
+    <code><strong>SITE</strong>.example.com</code>,
+    并从 <code>/home/<strong>SITE</strong>/www</code> 提供其内容。
+    但是,我们希望 <code>www.example.com</code> 不包含在此映射中。</p>
+    </dd>
+
+    <dt>解决方案:</dt>
+
+    <dd>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap    lowercase int:tolower
+
+RewriteCond   %{HTTP_HOST} !^www\.
+RewriteCond   ${lowercase:%{<strong>HTTP_HOST</strong>}}   ^<strong>([^.]+)</strong>\.example\.com$
+RewriteRule   ^(.*)    /home/<strong>%1</strong>/www$1
+</highlight></dd>
+
+<dt>讨论</dt>
+    <dd>
+
+    <note type="warning">你需要注意 DNS 解析 - Apache
+    不处理名称解析。你需要为每个主机名创建 CNAME 记录,
+    或者创建 DNS 通配符记录。创建 DNS 记录超出了本文档的范围。</note>
+
+<p>内部 <code>tolower</code> RewriteMap 指令用于确保所使用的主机名全部为小写,
+以避免目录结构中的歧义。</p>
+
+<p>在 <directive module="mod_rewrite">RewriteCond</directive>
+中使用的括号会被捕获到反向引用 <code>%1</code>、<code>%2</code> 等中,
+而在 <directive module="mod_rewrite">RewriteRule</directive>
+中使用的括号会被捕获到反向引用 <code>$1</code>、<code>$2</code> 等中。</p>
+
+<p>第一个 <code>RewriteCond</code> 检查主机名是否以 <code>www.</code> 开头,
+如果是,则跳过重写。</p>
+
+<p>
+与本文档中讨论的许多技术一样,<module>mod_rewrite</module>
+确实不是完成此任务的最佳方式。你应该考虑使用
+<module>mod_vhost_alias</module>,因为它能更优雅地处理静态文件之外的任何内容,
+包括动态内容和 Alias 解析。
+</p>
+    </dd>
+  </dl>
+
+</section>
+
+<section id="simple.rewrite"><title>使用
+    <module>mod_rewrite</module> 的动态虚拟主机</title>
+
+    <p>此 <code>httpd.conf</code> 摘录与<a href="#per-hostname">第一个示例</a>
+    实现相同的功能。前半部分与上面对应的部分非常相似,
+    只是为了向后兼容和使 <module>mod_rewrite</module> 部分正常工作而做了一些更改;
+    后半部分配置 <module>mod_rewrite</module> 来完成实际工作。</p>
+
+    <p>因为 <module>mod_rewrite</module> 在其他 URI 转换模块
+    (例如 <module>mod_alias</module>)之前运行,
+    必须告知 <module>mod_rewrite</module> 显式忽略那些本应由这些模块处理的 URL。
+    而且,由于这些规则会绕过任何 <code>ScriptAlias</code> 指令,
+    我们必须让 <module>mod_rewrite</module> 显式执行这些映射。</p>
+
+<highlight language="config">
+# get the server name from the Host: header
+UseCanonicalName Off
+
+# splittable logs
+LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon
+CustomLog "logs/access_log" vcommon
+
+&lt;Directory "/www/hosts"&gt;
+    # ExecCGI is needed here because we can't force
+    # CGI execution in the way that ScriptAlias does
+    Options FollowSymLinks ExecCGI
+&lt;/Directory&gt;
+
+RewriteEngine On
+
+# a ServerName derived from a Host: header may be any case at all
+RewriteMap  lowercase  "int:tolower"
+
+## deal with normal documents first:
+# allow Alias /icons/ to work - repeat for other aliases
+RewriteCond  "%{REQUEST_URI}"  "!^/icons/"
+# allow CGIs to work
+RewriteCond  "%{REQUEST_URI}"  "!^/cgi-bin/"
+# do the magic
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1"
+
+## and now deal with CGIs - we have to force a handler
+RewriteCond  "%{REQUEST_URI}"  "^/cgi-bin/"
+RewriteRule  "^/(.*)$"         "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1"  [H=cgi-script]
+</highlight>
+
+</section>
+
+<section id="xtra-conf"><title>使用独立的虚拟主机配置文件</title>
+
+    <p>此方案使用更高级的 <module>mod_rewrite</module> 功能,
+    从独立的配置文件中计算从虚拟主机到文档根目录的转换。
+    这提供了更大的灵活性,但需要更复杂的配置。</p>
+
+    <p><code>vhost.map</code> 文件应类似于:</p>
+
+<example>
+customer-1.example.com  /www/customers/1<br />
+customer-2.example.com  /www/customers/2<br />
+# ...<br />
+customer-N.example.com  /www/customers/N<br />
+</example>
+
+    <p><code>httpd.conf</code> 应包含以下内容:</p>
+
+<highlight language="config">
+RewriteEngine on
+
+RewriteMap   lowercase  "int:tolower"
+
+# define the map file
+RewriteMap   vhost      "txt:/www/conf/vhost.map"
+
+# deal with aliases as above
+RewriteCond  "%{REQUEST_URI}"               "!^/icons/"
+RewriteCond  "%{REQUEST_URI}"               "!^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+# this does the file-based remap
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/(.*)$"                      "%1/docs/$1"
+
+RewriteCond  "%{REQUEST_URI}"               "^/cgi-bin/"
+RewriteCond  "${lowercase:%{SERVER_NAME}}"  "^(.+)$"
+RewriteCond  "${vhost:%1}"                  "^(/.*)$"
+RewriteRule  "^/cgi-bin/(.*)$"                      "%1/cgi-bin/$1" [H=cgi-script]
+</highlight>
+
+</section>
+
+</manualpage>