From dfb116c70121194fb247aefc7b3ba2bb3d4c2b7f Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Wed, 25 Jul 2007 16:22:24 +0000 Subject: [PATCH] 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 --- docs/manual/rewrite/flags.html.en | 16 +++++++++++++++- docs/manual/rewrite/flags.xml | 17 ++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/manual/rewrite/flags.html.en b/docs/manual/rewrite/flags.html.en index b3eb688d50..f97654f8ea 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 bf97b577b2..bf9d5feeb2 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.

-- 2.40.0