mod_asis.html revision 3d76f0e292da6a107829fbe83f98b8c0985c6ddb
<!--%hypertext -->
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>Apache module mod_asis</TITLE>
</HEAD>
<BODY>
<!--/%hypertext -->
<H1>Module mod_asis</h1>
is compiled in by default. It provides for <code>.asis</code> files. Any
this module.
<!--%plaintext <?INDEX {\tt httpd/send-as-is} mime type> -->
<h2>Purpose</h2>
To allow file types to be defined such that Apache sends them without
adding HTTP headers.<P>
This can be used to send any kind of data from the server, including redirects
and other special HTTP responses, without requiring a cgi-script or an nph
script.
<h2>Usage</h2>
In the server configuration file, define a new mime type called
this defines the <code>.asis</code> file extension as being of the new
<code>.asis</code> extension will then be sent by Apache to the client with
almost no changes. Clients will need HTTP headers to be attached, so do not
forget them. A Status: header is also required; the data should be the
3-digit HTTP response code, followed by a textual message.<p>
Here's an example of a file whose contents are sent <em>as is</em> so as to
tell the client that a file has redirected.
<blockquote><code>
Status: 302 Now where did I leave that URL <br>
Location: http://xyz.abc.com/foo/bar.html <br>
<br>
<HTML> <br>
<HEAD> <br>
<TITLE>Lame excuses'R'us</TITLE> <br>
</HEAD> <br>
<BODY> <br>
<H1>Fred's exceptionally wonderful page has moved to <br>
<A HREF="http://xyz.abc.com/foo/bar.html">Joe's</A> site. <br>
</H1> <br>
</BODY> <br>
</HTML>
</code></blockquote>
Notes: the server always adds a Date: and Server: header to the data returned
to the client, so these should not be included in the file.
The server does <em>not</em> add a Last-Modified header; it probably should.
<P>
<!--%hypertext -->
<HR>
</BODY>
</HTML>
<!--/%hypertext -->