From: Rich Bowen Date: Wed, 25 Jul 2007 16:22:24 +0000 (+0000) Subject: An example of using the [T] flag. X-Git-Tag: 2.3.0~1692 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfb116c70121194fb247aefc7b3ba2bb3d4c2b7f;p=thirdparty%2Fapache%2Fhttpd.git An example of using the [T] flag. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@559511 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index b3eb688d503..f97654f8ea9 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -210,7 +210,21 @@ negate those conditions and use a [Skip] flag.

T|type

-

Type flag

+

Sets the MIME type with which the resulting response will be +sent. This has the same effect as the AddType directive.

+ +

For example, you might use the following technique to serve Perl +source code as plain text, if requested in a particular way:

+ +

+# Files with 'IMG' in the name are gif images. +RewriteRule IMG - [T=image/gif] +

+ +

Please note that this is a trivial example, and could be better done +using <FilesMatch> instead. Always consider the alternate +solutions to a problem before resorting to rewrite, which will +invariably be a less efficient solution than the alternatives.

diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index bf97b577b2b..bf9d5feeb28 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -221,7 +221,22 @@ negate those conditions and use a [Skip] flag.

T|type -

Type flag

+

Sets the MIME type with which the resulting response will be +sent. This has the same effect as the AddType directive.

+ +

For example, you might use the following technique to serve Perl +source code as plain text, if requested in a particular way:

+ + +# Files with 'IMG' in the name are gif images. +RewriteRule IMG - [T=image/gif] + + +

Please note that this is a trivial example, and could be better done +using <FilesMatch> instead. Always consider the alternate +solutions to a problem before resorting to rewrite, which will +invariably be a less efficient solution than the alternatives.