mod_asis.html revision 57fad287a8bc02321dfbb74280dd4d6540482e09
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<HTML>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<HEAD>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<TITLE>Apache module mod_asis</TITLE>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech</HEAD>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<!-- Background white, links blue (unvisited), navy (visited), red (active) -->
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<BODY
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech BGCOLOR="#FFFFFF"
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech TEXT="#000000"
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech LINK="#0000FF"
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech VLINK="#000080"
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech ALINK="#FF0000"
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<!--#include virtual="header.html" -->
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<H1 ALIGN="CENTER">Module mod_asis</H1>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechThis module is contained in the <CODE>mod_asis.c</CODE> file, and
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechis compiled in by default. It provides for <CODE>.asis</CODE> files. Any
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechdocument with mime type <CODE>httpd/send-as-is</CODE> will be processed by
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechthis module.
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<!--%plaintext &lt;?INDEX {\tt httpd/send-as-is} mime type&gt; -->
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<H2>Purpose</H2>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechTo allow file types to be defined such that Apache sends them without
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechadding HTTP headers.<P>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechThis can be used to send any kind of data from the server, including redirects
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březinaand other special HTTP responses, without requiring a cgi-script or an nph
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechscript.
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina<H2>Usage</H2>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechIn the server configuration file, define a new mime type called
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina<CODE>httpd/send-as-is</CODE> <EM>e.g.</EM>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<BLOCKQUOTE><CODE>AddType httpd/send-as-is asis</CODE></BLOCKQUOTE>
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březinathis defines the <CODE>.asis</CODE> file extension as being of the new
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<CODE>httpd/send-as-is</CODE> mime type. The contents of any file with a
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina<CODE>.asis</CODE> extension will then be sent by Apache to the client with
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cechalmost no changes. Clients will need HTTP headers to be attached, so do not
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březinaforget them. A Status: header is also required; the data should be the
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech3-digit HTTP response code, followed by a textual message.<P>
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechHere's an example of a file whose contents are sent <EM>as is</EM> so as to
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březinatell the client that a file has redirected.
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<BLOCKQUOTE><CODE>
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel BřezinaStatus: 301 Now where did I leave that URL <BR>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr CechLocation: http://xyz.abc.com/foo/bar.html <BR>
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel BřezinaContent-type: text/html <BR>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech<BR>
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina&lt;HTML&gt; <BR>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech&lt;HEAD&gt; <BR>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech&lt;TITLE&gt;Lame excuses'R'us&lt;/TITLE&gt; <BR>
376eaf187c13c2a1eaea0ffbdd970b6b563ab74cPetr Cech&lt;/HEAD&gt; <BR>
&lt;BODY&gt; <BR>
&lt;H1&gt;Fred's exceptionally wonderful page has moved to <BR>
&lt;A HREF="http://xyz.abc.com/foo/bar.html"&gt;Joe's&lt;/A&gt; site. <BR>
&lt;/H1&gt; <BR>
&lt;/BODY&gt; <BR>
&lt;/HTML&gt;
</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>
<!--#include virtual="footer.html" -->
</BODY>
</HTML>