]> granicus.if.org Git - apache/commitdiff
An example of using the [T] flag.
authorRich Bowen <rbowen@apache.org>
Wed, 25 Jul 2007 16:22:24 +0000 (16:22 +0000)
committerRich Bowen <rbowen@apache.org>
Wed, 25 Jul 2007 16:22:24 +0000 (16:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@559511 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/rewrite/flags.html.en
docs/manual/rewrite/flags.xml

index b3eb688d503fe440d52530812ac6d95f09fe6442..f97654f8ea91f8dd638e227c24ad66f1c8b28c5c 100644 (file)
@@ -210,7 +210,21 @@ negate those conditions and use a [Skip] flag.</p>
 
 
 <h3><a name="flag_t" id="flag_t">T|type</a></h3>
-<p>Type flag</p>
+<p>Sets the MIME type with which the resulting response will be
+sent. This has the same effect as the <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> directive.</p>
+
+<p>For example, you might use the following technique to serve Perl
+source code as plain text, if requested in a particular way:</p>
+
+<div class="example"><p><code>
+# Files with 'IMG' in the name are gif images.
+RewriteRule IMG - [T=image/gif]
+</code></p></div>
+
+<p>Please note that this is a trivial example, and could be better done
+using &lt;FilesMatch&gt; instead. Always consider the alternate
+solutions to a problem before resorting to rewrite, which will
+invariably be a less efficient solution than the alternatives.</p>
 
 
 </div></div>
index bf97b577b2bb2347f61e266b6738a7641553561e..bf9d5feeb28ffbd1256de9f249b655788fcd837e 100644 (file)
@@ -221,7 +221,22 @@ negate those conditions and use a [Skip] flag.</p>
 </section>
 
 <section id="flag_t"><title>T|type</title>
-<p>Type flag</p>
+<p>Sets the MIME type with which the resulting response will be
+sent. This has the same effect as the <directive
+module="mod_mime">AddType</directive> directive.</p>
+
+<p>For example, you might use the following technique to serve Perl
+source code as plain text, if requested in a particular way:</p>
+
+<example>
+# Files with 'IMG' in the name are gif images.
+RewriteRule IMG - [T=image/gif]
+</example>
+
+<p>Please note that this is a trivial example, and could be better done
+using &lt;FilesMatch&gt; instead. Always consider the alternate
+solutions to a problem before resorting to rewrite, which will
+invariably be a less efficient solution than the alternatives.</p>
 </section>
 
 </section>