]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_asis.xml
xforms
[apache] / docs / manual / mod / mod_asis.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Licensed to the Apache Software Foundation (ASF) under one or more
8  contributor license agreements.  See the NOTICE file distributed with
9  this work for additional information regarding copyright ownership.
10  The ASF licenses this file to You under the Apache License, Version 2.0
11  (the "License"); you may not use this file except in compliance with
12  the License.  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_asis.xml.meta">
24
25 <name>mod_asis</name>
26 <description>Sends files that contain their own
27 HTTP headers</description>
28 <status>Base</status>
29 <sourcefile>mod_asis.c</sourcefile>
30 <identifier>asis_module</identifier>
31
32 <summary>
33     <p>This module provides the handler <code>send-as-is</code>
34     which causes Apache HTTP Server to send the document without adding most of
35     the usual HTTP headers.</p>
36
37     <p>This can be used to send any kind of data from the server,
38     including redirects and other special HTTP responses, without
39     requiring a cgi-script or an nph script.</p>
40
41     <p>For historical reasons, this module will also process any
42     file with the mime type <code>httpd/send-as-is</code>.</p>
43 </summary>
44
45 <seealso><module>mod_headers</module></seealso>
46 <seealso><module>mod_cern_meta</module></seealso>
47 <seealso><a href="../handler.html">Apache httpd's Handler Use</a></seealso>
48
49 <section id="usage"><title>Usage</title>
50
51     <p>In the server configuration file, associate files with the
52     <code>send-as-is</code> handler <em>e.g.</em></p>
53
54     <highlight language="config">AddHandler send-as-is asis</highlight>
55
56     <p>The contents of any file with a <code>.asis</code> extension
57     will then be sent by Apache httpd to the client with almost no
58     changes. In particular, HTTP headers are derived from the file
59     itself according to <module>mod_cgi</module> rules, so an asis
60     file must include valid headers, and may also use the CGI
61     <code>Status:</code> header to determine the HTTP response
62     code. The <code>Content-Length:</code> header will automatically
63     be inserted or, if included, corrected by httpd.</p>
64
65     <p>Here's an example of a file whose contents are sent <em>as
66     is</em> so as to tell the client that a file has
67     redirected.</p>
68
69
70     <example>
71       Status: 301 Now where did I leave that URL<br />
72       Location: http://xyz.example.com/foo/bar.html<br />
73       Content-type: text/html<br />
74       <br />
75       &lt;html&gt;<br />
76       &lt;head&gt;<br />
77       &lt;title&gt;Lame excuses'R'us&lt;/title&gt;<br />
78       &lt;/head&gt;<br />
79       &lt;body&gt;<br />
80       &lt;h1&gt;Fred's exceptionally wonderful page has moved to<br />
81       &lt;a href="http://xyz.example.com/foo/bar.html"&gt;Joe's&lt;/a&gt;
82       site.<br />
83       &lt;/h1&gt;<br />
84       &lt;/body&gt;<br />
85       &lt;/html&gt;
86     </example>
87
88     <note><title>Notes:</title>
89     <p>The server always adds a <code>Date:</code> and <code>Server:</code>
90     header to the data returned to the client, so these should not be
91     included in the file. The server does <em>not</em> add a
92     <code>Last-Modified</code> header; it probably should.</p>
93     </note>
94 </section>
95
96 </modulesynopsis>