2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
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
14 http://www.apache.org/licenses/LICENSE-2.0
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.
23 <modulesynopsis metafile="mod_asis.xml.meta">
26 <description>Sends files that contain their own
27 HTTP headers</description>
29 <sourcefile>mod_asis.c</sourcefile>
30 <identifier>asis_module</identifier>
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>
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>
41 <p>For historical reasons, this module will also process any
42 file with the mime type <code>httpd/send-as-is</code>.</p>
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>
49 <section id="usage"><title>Usage</title>
51 <p>In the server configuration file, associate files with the
52 <code>send-as-is</code> handler <em>e.g.</em></p>
54 <highlight language="config">AddHandler send-as-is asis</highlight>
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>
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
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 />
77 <title>Lame excuses'R'us</title><br />
80 <h1>Fred's exceptionally wonderful page has moved to<br />
81 <a href="http://xyz.example.com/foo/bar.html">Joe's</a>
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>