| <?xml version="1.0"?> | |
| <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd"> | |
| <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?> | |
| <!-- $LastChangedRevision$ --> | |
| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one or more | |
| contributor license agreements. See the NOTICE file distributed with | |
| this work for additional information regarding copyright ownership. | |
| The ASF licenses this file to You under the Apache License, Version 2.0 | |
| (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and | |
| limitations under the License. | |
| --> | |
| <modulesynopsis metafile="mod_asis.xml.meta"> | |
| <name>mod_asis</name> | |
| <description>Sends files that contain their own | |
| HTTP headers</description> | |
| <status>Base</status> | |
| <sourcefile>mod_asis.c</sourcefile> | |
| <identifier>asis_module</identifier> | |
| <summary> | |
| <p>This module provides the handler <code>send-as-is</code> | |
| which causes Apache HTTP Server to send the document without adding most of | |
| the usual HTTP headers.</p> | |
| <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.</p> | |
| <p>For historical reasons, this module will also process any | |
| file with the mime type <code>httpd/send-as-is</code>.</p> | |
| </summary> | |
| <seealso><module>mod_headers</module></seealso> | |
| <seealso><module>mod_cern_meta</module></seealso> | |
| <seealso><a href="../handler.html">Apache httpd's Handler Use</a></seealso> | |
| <section id="usage"><title>Usage</title> | |
| <p>In the server configuration file, associate files with the | |
| <code>send-as-is</code> handler <em>e.g.</em></p> | |
| <highlight language="config"> | |
| AddHandler send-as-is asis | |
| </highlight> | |
| <p>The contents of any file with a <code>.asis</code> extension | |
| will then be sent by Apache httpd to the client with almost no | |
| changes. In particular, HTTP headers are derived from the file | |
| itself according to <module>mod_cgi</module> rules, so an asis | |
| file must include valid headers, and may also use the CGI | |
| <code>Status:</code> header to determine the HTTP response | |
| code. The <code>Content-Length:</code> header will automatically | |
| be inserted or, if included, corrected by httpd.</p> | |
| <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.</p> | |
| <example> | |
| Status: 301 Now where did I leave that URL<br /> | |
| Location: http://xyz.example.com/foo/bar.html<br /> | |
| Content-type: text/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.example.com/foo/bar.html">Joe's</a> | |
| site.<br /> | |
| </h1><br /> | |
| </body><br /> | |
| </html> | |
| </example> | |
| <note><title>Notes:</title> | |
| <p>The server always adds a <code>Date:</code> and <code>Server:</code> | |
| 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 | |
| <code>Last-Modified</code> header; it probably should.</p> | |
| </note> | |
| </section> | |
| </modulesynopsis> |