[APACHE DOCUMENTATION]

Apache HTTP Server Version 1.2

Module mod_asis

This module is contained in the mod_asis.c file, and is compiled in by default. It provides for .asis files. Any document with mime type httpd/send-as-is will be processed by this module.

Purpose

To allow file types to be defined such that Apache sends them without adding HTTP headers.

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.

Usage

In the server configuration file, define a new mime type called httpd/send-as-is e.g.
AddType httpd/send-as-is asis
this defines the .asis file extension as being of the new httpd/send-as-is mime type. The contents of any file with a .asis 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.

Here's an example of a file whose contents are sent as is so as to tell the client that a file has redirected.

Status: 302 Now where did I leave that URL
Location: http://xyz.abc.com/foo/bar.html
Content-type: text/html

<HTML>
<HEAD>
<TITLE>Lame excuses'R'us</TITLE>
</HEAD>
<BODY>
<H1>Fred's exceptionally wonderful page has moved to
<A HREF="http://xyz.abc.com/foo/bar.html">Joe's</A> site.
</H1>
</BODY>
</HTML>
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 not add a Last-Modified header; it probably should.


Apache HTTP Server Version 1.2

Index Home