<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AskApache &#187; Search Results  &#187;  phpBB</title>
	<atom:link href="http://www.askapache.com/search/phpBB/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Sun, 29 Jan 2012 12:04:08 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HTTP Status Codes and Htaccess ErrorDocuments</title>
		<link>http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html</link>
		<comments>http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#comments</comments>
		<pubDate>Tue, 04 Jan 2011 20:56:15 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/wow-i-served-a-page-for-every-single-http-status-code-and-saved-headers-and-content.html</guid>
		<description><![CDATA[<p>There are a total of <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#apache-response-codes-57">57 HTTP Status Codes</a> recognized by the Apache Web Server.  Wouldn't you like to see what all those headers and their output, ErrorDocuments look like?</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html"></a><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html"><cite>AskApache.com</cite></a></p><p><strong>I was trying to find an official, authoritative list of HTTP Status Codes</strong> but I kept finding lists that weren't authoritative or complete. So I searched and found my answer in the Apache HTTP Server source code.  Once I had the exact HTTP Status Codes and resulting Error Documents sent by Apache, I researched deeper into HTTP Status Codes by reading as many related RFC's as I could find, and several other software source codes were explored.  This is the most authoritative list I know of, if you can do better leave a comment and I'll update it.  Another thing to keep in mind, the Status code number itself is what is used by software and hardware to make determinations, the phrase returned by the status code is for the human only and does not have any weight other than informing the user.. So "503 Service Unavailable", "503 Service Temporarily Unavailable", and "503 Get the heck outta here" are all completely valid.</p>
<p class="bnote"><strong>Update March 9, 2009</strong>: A lot of sites on the web have updated their HTTP status code lists to include the HTTP Status codes listed on this page, including Wikipedia, IANA, W3C, and others, so rest assured this info is accurate and complete.  If you'd like to see how to create custom error pages for all of these errors like mine  <a href="http://www.askapache.com/show-error-506">/show-error-506</a> , then check out  <a href="http://www.askapache.com/htaccess/advanced-htaccess-ssi.html">this detailed tutorial</a>  I just posted.</p>


<h2>Contents</h2>
<ul>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#apache-response-codes-57">List of All 57 HTTP Response Status Code</a> </li>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#quick-start">Quick Start to triggering ErrorDocuments for each Status Code</a> </li>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#automating-the-process">Automate the ErrorDocument Triggering</a>
        <ul>
            <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#redirect-code-in-htaccess">The htaccess Code</a> </li>
            <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#php-header-grabber-script">PHP script that gets and outputs the Headers/Content</a> </li>
        </ul>
    </li>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#headers-returned-content">Headers and Content Returned</a> </li>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#apache-source-code">Apache Source Code</a>
        <ul>
            <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#httpdh-h">httpd.h</a> </li>
            <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#http_protocol-c">http_protocol.c</a> </li>
        </ul>
    </li>
</ul>


<h2> <a href="#apache-response-codes-57" name="apache-response-codes-57" id="apache-response-codes-57">57 APACHE HTTP STATUS RESPONSE CODES</a> </h2>
<p>Once I compiled the list of Apache recognized HTTP Status Codes, I was dying to see them all in action (<em>i.e. the corresponding <strong>ErrorDocument</strong></em>).  At first I thought I would have to create a php or perl script emulating each of the 57 HTTP Status Codes, a tedious undertaking I wasn't about to do.  Instead I "asked Apache" by searching the  <a href="http://httpd.apache.org/docs/trunk/">Apache HTTP Documentation</a>  for <em>ambiguity sending Status Codes and/or triggering ErrorDocuments</em> with an Apache Directive.<br /><strong>While reading</strong> up on  <a href="http://askapache.info/trunk/mod/mod_alias.html">mod_alias</a>  and the  <a href="http://askapache.info/trunk/mod/mod_alias.html#redirect">Redirect</a>  directive I found:</p>
<blockquote cite="http://httpd.apache.org/docs/trunk/mod/mod_alias.html#redirect"><cite>Apache Docs</cite>
    <p>Syntax: <strong>Redirect [status] URL-path URL</strong> The status argument can be used to return <strong>other</strong> HTTP status codes. <strong>Other</strong> status codes can be returned by giving the numeric status code as the value of status.  If the status is between 300 and 399, the URL argument must be present, otherwise it must be omitted.</p>
</blockquote>
<dl>
    <dt><a id="code-100" title="Continue">100 Continue</a> </dt>
    <dd><a title="ErrorDocument 100" href="/e/100/">ErrorDocument Continue</a>  |  <a href="#status-100" title="Sample Continue">Sample 100 Continue</a> <br />This means that the server has received the request headers, and that the client should proceed to send the request body (in case of a request which   needs to be sent; for example, a POST request). If the request body is large, sending it to a server when a request has already been rejected based upon inappropriate headers is inefficient.   To have a server check if the request could be accepted based on the requests headers alone, a client must send Expect: 100-continue as a header in its initial request (see RFC 2616 14.20 Expect header) and check if a 100 Continue status code is received in response before continuing (or receive 417 Expectation Failed and not continue).</dd>
    <dt><a id="code-101" title="Switching Protocols">101 Switching Protocols</a> </dt>
    <dd><a title="ErrorDocument 101" href="/e/101/">ErrorDocument Switching Protocols</a>  |  <a href="#status-101" title="Sample Switching Protocols">Sample 101 Switching Protocols</a> <br />This means the requester has asked the server to switch protocols and the server is acknowledging that it will do so.[3]</dd>
    <dt><a id="code-102" title="Processing">102 Processing</a> </dt>
    <dd><a title="ErrorDocument 102" href="/e/102/">ErrorDocument Processing</a>  |  <a href="#status-102" title="Sample Processing">Sample 102 Processing</a> <br />(WebDAV) - (RFC 2518 )</dd>
    <dt><a id="code-200" title="OK">200 OK</a> </dt>
    <dd><a title="ErrorDocument 200" href="/e/200/">ErrorDocument OK</a>  |  <a href="#status-200" title="Sample OK">Sample 200 OK</a> <br />Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an   entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action.</dd>
    <dt><a id="code-201" title="Created">201 Created</a> </dt>
    <dd><a title="ErrorDocument 201" href="/e/201/">ErrorDocument Created</a>  |  <a href="#status-201" title="Sample Created">Sample 201 Created</a> <br />The request has been fulfilled and resulted in a new resource being created.</dd>
    <dt><a id="code-202" title="Accepted">202 Accepted</a> </dt>
    <dd><a title="ErrorDocument 202" href="/e/202/">ErrorDocument Accepted</a>  |  <a href="#status-202" title="Sample Accepted">Sample 202 Accepted</a> <br />The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it   might be disallowed when processing actually takes place.</dd>
    <dt><a id="code-203" title="Non-Authoritative Information">203 Non-Authoritative Information</a> </dt>
    <dd><a title="ErrorDocument 203" href="/e/203/">ErrorDocument Non-Authoritative Information</a>  |  <a href="#status-203" title="Sample Non-Authoritative Information">Sample 203 Non-Authoritative Information</a> <br />The server successfully processed the request, but is returning information that may be from another source.</dd>
    <dt><a id="code-204" title="No Content">204 No Content</a> </dt>
    <dd><a title="ErrorDocument 204" href="/e/204/">ErrorDocument No Content</a>  |  <a href="#status-204" title="Sample No Content">Sample 204 No Content</a> <br />The server successfully processed the request, but is not returning any content.</dd>
    <dt><a id="code-205" title="Reset Content">205 Reset Content</a> </dt>
    <dd><a title="ErrorDocument 205" href="/e/205/">ErrorDocument Reset Content</a>  |  <a href="#status-205" title="Sample Reset Content">Sample 205 Reset Content</a> <br />The server successfully processed the request, but is not returning any content. Unlike a 204 response, this response requires that the requester   reset the document view.</dd>
    <dt><a id="code-206" title="Partial Content">206 Partial Content</a> </dt>
    <dd><a title="ErrorDocument 206" href="/e/206/">ErrorDocument Partial Content</a>  |  <a href="#status-206" title="Sample Partial Content">Sample 206 Partial Content</a> <br />The server is delivering only part of the resource due to a range header sent by the client. This is used by tools like wget to enable resuming   of interrupted downloads, or split a download into multiple simultaneous streams.</dd>
    <dt><a id="code-207" title="Multi-Status">207 Multi-Status</a> </dt>
    <dd><a title="ErrorDocument 207" href="/e/207/">ErrorDocument Multi-Status</a>  |  <a href="#status-207" title="Sample Multi-Status">Sample 207 Multi-Status</a> <br />(WebDAV) - The message body that follows is an XML message and can contain a number of separate response codes, depending on how many sub-requests   were made.</dd>
    <dt><a id="code-226" title="IM Used">226 IM Used</a> </dt>
    <dd><a title="ErrorDocument 226" href="/e/226/">ErrorDocument IM Used</a>  |  <a href="#status-226" title="Sample IM Used">Sample 226 IM Used</a> <br />The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations   applied to the current instance.  The actual current instance might not be available except by combining this response with other previous or future responses, as appropriate for the specific   instance-manipulation(s).</dd>
    <dt><a id="code-300" title="Multiple Choices">300 Multiple Choices</a> </dt>
    <dd><a title="ErrorDocument 300" href="/e/300/">ErrorDocument Multiple Choices</a>  |  <a href="#status-300" title="Sample Multiple Choices">Sample 300 Multiple Choices</a> <br />Indicates multiple options for the resource that the client may follow. It, for instance, could be used to present different format options for   video, list files with different extensions, or word sense disambiguation.</dd>
    <dt><a id="code-301" title="Moved Permanently">301 Moved Permanently</a> </dt>
    <dd><a title="ErrorDocument 301" href="/e/301/">ErrorDocument Moved Permanently</a>  |  <a href="#status-301" title="Sample Moved Permanently">Sample 301 Moved Permanently</a> <br />This and all future requests should be directed to the given URI.</dd>
    <dt><a id="code-302" title="Found">302 Found</a> </dt>
    <dd><a title="ErrorDocument 302" href="/e/302/">ErrorDocument Found</a>  |  <a href="#status-302" title="Sample Found">Sample 302 Found</a> <br />This is the most popular redirect code[citation needed], but also an example of industrial practice contradicting the standard. HTTP/1.0 specification   (RFC 1945 ) required the client to perform a temporary redirect (the original describing phrase was "Moved Temporarily"), but popular browsers implemented it as a 303 See Other. Therefore,   HTTP/1.1 added status codes 303 and 307 to disambiguate between the two behaviours. However, the majority of Web applications and frameworks still use the 302 status code as if it were the   303.</dd>
    <dt><a id="code-303" title="See Other">303 See Other</a> </dt>
    <dd><a title="ErrorDocument 303" href="/e/303/">ErrorDocument See Other</a>  |  <a href="#status-303" title="Sample See Other">Sample 303 See Other</a> <br />The response to the request can be found under another URI using a GET method. When received in response to a PUT, it should be assumed that the   server has received the data and the redirect should be issued with a separate GET message.</dd>
    <dt><a id="code-304" title="Not Modified">304 Not Modified</a> </dt>
    <dd><a title="ErrorDocument 304" href="/e/304/">ErrorDocument Not Modified</a>  |  <a href="#status-304" title="Sample Not Modified">Sample 304 Not Modified</a> <br />Indicates the resource has not been modified since last requested. Typically, the HTTP client provides a header like the If-Modified-Since header   to provide a time against which to compare. Utilizing this saves bandwidth and reprocessing on both the server and client, as only the header data must be sent and received in comparison to   the entirety of the page being re-processed by the server, then resent using more bandwidth of the server and client.</dd>
    <dt><a id="code-305" title="Use Proxy">305 Use Proxy</a> </dt>
    <dd><a title="ErrorDocument 305" href="/e/305/">ErrorDocument Use Proxy</a>  |  <a href="#status-305" title="Sample Use Proxy">Sample 305 Use Proxy</a> <br />Many HTTP clients (such as Mozilla[4] and Internet Explorer) do not correctly handle responses with this status code, primarily for security   reasons.</dd>
    <dt><a id="code-306" title="Switch Proxy">306 Switch Proxy</a> </dt>
    <dd><a title="ErrorDocument 306" href="/e/306/">ErrorDocument Switch Proxy</a>  |  <a href="#status-306" title="Sample Switch Proxy">Sample 306 Switch Proxy</a> <br />No longer used.</dd>
    <dt><a id="code-307" title="Temporary Redirect">307 Temporary Redirect</a> </dt>
    <dd><a title="ErrorDocument 307" href="/e/307/">ErrorDocument Temporary Redirect</a>  |  <a href="#status-307" title="Sample Temporary Redirect">Sample 307 Temporary Redirect</a> <br />In this occasion, the request should be repeated with another URI, but future requests can still use the original URI. In contrast to 303,   the request method should not be changed when reissuing the original request. For instance, a POST request must be repeated using another POST request.</dd>
    <dt><a id="code-400" title="Bad Request">400 Bad Request</a> </dt>
    <dd><a title="ErrorDocument 400" href="/e/400/">ErrorDocument Bad Request</a>  |  <a href="#status-400" title="Sample Bad Request">Sample 400 Bad Request</a> <br />The request contains bad syntax or cannot be fulfilled.</dd>
    <dt><a id="code-401" title="Unauthorized">401 Unauthorized</a> </dt>
    <dd><a title="ErrorDocument 401" href="/e/401/">ErrorDocument Unauthorized</a>  |  <a href="#status-401" title="Sample Unauthorized">Sample 401 Unauthorized</a> <br />Similar to 403 Forbidden, but specifically for use when authentication is possible but has failed or not yet been provided. The response must   include a WWW-Authenticate header field containing a challenge applicable to the requested resource. See Basic access authentication and Digest access authentication.</dd>
    <dt><a id="code-402" title="Payment Required">402 Payment Required</a> </dt>
    <dd><a title="ErrorDocument 402" href="/e/402/">ErrorDocument Payment Required</a>  |  <a href="#status-402" title="Sample Payment Required">Sample 402 Payment Required</a> <br />The original intention was that this code might be used as part of some form of digital cash or micropayment scheme, but that has not happened,   and this code has never been used.</dd>
    <dt><a id="code-403" title="Forbidden">403 Forbidden</a> </dt>
    <dd><a title="ErrorDocument 403" href="/e/403/">ErrorDocument Forbidden</a>  |  <a href="#status-403" title="Sample Forbidden">Sample 403 Forbidden</a> <br />The request was a legal request, but the server is refusing to respond to it. Unlike a 401 Unauthorized response, authenticating will make no   difference.</dd>
    <dt><a id="code-404" title="Not Found">404 Not Found</a> </dt>
    <dd><a title="ErrorDocument 404" href="/e/404/">ErrorDocument Not Found</a>  |  <a href="#status-404" title="Sample Not Found">Sample 404 Not Found</a> <br />The requested resource could not be found but may be available again in the future. Subsequent requests by the client are permissible.</dd>
    <dt><a id="code-405" title="Method Not Allowed">405 Method Not Allowed</a> </dt>
    <dd><a title="ErrorDocument 405" href="/e/405/">ErrorDocument Method Not Allowed</a>  |  <a href="#status-405" title="Sample Method Not Allowed">Sample 405 Method Not Allowed</a> <br />A request was made of a resource using a request method not supported by that resource; for example, using GET on a form which requires data   to be presented via POST, or using PUT on a read-only resource.</dd>
    <dt><a id="code-406" title="Not Acceptable">406 Not Acceptable</a> </dt>
    <dd><a title="ErrorDocument 406" href="/e/406/">ErrorDocument Not Acceptable</a>  |  <a href="#status-406" title="Sample Not Acceptable">Sample 406 Not Acceptable</a> <br />The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.</dd>
    <dt><a id="code-407" title="Proxy Authentication Required">407 Proxy Authentication Required</a> </dt>
    <dd><a title="ErrorDocument 407" href="/e/407/">ErrorDocument Proxy Authentication Required</a>  |  <a href="#status-407" title="Sample Proxy Authentication Required">Sample 407 Proxy Authentication Required</a> <br />Required</dd>
    <dt><a id="code-408" title="Request Timeout">408 Request Timeout</a> </dt>
    <dd><a title="ErrorDocument 408" href="/e/408/">ErrorDocument Request Timeout</a>  |  <a href="#status-408" title="Sample Request Timeout">Sample 408 Request Timeout</a> <br />The server timed out waiting for the request.</dd>
    <dt><a id="code-409" title="Conflict">409 Conflict</a> </dt>
    <dd><a title="ErrorDocument 409" href="/e/409/">ErrorDocument Conflict</a>  |  <a href="#status-409" title="Sample Conflict">Sample 409 Conflict</a> <br />Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.</dd>
    <dt><a id="code-410" title="Gone">410 Gone</a> </dt>
    <dd><a title="ErrorDocument 410" href="/e/410/">ErrorDocument Gone</a>  |  <a href="#status-410" title="Sample Gone">Sample 410 Gone</a> <br />Indicates that the resource requested is no longer available and will not be available again. This should be used when a resource has been intentionally   removed; however, it is not necessary to return this code and a 404 Not Found can be issued instead. Upon receiving a 410 status code, the client should not request the resource again in the   future. Clients such as search engines should remove the resource from their indexes.</dd>
    <dt><a id="code-411" title="Length Required">411 Length Required</a> </dt>
    <dd><a title="ErrorDocument 411" href="/e/411/">ErrorDocument Length Required</a>  |  <a href="#status-411" title="Sample Length Required">Sample 411 Length Required</a> <br />The request did not specify the length of its content, which is required by the requested resource.</dd>
    <dt><a id="code-412" title="Precondition Failed">412 Precondition Failed</a> </dt>
    <dd><a title="ErrorDocument 412" href="/e/412/">ErrorDocument Precondition Failed</a>  |  <a href="#status-412" title="Sample Precondition Failed">Sample 412 Precondition Failed</a> <br />The server does not meet one of the preconditions that the requester put on the request.</dd>
    <dt><a id="code-413" title="Request Entity Too Large">413 Request Entity Too Large</a> </dt>
    <dd><a title="ErrorDocument 413" href="/e/413/">ErrorDocument Request Entity Too Large</a>  |  <a href="#status-413" title="Sample Request Entity Too Large">Sample 413 Request Entity Too Large</a> <br />The request is larger than the server is willing or able to process.</dd>
    <dt><a id="code-414" title="Request-URI Too Long">414 Request-URI Too Long</a> </dt>
    <dd><a title="ErrorDocument 414" href="/e/414/">ErrorDocument Request-URI Too Long</a>  |  <a href="#status-414" title="Sample Request-URI Too Long">Sample 414 Request-URI Too Long</a> <br />The URI provided was too long for the server to process.</dd>
    <dt><a id="code-415" title="Unsupported Media Type">415 Unsupported Media Type</a> </dt>
    <dd><a title="ErrorDocument 415" href="/e/415/">ErrorDocument Unsupported Media Type</a>  |  <a href="#status-415" title="Sample Unsupported Media Type">Sample 415 Unsupported Media Type</a> <br />The request did not specify any media types that the server or resource supports. For example the client specified that an image resource   should be served as image/svg+xml, but the server cannot find a matching version of the image.</dd>
    <dt><a id="code-416" title="Requested Range Not Satisfiable">416 Requested Range Not Satisfiable</a> </dt>
    <dd><a title="ErrorDocument 416" href="/e/416/">ErrorDocument Requested Range Not Satisfiable</a>  |  <a href="#status-416" title="Sample Requested Range Not Satisfiable">Sample 416 Requested Range Not Satisfiable</a> <br />The client has asked for a portion of the file, but the server cannot supply that portion (for example, if the client asked for   a part of the file that lies beyond the end of the file).</dd>
    <dt><a id="code-417" title="Expectation Failed">417 Expectation Failed</a> </dt>
    <dd><a title="ErrorDocument 417" href="/e/417/">ErrorDocument Expectation Failed</a>  |  <a href="#status-417" title="Sample Expectation Failed">Sample 417 Expectation Failed</a> <br />The server cannot meet the requirements of the Expect request-header field.</dd>
    <dt><a id="code-418" title="I'm a teapot">418 I'm a teapot</a> </dt>
    <dd><a title="ErrorDocument 418" href="/e/418/">ErrorDocument I'm a teapot</a>  |  <a href="#status-418" title="Sample I'm a teapot">Sample 418 I'm a teapot</a> <br />The HTCPCP server is a teapot. The responding entity MAY be short and stout. Defined by the April Fools specification RFC 2324. See Hyper Text   Coffee Pot Control Protocol for more information.</dd>
    <dt><a id="code-422" title="Unprocessable Entity">422 Unprocessable Entity</a> </dt>
    <dd><a title="ErrorDocument 422" href="/e/422/">ErrorDocument Unprocessable Entity</a>  |  <a href="#status-422" title="Sample Unprocessable Entity">Sample 422 Unprocessable Entity</a> <br />(WebDAV) (RFC 4918 ) - The request was well-formed but was unable to be followed due to semantic errors.</dd>
    <dt><a id="code-423" title="Locked">423 Locked</a> </dt>
    <dd><a title="ErrorDocument 423" href="/e/423/">ErrorDocument Locked</a>  |  <a href="#status-423" title="Sample Locked">Sample 423 Locked</a> <br />(WebDAV) (RFC 4918 ) - The resource that is being accessed is locked</dd>
    <dt><a id="code-424" title="Failed Dependency">424 Failed Dependency</a> </dt>
    <dd><a title="ErrorDocument 424" href="/e/424/">ErrorDocument Failed Dependency</a>  |  <a href="#status-424" title="Sample Failed Dependency">Sample 424 Failed Dependency</a> <br />(WebDAV) (RFC 4918 ) - The request failed due to failure of a previous request (e.g. a PROPPATCH).</dd>
    <dt><a id="code-425" title="Unordered Collection">425 Unordered Collection</a> </dt>
    <dd><a title="ErrorDocument 425" href="/e/425/">ErrorDocument Unordered Collection</a>  |  <a href="#status-425" title="Sample Unordered Collection">Sample 425 Unordered Collection</a> <br />Defined in drafts of WebDav Advanced Collections, but not present in "Web Distributed Authoring and Versioning (WebDAV) Ordered Collections   Protocol" (RFC 3648).</dd>
    <dt><a id="code-426" title="Upgrade Required">426 Upgrade Required</a> </dt>
    <dd><a title="ErrorDocument 426" href="/e/426/">ErrorDocument Upgrade Required</a>  |  <a href="#status-426" title="Sample Upgrade Required">Sample 426 Upgrade Required</a> <br />(RFC 2817 ) - The client should switch to TLS/1.0.</dd>
    <dt><a id="code-449" title="Retry With">449 Retry With</a> </dt>
    <dd><a title="ErrorDocument 449" href="/e/449/">ErrorDocument Retry With</a>  |  <a href="#status-449" title="Sample Retry With">Sample 449 Retry With</a> <br />A Microsoft extension. The request should be retried after doing the appropriate action.</dd>
    <dt><a id="code-500" title="Internal Server Error">500 Internal Server Error</a> </dt>
    <dd><a title="ErrorDocument 500" href="/e/500/">ErrorDocument Internal Server Error</a>  |  <a href="#status-500" title="Sample Internal Server Error">Sample 500 Internal Server Error</a> <br />A generic error message, given when no more specific message is suitable.</dd>
    <dt><a id="code-501" title="Not Implemented">501 Not Implemented</a> </dt>
    <dd><a title="ErrorDocument 501" href="/e/501/">ErrorDocument Not Implemented</a>  |  <a href="#status-501" title="Sample Not Implemented">Sample 501 Not Implemented</a> <br />The server either does not recognise the request method, or it lacks the ability to fulfil the request.</dd>
    <dt><a id="code-502" title="Bad Gateway">502 Bad Gateway</a> </dt>
    <dd><a title="ErrorDocument 502" href="/e/502/">ErrorDocument Bad Gateway</a>  |  <a href="#status-502" title="Sample Bad Gateway">Sample 502 Bad Gateway</a> <br />The server was acting as a gateway or proxy and received an invalid response from the upstream server.</dd>
    <dt><a id="code-503" title="Service Unavailable">503 Service Unavailable</a> </dt>
    <dd><a title="ErrorDocument 503" href="/e/503/">ErrorDocument Service Unavailable</a>  |  <a href="#status-503" title="Sample Service Unavailable">Sample 503 Service Unavailable</a> <br />The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.</dd>
    <dt><a id="code-504" title="Gateway Timeout">504 Gateway Timeout</a> </dt>
    <dd><a title="ErrorDocument 504" href="/e/504/">ErrorDocument Gateway Timeout</a>  |  <a href="#status-504" title="Sample Gateway Timeout">Sample 504 Gateway Timeout</a> <br />The server was acting as a gateway or proxy and did not receive a timely request from the upstream server.</dd>
    <dt><a id="code-505" title="HTTP Version Not Supported">505 HTTP Version Not Supported</a> </dt>
    <dd><a title="ErrorDocument 505" href="/e/505/">ErrorDocument HTTP Version Not Supported</a>  |  <a href="#status-505" title="Sample HTTP Version Not Supported">Sample 505 HTTP Version Not Supported</a> <br />The server does not support the HTTP protocol version used in the request.</dd>
    <dt><a id="code-506" title="Variant Also Negotiates">506 Variant Also Negotiates</a> </dt>
    <dd><a title="ErrorDocument 506" href="/e/506/">ErrorDocument Variant Also Negotiates</a>  |  <a href="#status-506" title="Sample Variant Also Negotiates">Sample 506 Variant Also Negotiates</a> <br />(RFC 2295 ) - Transparent content negotiation for the request, results in a circular reference.</dd>
    <dt><a id="code-507" title="Insufficient Storage">507 Insufficient Storage</a> </dt>
    <dd><a title="ErrorDocument 507" href="/e/507/">ErrorDocument Insufficient Storage</a>  |  <a href="#status-507" title="Sample Insufficient Storage">Sample 507 Insufficient Storage</a> <br />(WebDAV) (RFC 4918 )</dd>
    <dt><a id="code-509" title="Bandwidth Limit Exceeded">509 Bandwidth Limit Exceeded</a> </dt>
    <dd><a title="ErrorDocument 509" href="/e/509/">ErrorDocument Bandwidth Limit Exceeded</a>  |  <a href="#status-509" title="Sample Bandwidth Limit Exceeded">Sample 509 Bandwidth Limit Exceeded</a> <br />(Apache bw/limited extension) - This status code, while used by many servers, is not specified in any RFCs.</dd>
    <dt><a id="code-510" title="Not Extended">510 Not Extended</a> </dt>
    <dd><a title="ErrorDocument 510" href="/e/510/">ErrorDocument Not Extended</a>  |  <a href="#status-510" title="Sample Not Extended">Sample 510 Not Extended</a> <br />(RFC 2774 ) - Further extensions to the request are required for the server to fulfil it.</dd>
</dl>


<h3>1xx Info / Informational</h3>
<p><code>HTTP_INFO</code> - <strong>Request received, continuing process</strong>. Indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line.</p>
<ul>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-100" title="Continue">100</a>  <a title="ErrorDocument 100" href="/e/100/">Continue</a>  - <code>HTTP_CONTINUE</code></li>
    <li> <a href="#status-101" title="Switching Protocols">101</a>  <a title="ErrorDocument 101" href="/e/101/">Switching Protocols</a>  - <code>HTTP_SWITCHING_PROTOCOLS</code></li>
    <li> <a href="#status-102" title="Processing">102</a>  <a title="ErrorDocument 102" href="/e/102/">Processing</a>  - <code>HTTP_PROCESSING</code></li>
</ul>


<h3>2xx Success / OK</h3>
<p><code>HTTP_SUCCESS</code> - <strong>The action was successfully received, understood, and accepted</strong>.  Indicates that the client's request was successfully received, understood, and accepted.</p>
<ul>
    <li> <a href="#status-200" title="OK">200</a>  <a title="ErrorDocument 200" href="/e/200/">OK</a>  - <code>HTTP_OK</code></li>
    <li> <a href="#status-201" title="Created">201</a>  <a title="ErrorDocument 201" href="/e/201/">Created</a>  - <code>HTTP_CREATED</code></li>
    <li> <a href="#status-202" title="Accepted">202</a>  <a title="ErrorDocument 202" href="/e/202/">Accepted</a>  - <code>HTTP_ACCEPTED</code></li>
    <li> <a href="#status-203" title="Non-Authoritative Information">203</a>  <a title="ErrorDocument 203" href="/e/203/">Non-Authoritative Information</a>  - <code>HTTP_NON_AUTHORITATIVE</code></li>
    <li> <a href="#status-204" title="No Content">204</a>  <a title="ErrorDocument 204" href="/e/204/">No Content</a>  - <code>HTTP_NO_CONTENT</code></li>
    <li> <a href="#status-205" title="Reset Content">205</a>  <a title="ErrorDocument 205" href="/e/205/">Reset Content</a>  - <code>HTTP_RESET_CONTENT</code></li>
    <li> <a href="#status-206" title="Partial Content">206</a>  <a title="ErrorDocument 206" href="/e/206/">Partial Content</a>  - <code>HTTP_PARTIAL_CONTENT</code></li>
    <li> <a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-207" title="Multi-Status">207</a>  <a title="ErrorDocument 207" href="/e/207/">Multi-Status</a>  - <code>HTTP_MULTI_STATUS</code></li>
</ul>


<h3>3xx Redirect</h3>
<p><code>HTTP_REDIRECT</code> - <strong>The client must take additional action to complete the request</strong>.  Indicates that further action needs to be taken by the user-agent in order to fulfill the request. The action required may be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. A user agent should not automatically <em>redirect a request more than 5 times</em>, since such redirections usually indicate an <strong>infinite loop</strong>.</p>
<ul>
    <li> <a href="#status-300" title="Multiple Choices">300</a>  <a title="ErrorDocument 300" href="/e/300/">Multiple Choices</a>  - <code>HTTP_MULTIPLE_CHOICES</code></li>
    <li> <a href="#status-301" title="Moved Permanently">301</a>  <a title="ErrorDocument 301" href="/e/301/">Moved Permanently</a>  - <code>HTTP_MOVED_PERMANENTLY</code></li>
    <li> <a href="#status-302" title="Found">302</a>  <a title="ErrorDocument 302" href="/e/302/">Found</a>  - <code>HTTP_MOVED_TEMPORARILY</code></li>
    <li> <a href="#status-303" title="See Other">303</a>  <a title="ErrorDocument 303" href="/e/303/">See Other</a>  - <code>HTTP_SEE_OTHER</code></li>
    <li> <a href="#status-304" title="Not Modified">304</a>  <a title="ErrorDocument 304" href="/e/304/">Not Modified</a>  - <code>HTTP_NOT_MODIFIED</code></li>
    <li> <a href="#status-305" title="Use Proxy">305</a>  <a title="ErrorDocument 305" href="/e/305/">Use Proxy</a>  - <code>HTTP_USE_PROXY</code></li>
    <li> <a href="#status-306" title="unused">306</a>  <a title="ErrorDocument 306" href="/e/306/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-307" title="Temporary Redirect">307</a>  <a title="ErrorDocument 307" href="/e/307/">Temporary Redirect</a>  - <code>HTTP_TEMPORARY_REDIRECT</code></li>
</ul>


<h3>4xx Client Error</h3>
<p><code>HTTP_CLIENT_ERROR</code> - <strong>The request contains bad syntax or cannot be fulfilled</strong>.  Indicates case where client seems to have erred. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition.</p>
<ul>
    <li> <a href="#status-400" title="Bad Request">400</a>  <a title="ErrorDocument 400" href="/e/400/">Bad Request</a>  - <code>HTTP_BAD_REQUEST</code></li>
    <li> <a href="#status-401" title="Authorization Required">401</a>  <a title="ErrorDocument 401" href="/e/401/">Authorization Required</a>  - <code>HTTP_UNAUTHORIZED</code></li>
    <li> <a href="#status-402" title="Payment Required">402</a>  <a title="ErrorDocument 402" href="/e/402/">Payment Required</a>  - <code>HTTP_PAYMENT_REQUIRED</code></li>
    <li> <a href="#status-403" title="Forbidden">403</a>  <a title="ErrorDocument 403" href="/e/403/">Forbidden</a>  - <code>HTTP_FORBIDDEN</code></li>
    <li> <a href="#status-404" title="Not Found">404</a>  <a title="ErrorDocument 404" href="/e/404/">Not Found</a>  - <code>HTTP_NOT_FOUND</code></li>
    <li> <a href="#status-405" title="Method Not Allowed">405</a>  <a title="ErrorDocument 405" href="/e/405/">Method Not Allowed</a>  - <code>HTTP_METHOD_NOT_ALLOWED</code></li>
    <li> <a href="#status-406" title="Not Acceptable">406</a>  <a title="ErrorDocument 406" href="/e/406/">Not Acceptable</a>  - <code>HTTP_NOT_ACCEPTABLE</code></li>
    <li> <a href="#status-407" title="Proxy Authentication Required">407</a>  <a title="ErrorDocument 407" href="/e/407/">Proxy Authentication Required</a>  - <code>HTTP_PROXY_AUTHENTICATION_REQUIRED</code></li>
    <li> <a href="#status-408" title="Request Time-out">408</a>  <a title="ErrorDocument 408" href="/e/408/">Request Time-out</a>  - <code>HTTP_REQUEST_TIME_OUT</code></li>
    <li> <a href="#status-409" title="Conflict">409</a>  <a title="ErrorDocument 409" href="/e/409/">Conflict</a>  - <code>HTTP_CONFLICT</code></li>
    <li> <a href="#status-410" title="Gone">410</a>  <a title="ErrorDocument 410" href="/e/410/">Gone</a>  - <code>HTTP_GONE</code></li>
    <li> <a href="#status-411" title="Length Required">411</a>  <a title="ErrorDocument 411" href="/e/411/">Length Required</a>  - <code>HTTP_LENGTH_REQUIRED</code></li>
    <li> <a href="#status-412" title="Precondition Failed">412</a>  <a title="ErrorDocument 412" href="/e/412/">Precondition Failed</a>  - <code>HTTP_PRECONDITION_FAILED</code></li>
    <li> <a href="#status-413" title="Request Entity Too Large">413</a>  <a title="ErrorDocument 413" href="/e/413/">Request Entity Too Large</a>  - <code>HTTP_REQUEST_ENTITY_TOO_LARGE</code></li>
    <li> <a href="#status-414" title="Request-URI Too Large">414</a>  <a title="ErrorDocument 414" href="/e/414/">Request-URI Too Large</a>  - <code>HTTP_REQUEST_URI_TOO_LARGE</code></li>
    <li> <a href="#status-415" title="Unsupported Media Type">415</a>  <a title="ErrorDocument 415" href="/e/415/">Unsupported Media Type</a>  - <code>HTTP_UNSUPPORTED_MEDIA_TYPE</code></li>
    <li> <a href="#status-416" title="Requested Range Not Satisfiable">416</a>  <a title="ErrorDocument 416" href="/e/416/">Requested Range Not Satisfiable</a>  - <code>HTTP_RANGE_NOT_SATISFIABLE</code></li>
    <li> <a href="#status-417" title="Expectation Failed">417</a>  <a title="ErrorDocument 417" href="/e/417/">Expectation Failed</a>  - <code>HTTP_EXPECTATION_FAILED</code></li>
    <li> <a href="#status-418" title="Im a teapot">418</a>  <a title="ErrorDocument 418" href="/e/418/">I'm a teapot</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-419" title="unused">419</a>  <a title="ErrorDocument 419" href="/e/419/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-420" title="unused">420</a>  <a title="ErrorDocument 420" href="/e/420/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-421" title="unused">421</a>  <a title="ErrorDocument 421" href="/e/421/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-422" title="Unprocessable Entity">422</a>  <a title="ErrorDocument 422" href="/e/422/">Unprocessable Entity</a>  - <code>HTTP_UNPROCESSABLE_ENTITY</code></li>
    <li> <a href="#status-423" title="Locked">423</a>  <a title="ErrorDocument 423" href="/e/423/">Locked</a>  - <code>HTTP_LOCKED</code></li>
    <li> <a href="#status-424" title="Failed Dependency">424</a>  <a title="ErrorDocument 424" href="/e/424/">Failed Dependency</a>  - <code>HTTP_FAILED_DEPENDENCY</code></li>
    <li> <a href="#status-425" title="No code">425</a>  <a title="ErrorDocument 425" href="/e/425/">No code</a>  - <code>HTTP_NO_CODE</code></li>
    <li> <a href="#status-426" title="Upgrade Required">426</a>  <a title="ErrorDocument 426" href="/e/426/">Upgrade Required</a>  - <code>HTTP_UPGRADE_REQUIRED</code></li>
</ul>


<h3>5xx Server Error</h3>
<p><code>HTTP_SERVER_ERROR</code> - <strong>The server failed to fulfill an apparently valid request</strong>.  Indicate cases in which the server is aware that it has erred or is incapable of performing the request. Except when responding to a HEAD request, the server should include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. User agents should display any included entity to the user. These response codes are applicable to any request method.</p>
<ul>
    <li> <a href="#status-500" title="Internal Server Error">500</a>  <a title="ErrorDocument 500" href="/e/500/">Internal Server Error</a>  - <code>HTTP_INTERNAL_SERVER_ERROR</code></li>
    <li> <a href="#status-501" title="Method Not Implemented">501</a>  <a title="ErrorDocument 501" href="/e/501/">Method Not Implemented</a>  - <code>HTTP_NOT_IMPLEMENTED</code></li>
    <li> <a href="#status-502" title="Bad Gateway">502</a>  <a title="ErrorDocument 502" href="/e/502/">Bad Gateway</a>  - <code>HTTP_BAD_GATEWAY</code></li>
    <li> <a href="#status-503" title="Service Temporarily Unavailable">503</a>  <a title="ErrorDocument 503" href="/e/503/">Service Temporarily Unavailable</a>  - <code>HTTP_SERVICE_UNAVAILABLE</code></li>
    <li> <a href="#status-504" title="Gateway Time-out">504</a>  <a title="ErrorDocument 504" href="/e/504/">Gateway Time-out</a>  - <code>HTTP_GATEWAY_TIME_OUT</code></li>
    <li> <a href="#status-505" title="HTTP Version Not Supported">505</a>  <a title="ErrorDocument 505" href="/e/505/">HTTP Version Not Supported</a>  - <code>HTTP_VERSION_NOT_SUPPORTED</code></li>
    <li> <a href="#status-506" title="Variant Also Negotiates">506</a>  <a title="ErrorDocument 506" href="/e/506/">Variant Also Negotiates</a>  - <code>HTTP_VARIANT_ALSO_VARIES</code></li>
    <li> <a href="#status-507" title="Insufficient Storage">507</a>  <a title="ErrorDocument 507" href="/e/507/">Insufficient Storage</a>  - <code>HTTP_INSUFFICIENT_STORAGE</code></li>
    <li> <a href="#status-508" title="unused">508</a>  <a title="ErrorDocument 508" href="/e/508/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-509" title="unused">509</a>  <a title="ErrorDocument 509" href="/e/509/">unused</a>  - <code>UNUSED</code></li>
    <li> <a href="#status-510" title="Not Extended">510</a>  <a title="ErrorDocument 510" href="/e/510/">Not Extended</a>  - <code>HTTP_NOT_EXTENDED</code></li>
</ul>


<hr />


<h2> <a href="#quick-start" name="quick-start" id="quick-start">Quick Start to triggering ErrorDocuments for each Status Code</a> </h2>
<p>Let start with a quick and easy example.  Add the following Redirect rules to your htaccess file, then open your browser and goto each url like <code>yoursite.com/e/400</code>. <em>Don't create an /e/ directory or any files.</em></p>
<pre>Redirect 400 /e/400
Redirect 503 /e/503
Redirect 405 /e/405</pre>
<p> <a href="http://uploads.askapache.com/2007/03/error-400s.png" title="Apache ErrorDocument Results" rel="lb"><img src="http://uploads.askapache.com/2007/03/error-400s.thumbnail.png" alt="Apache ErrorDocument Results" title="error 400s.thumbnail htaccess" /></a> <br /> <a href="http://uploads.askapache.com/2007/03/error-503.png" title="error 503" rel="lb"><img src="http://uploads.askapache.com/2007/03/error-503.thumbnail.png" alt="error 503" title="error 503.thumbnail htaccess" /></a> </p>


<h2> <a href="#automating-the-process" name="automating-the-process" id="automating-the-process">Automate the ErrorDocument Triggering</a> </h2>


<h3> <a href="#redirect-code-in-htaccess" name="redirect-code-in-htaccess" id="redirect-code-in-htaccess">The htaccess Redirects</a> </h3>
<p>When a Status code is encountered, Apache outputs the Header and the ErrorDocument for that error code.  So you can view any Header and the default ErrorDocument, by causing that numerical error code, which is caused by the Status Code.</p>
<p>For instance, if you request a file that doesn't exist, a <strong>404 Not Found</strong> Header is issued and the corresponding ErrorDocument is served with the <strong>404 Not Found</strong> Header.</p>
<pre>Redirect 100 /e/100
Redirect 101 /e/101
Redirect 102 /e/102
Redirect 200 /e/200
Redirect 201 /e/201
Redirect 202 /e/202
Redirect 203 /e/203
Redirect 204 /e/204
Redirect 205 /e/205
Redirect 206 /e/206
Redirect 207 /e/207
Redirect 300 /e/300 http://www.askapache.com/?s=300
Redirect 301 /e/301 http://www.askapache.com/?s=301
Redirect 302 /e/302 http://www.askapache.com/?s=302
Redirect 303 /e/303 http://www.askapache.com/?s=303
Redirect 304 /e/304 http://www.askapache.com/?s=304
Redirect 305 /e/305 http://www.askapache.com/?s=305
Redirect 306 /e/306 http://www.askapache.com/?s=306
Redirect 307 /e/307 http://www.askapache.com/?s=307
Redirect 400 /e/400
Redirect 401 /e/401
Redirect 402 /e/402
Redirect 403 /e/403
Redirect 404 /e/404
Redirect 405 /e/405
Redirect 406 /e/406
Redirect 407 /e/407
Redirect 408 /e/408
Redirect 409 /e/409
Redirect 410 /e/410
Redirect 411 /e/411
Redirect 412 /e/412
Redirect 413 /e/413
Redirect 414 /e/414
Redirect 415 /e/415
Redirect 416 /e/416
Redirect 417 /e/417
Redirect 418 /e/418
Redirect 419 /e/419
Redirect 420 /e/420
Redirect 421 /e/421
Redirect 422 /e/422
Redirect 423 /e/423
Redirect 424 /e/424
Redirect 425 /e/425
Redirect 426 /e/426
Redirect 500 /e/500
Redirect 501 /e/501
Redirect 502 /e/502
Redirect 503 /e/503
Redirect 504 /e/504
Redirect 505 /e/505
Redirect 506 /e/506
Redirect 507 /e/507
Redirect 508 /e/508
Redirect 509 /e/509
Redirect 510 /e/510</pre>


<h3> <a href="#php-header-grabber-script" name="php-header-grabber-script" id="php-header-grabber-script">PHP script that gets and outputs the Headers/Content</a> </h3>
<p>Now all I have to do is add 57 Redirect Directives to my htaccess, and then request each of them 1 at a time from my browser to see the result, and use a packet sniffing program like  <a href="http://wireshark.askapache.com">WireShark</a>  to see the Headers.  Uh, scratch that, that would take way too long!</p>
<p>Instead I hacked up a simple php script using  <a href="http://www.askapache.com/phpbb/sending-post-form-data-with-php-curl.html">cURL</a>  to automate sending GET Requests to each of the 57 Redirect URL-paths. A side benefit of using the php script is that it performs all 57 Requests concurrently and saves each Requests returned headers and content to an output buffer.  After all 57 have been queried, the output buffer is flushed to the browser.</p>
<pre>&lt;?php
$SITENAME=&#039;http://www.askapache.com&#039;;
&nbsp;
$CODES = array(array(&#039;100&#039;,&#039;101&#039;,&#039;102&#039;),
array(&#039;200&#039;,&#039;201&#039;,&#039;202&#039;,&#039;203&#039;,&#039;204&#039;,&#039;205&#039;,&#039;206&#039;,&#039;207&#039;),
array(&#039;300&#039;,&#039;301&#039;,&#039;302&#039;,&#039;303&#039;,&#039;304&#039;,&#039;305&#039;,&#039;306&#039;,&#039;307&#039;),
array(&#039;400&#039;,&#039;401&#039;,&#039;402&#039;,&#039;403&#039;,&#039;404&#039;,&#039;405&#039;,&#039;406&#039;,&#039;407&#039;,&#039;408&#039;,&#039;409&#039;,&#039;410&#039;,&#039;411&#039;,&#039;412&#039;,&#039;413&#039;,
&#039;414&#039;,&#039;415&#039;,&#039;416&#039;,&#039;417&#039;,&#039;418&#039;,&#039;419&#039;,&#039;420&#039;,&#039;421&#039;,&#039;422&#039;,&#039;423&#039;,&#039;424&#039;,&#039;425&#039;,&#039;426&#039;),
array(&#039;500&#039;,&#039;501&#039;,&#039;502&#039;,&#039;503&#039;,&#039;504&#039;,&#039;505&#039;,&#039;506&#039;,&#039;507&#039;,&#039;508&#039;,&#039;509&#039;,&#039;510&#039;));
&nbsp;
$TMPSAVETO=&#039;/tmp/&#039;.time().&#039;.txt&#039;;
&nbsp;
# if file exists then delete it
if(is_file($TMPSAVETO))unlink($TMPSAVETO);
&nbsp;
foreach($CODES as $keyd =&gt; $res)
{
foreach($res as $key)
{
$ch = curl_init("$SITENAME/e/$key");
$fp = fopen ($TMPSAVETO, "a");
curl_setopt ($ch, CURLOPT_FILE, $fp);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION ,1);
curl_setopt ($ch, CURLOPT_HEADER ,1);
curl_exec ($ch);
curl_close ($ch);
fclose ($fp);
}
}
$OUT=&#039;&#039;;
ob_start();
header ("Content-Type: text/plain;");
readfile($TMPSAVETO);
$OUT=ob_get_clean();
echo $OUT;
unlink($TMPSAVETO);
exit;
?&gt;</pre>


<h2> <a href="#headers-returned-content" id="headers-returned-content">Headers and Content Returned</a> </h2>


<h3> <a href="#status-100" name="status-100" id="status-100">100 Continue</a> </h3>
<pre>HTTP/1.1 100 Continue
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;100 Continue&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Continue&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-101" name="status-101" id="status-101">101 Switching Protocols</a> </h3>
<pre>HTTP/1.1 101 Switching Protocols&lt;html&gt;
&lt;head&gt;
&lt;title&gt;101 Switching Protocols&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Switching Protocols&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-102" name="status-102" id="status-102">102 Processing</a> </h3>
<pre>HTTP/1.1 102 Processing
X-Pad: avoid browser bug&lt;html&gt;
&lt;head&gt;
&lt;title&gt;102 Processing&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Processing&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-200" name="status-200" id="status-200">200 OK</a> </h3>
<pre>HTTP/1.1 200 OK
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;200 OK&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;OK&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-201" name="status-201" id="status-201">201 Created</a> </h3>
<pre>HTTP/1.1 201 Created
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;201 Created&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Created&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-202" name="status-202" id="status-202">202 Accepted</a> </h3>
<pre>HTTP/1.1 202 Accepted
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;202 Accepted&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Accepted&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-203" name="status-203" id="status-203">203 Non-Authoritative Information</a> </h3>
<pre>HTTP/1.1 203 Non-Authoritative Information
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;203 Non-Authoritative Information&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Non-Authoritative Information&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-204" name="status-204" id="status-204">204 No Content</a> </h3>
<pre>HTTP/1.1 204 No Content
Content-Type: text/plain; charset=UTF-8
</pre>


<h3> <a href="#status-205" name="status-205" id="status-205">205 Reset Content</a> </h3>
<pre>HTTP/1.1 205 Reset Content&lt;html&gt;
&lt;head&gt;
&lt;title&gt;205 Reset Content&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Reset Content&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-206" name="status-206" id="status-206">206 Partial Content</a> </h3>
<pre>HTTP/1.1 206 Partial Content&lt;html&gt;
&lt;head&gt;
&lt;title&gt;206 Partial Content&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Partial Content&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-207" name="status-207" id="status-207">207 Multi-Status</a> </h3>
<pre>HTTP/1.1 207 Multi-Status
X-Pad: avoid browser bug&lt;html&gt;
&lt;head&gt;
&lt;title&gt;207 Multi-Status&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Multi-Status&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-300" name="status-300" id="status-300">300 Multiple Choices</a> </h3>
<pre>HTTP/1.1 300 Multiple Choices
Location: http://www.askapache.com/?s=300&lt;html&gt;
&lt;head&gt;
&lt;title&gt;300 Multiple Choices&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Multiple Choices&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-301" name="status-301" id="status-301">301 Moved Permanently</a> </h3>
<pre>HTTP/1.1 301 Moved Permanently
Location: http://www.askapache.com/?s=301&lt;html&gt;
&lt;head&gt;
&lt;title&gt;301 Moved Permanently&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Moved Permanently&lt;/h1&gt;
&lt;p&gt;The document has moved  &lt;a href="http://www.askapache.com/?s=301"&gt;here&lt;/a&gt; .&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-302" name="status-302" id="status-302">302 Found</a> </h3>
<pre>HTTP/1.1 302 Found
Location: http://www.askapache.com/?s=302&lt;html&gt;
&lt;head&gt;
&lt;title&gt;302 Found&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Found&lt;/h1&gt;
&lt;p&gt;The document has moved  &lt;a href="http://www.askapache.com/?s=302"&gt;here&lt;/a&gt; .&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-303" name="status-303" id="status-303">303 See Other</a> </h3>
<pre>HTTP/1.1 303 See Other
Location: http://www.askapache.com/?s=303&lt;html&gt;
&lt;head&gt;
&lt;title&gt;303 See Other&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;See Other&lt;/h1&gt;
&lt;p&gt;The answer to your request is located  &lt;a href="http://www.askapache.com/?s=303"&gt;here&lt;/a&gt; .&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-304" name="status-304" id="status-304">304 Not Modified</a> </h3>
<pre>HTTP/1.1 304 Not Modified</pre>


<h3> <a href="#status-305" name="status-305" id="status-305">305 Use Proxy</a> </h3>
<pre>HTTP/1.1 305 Use Proxy
Location: http://www.askapache.com/?s=305&lt;html&gt;
&lt;head&gt;
&lt;title&gt;305 Use Proxy&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Use Proxy&lt;/h1&gt;
&lt;p&gt;This resource is only accessible through the proxy
    http://www.askapache.com/?s=305&lt;br /&gt;You will need to configure your client to use that proxy.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-306" name="status-306" id="status-306">306 unused</a> </h3>
<pre>HTTP/1.1 306 unused
Location: http://www.askapache.com/?s=306&lt;html&gt;
&lt;head&gt;
&lt;title&gt;306 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-307" name="status-307" id="status-307">307 Temporary Redirect</a> </h3>
<pre>HTTP/1.1 307 Temporary Redirect
Location: http://www.askapache.com/?s=307&lt;html&gt;
&lt;head&gt;
&lt;title&gt;307 Temporary Redirect&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Temporary Redirect&lt;/h1&gt;
&lt;p&gt;The document has moved  &lt;a href="http://www.askapache.com/?s=307"&gt;here&lt;/a&gt; .&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-400" name="status-400" id="status-400">400 Bad Request</a> </h3>
<pre>HTTP/1.1 400 Bad Request
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;400 Bad Request&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Bad Request&lt;/h1&gt;
&lt;p&gt;Your browser sent a request that this server could not understand.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-401" name="status-401" id="status-401">401 Authorization Required</a> </h3>
<pre>HTTP/1.1 401 Authorization Required&lt;html&gt;
&lt;head&gt;
&lt;title&gt;401 Authorization Required&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Authorization Required&lt;/h1&gt;
&lt;p&gt;This server could not verify that you
    are authorized to access the document
    requested.  Either you supplied the wrong
    credentials (e.g., bad password), or your
    browser doesn&#039;t understand how to supply
    the credentials required.&lt;/p&gt;
&lt;p&gt;Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-402" name="status-402" id="status-402">402 Payment Required</a> </h3>
<pre>HTTP/1.1 402 Payment Required&lt;html&gt;
&lt;head&gt;
&lt;title&gt;402 Payment Required&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Payment Required&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-403" name="status-403" id="status-403">403 Forbidden</a> </h3>
<pre>HTTP/1.1 403 Forbidden&lt;html&gt;
&lt;head&gt;
&lt;title&gt;403 Forbidden&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Forbidden&lt;/h1&gt;
&lt;p&gt;You don&#039;t have permission to access /e/403
    on this server.&lt;/p&gt;
&lt;p&gt;Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-404" name="status-404" id="status-404">404 Not Found</a> </h3>
<pre>HTTP/1.1 404 Not Found&lt;html&gt;
&lt;head&gt;
&lt;title&gt;404 Not Found&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Not Found&lt;/h1&gt;
&lt;p&gt;The requested URL /e/404 was not found on this server.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p class="anote"><span>NOTE:</span><br />You will most definately want to check out and use the <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html" title="404 Error Page WordPress Plugin">Google 404 Error Page</a> if you run WordPress.</p>


<h3> <a href="#status-405" name="status-405" id="status-405">405 Method Not Allowed</a> </h3>
<pre>HTTP/1.1 405 Method Not Allowed
Allow: TRACE
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;405 Method Not Allowed&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Method Not Allowed&lt;/h1&gt;
&lt;p&gt;The requested method GET is not allowed for the URL /e/405.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-406" name="status-406" id="status-406">406 Not Acceptable</a> </h3>
<pre>HTTP/1.1 406 Not Acceptable
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;406 Not Acceptable&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Not Acceptable&lt;/h1&gt;
&lt;p&gt;An appropriate representation of the requested resource /e/406 could not be found on this server.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-407" name="status-407" id="status-407">407 Proxy Authentication Required</a> </h3>
<pre>HTTP/1.1 407 Proxy Authentication Required&lt;html&gt;
&lt;head&gt;
&lt;title&gt;407 Proxy Authentication Required&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Proxy Authentication Required&lt;/h1&gt;
&lt;p&gt;This server could not verify that you
    are authorized to access the document
    requested.  Either you supplied the wrong
    credentials (e.g., bad password), or your
    browser doesn&#039;t understand how to supply
    the credentials required.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-408" name="status-408" id="status-408">408 Request Time-out</a> </h3>
<pre>HTTP/1.1 408 Request Time-out
Connection: close
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;408 Request Time-out&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Request Time-out&lt;/h1&gt;
&lt;p&gt;Server timeout waiting for the HTTP request from the client.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-409" name="status-409" id="status-409">409 Conflict</a> </h3>
<pre>HTTP/1.1 409 Conflict
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;409 Conflict&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Conflict&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-410" name="status-410" id="status-410">410 Gone</a> </h3>
<pre>HTTP/1.1 410 Gone
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;410 Gone&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Gone&lt;/h1&gt;
&lt;p&gt;The requested resource&lt;br /&gt;/e/410&lt;br /&gt;is no longer available on this server and there is no forwarding address.
    Please remove all references to this resource.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-411" name="status-411" id="status-411">411 Length Required</a> </h3>
<pre>HTTP/1.1 411 Length Required
Connection: close
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;411 Length Required&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Length Required&lt;/h1&gt;
&lt;p&gt;A request of the requested method GET requires a valid Content-length.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-412" name="status-412" id="status-412">412 Precondition Failed</a> </h3>
<pre>HTTP/1.1 412 Precondition Failed
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;412 Precondition Failed&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Precondition Failed&lt;/h1&gt;
&lt;p&gt;The precondition on the request for the URL /e/412 evaluated to false.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-413" name="status-413" id="status-413">413 Request Entity Too Large</a> </h3>
<pre>HTTP/1.1 413 Request Entity Too Large
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;413 Request Entity Too Large&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Request Entity Too Large&lt;/h1&gt;
The requested resource&lt;br /&gt;/e/413&lt;br /&gt;does not allow request data with GET requests, or the amount of data provided in
the request exceeds the capacity limit.
&lt;/body&gt;
&lt;/html&gt;</pre>

<h3> <a href="#status-414" name="status-414" id="status-414">414 Request-URI Too Large</a> </h3>
<pre>HTTP/1.1 414 Request-URI Too Large
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;414 Request-URI Too Large&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Request-URI Too Large&lt;/h1&gt;
&lt;p&gt;The requested URL&#039;s length exceeds the capacity
    limit for this server.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-415" name="status-415" id="status-415">415 Unsupported Media Type</a> </h3>
<pre>HTTP/1.1 415 Unsupported Media Type&lt;html&gt;
&lt;head&gt;
&lt;title&gt;415 Unsupported Media Type&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Unsupported Media Type&lt;/h1&gt;
&lt;p&gt;The supplied request data is not in a format
    acceptable for processing by this resource.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-416" name="status-416" id="status-416">416 Requested Range Not Satisfiable</a> </h3>
<pre>HTTP/1.1 416 Requested Range Not Satisfiable</pre>


<h3> <a href="#status-417" name="status-417" id="status-417">417 Expectation Failed</a> </h3>
<pre>HTTP/1.1 417 Expectation Failed&lt;html&gt;
&lt;head&gt;
&lt;title&gt;417 Expectation Failed&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Expectation Failed&lt;/h1&gt;
&lt;p&gt;The expectation given in the Expect request-header
    field could not be met by this server.&lt;/p&gt;
&lt;p&gt;The client sent&lt;pre&gt;
    Expect: &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-418" name="status-418" id="status-418">418 I'm a teapot</a> </h3>
<pre>HTTP/1.1 418 I&#039;m a teapot&lt;html&gt;
&lt;head&gt;
&lt;title&gt;418 I&#039;m a teapot&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;I&#039;m a teapot&lt;/h1&gt;
&lt;p&gt;Unfortunately this coffee machine is out of coffee.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-419" name="status-419" id="status-419">419 unused</a> </h3>
<pre>HTTP/1.1 419 unused&lt;html&gt;
&lt;head&gt;
&lt;title&gt;419 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-420" name="status-420" id="status-420">420 unused</a> </h3>
<pre>HTTP/1.1 420 unused&lt;html&gt;
&lt;head&gt;
&lt;title&gt;420 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-421" name="status-421" id="status-421">421 unused</a> </h3>
<pre>HTTP/1.1 421 unused&lt;html&gt;
&lt;head&gt;
&lt;title&gt;421 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-422" name="status-422" id="status-422">422 Unprocessable Entity</a> </h3>
<pre>HTTP/1.1 422 Unprocessable Entity&lt;html&gt;
&lt;head&gt;
&lt;title&gt;422 Unprocessable Entity&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Unprocessable Entity&lt;/h1&gt;
&lt;p&gt;The server understands the media type of the
    request entity, but was unable to process the
    contained instructions.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-423" name="status-423" id="status-423">423 Locked</a> </h3>
<pre>HTTP/1.1 423 Locked&lt;html&gt;
&lt;head&gt;
&lt;title&gt;423 Locked&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Locked&lt;/h1&gt;
&lt;p&gt;The requested resource is currently locked.
    The lock must be released or proper identification
    given before the method can be applied.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-424" name="status-424" id="status-424">424 Failed Dependency</a> </h3>
<pre>HTTP/1.1 424 Failed Dependency&lt;html&gt;
&lt;head&gt;
&lt;title&gt;424 Failed Dependency&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Failed Dependency&lt;/h1&gt;
&lt;p&gt;The method could not be performed on the resource
    because the requested action depended on another
    action and that other action failed.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-425" name="status-425" id="status-425">425 No code</a> </h3>
<pre>HTTP/1.1 425 No code&lt;html&gt;
&lt;head&gt;
&lt;title&gt;425 No code&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;No code&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-426" name="status-426" id="status-426">426 Upgrade Required</a> </h3>
<pre>HTTP/1.1 426 Upgrade Required&lt;html&gt;
&lt;head&gt;
&lt;title&gt;426 Upgrade Required&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Upgrade Required&lt;/h1&gt;
&lt;p&gt;The requested resource can only be retrieved
    using SSL.  The server is willing to upgrade the current
    connection to SSL, but your client doesn&#039;t support it.
    Either upgrade your client, or try requesting the page
    using https:// &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-500" name="status-500" id="status-500">500 Internal Server Error</a> </h3>
<pre>HTTP/1.1 500 Internal Server Error
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;500 Internal Server Error&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Internal Server Error&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;p&gt;Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-501" name="status-501" id="status-501">501 Method Not Implemented</a> </h3>
<pre>HTTP/1.1 501 Method Not Implemented
Allow: TRACE
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;501 Method Not Implemented&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Method Not Implemented&lt;/h1&gt;
&lt;p&gt;GET to /e/501 not supported.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-502" name="status-502" id="status-502">502 Bad Gateway</a> </h3>
<pre>HTTP/1.1 502 Bad Gateway
X-Pad: avoid browser bug&lt;html&gt;
&lt;head&gt;
&lt;title&gt;502 Bad Gateway&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Bad Gateway&lt;/h1&gt;
&lt;p&gt;The proxy server received an invalid
    response from an upstream server.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-503" name="status-503" id="status-503">503 Service Temporarily Unavailable</a> </h3>
<pre>HTTP/1.1 503 Service Temporarily Unavailable
Connection: close&lt;html&gt;
&lt;head&gt;
&lt;title&gt;503 Service Temporarily Unavailable&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Service Temporarily Unavailable&lt;/h1&gt;
&lt;p&gt;The server is temporarily unable to service your
    request due to maintenance downtime or capacity
    problems. Please try again later.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-504" name="status-504" id="status-504">504 Gateway Time-out</a> </h3>
<pre>HTTP/1.1 504 Gateway Time-out&lt;html&gt;
&lt;head&gt;
&lt;title&gt;504 Gateway Time-out&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Gateway Time-out&lt;/h1&gt;
&lt;p&gt;The proxy server did not receive a timely response
    from the upstream server.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-505" name="status-505" id="status-505">505 HTTP Version Not Supported</a> </h3>
<pre>HTTP/1.1 505 HTTP Version Not Supported&lt;html&gt;
&lt;head&gt;
&lt;title&gt;505 HTTP Version Not Supported&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;HTTP Version Not Supported&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-506" name="status-506" id="status-506">506 Variant Also Negotiates</a> </h3>
<pre>HTTP/1.1 506 Variant Also Negotiates&lt;html&gt;
&lt;head&gt;
&lt;title&gt;506 Variant Also Negotiates&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Variant Also Negotiates&lt;/h1&gt;
&lt;p&gt;A variant for the requested resource
    &lt;pre&gt;
    /e/506
    &lt;/pre&gt;
    is itself a negotiable resource. This indicates a configuration error.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-507" name="status-507" id="status-507">507 Insufficient Storage</a> </h3>
<pre>HTTP/1.1 507 Insufficient Storage&lt;html&gt;
&lt;head&gt;
&lt;title&gt;507 Insufficient Storage&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Insufficient Storage&lt;/h1&gt;
&lt;p&gt;The method could not be performed on the resource
    because the server is unable to store the
    representation needed to successfully complete the
    request.  There is insufficient free space left in
    your storage allocation.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-508" name="status-508" id="status-508">508 unused</a> </h3>
<pre>HTTP/1.1 508 unused&lt;html&gt;
&lt;head&gt;
&lt;title&gt;508 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-509" name="status-509" id="status-509">509 unused</a> </h3>
<pre>HTTP/1.1 509 unused
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;509 unused&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;unused&lt;/h1&gt;
&lt;p&gt;The server encountered an internal error or misconfigurationand was unable to complete your request.&lt;/p&gt;
&lt;p&gt;Please contact the server administrator, a@s.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.&lt;/p&gt;
&lt;p&gt;More information about this error may be available in the server error log.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h3> <a href="#status-510" name="status-510" id="status-510">510 Not Extended</a> </h3>
<pre>HTTP/1.1 510 Not Extended
X-Pad: avoid browser bug
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;510 Not Extended&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;Not Extended&lt;/h1&gt;
&lt;p&gt;A mandatory extension policy in the request is not
    accepted by the server for this resource.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>


<h2> <a href="#apache-source-code" name="apache-source-code" id="apache-source-code">Apache Source Code</a> </h2>


<h3> <a href="#httpdh-h" name="httpdh-h" id="httpdh-h">httpd.h</a> </h3>
<p>From <a href="http://uploads.askapache.com/2007/02/httpd.h" title="httpd.h Apache">httpd.h</a> </p>
<pre>/**
* The size of the static array in http_protocol.c for storing
* all of the potential response status-lines (a sparse table).
* A future version should dynamically generate the apr_table_t at startup.
*/
#define RESPONSE_CODES 57
#define HTTP_CONTINUE            100
#define HTTP_SWITCHING_PROTOCOLS       101
#define HTTP_PROCESSING          102
#define HTTP_OK              200
#define HTTP_CREATED             201
#define HTTP_ACCEPTED            202
#define HTTP_NON_AUTHORITATIVE       203
#define HTTP_NO_CONTENT          204
#define HTTP_RESET_CONTENT         205
#define HTTP_PARTIAL_CONTENT         206
#define HTTP_MULTI_STATUS          207
#define HTTP_MULTIPLE_CHOICES        300
#define HTTP_MOVED_PERMANENTLY       301
&nbsp;
#define HTTP_MOVED_TEMPORARILY       302
#define HTTP_SEE_OTHER           303
#define HTTP_NOT_MODIFIED          304
#define HTTP_USE_PROXY           305
#define HTTP_TEMPORARY_REDIRECT      307
#define HTTP_BAD_REQUEST           400
#define HTTP_UNAUTHORIZED          401
#define HTTP_PAYMENT_REQUIRED        402
#define HTTP_FORBIDDEN           403
#define HTTP_NOT_FOUND           404
#define HTTP_METHOD_NOT_ALLOWED      405
#define HTTP_NOT_ACCEPTABLE        406
#define HTTP_PROXY_AUTHENTICATION_REQUIRED 407
#define HTTP_REQUEST_TIME_OUT        408
#define HTTP_CONFLICT            409
#define HTTP_GONE              410
#define HTTP_LENGTH_REQUIRED         411
#define HTTP_PRECONDITION_FAILED       412
#define HTTP_REQUEST_ENTITY_TOO_LARGE    413
#define HTTP_REQUEST_URI_TOO_LARGE     414
#define HTTP_UNSUPPORTED_MEDIA_TYPE    415
#define HTTP_RANGE_NOT_SATISFIABLE     416
#define HTTP_EXPECTATION_FAILED      417
#define HTTP_UNPROCESSABLE_ENTITY      422
#define HTTP_LOCKED            423
#define HTTP_FAILED_DEPENDENCY       424
#define HTTP_UPGRADE_REQUIRED        426
#define HTTP_INTERNAL_SERVER_ERROR     500
#define HTTP_NOT_IMPLEMENTED         501
#define HTTP_BAD_GATEWAY           502
#define HTTP_SERVICE_UNAVAILABLE       503
#define HTTP_GATEWAY_TIME_OUT        504
#define HTTP_VERSION_NOT_SUPPORTED     505
#define HTTP_VARIANT_ALSO_VARIES       506
#define HTTP_INSUFFICIENT_STORAGE      507
#define HTTP_NOT_EXTENDED          510
&nbsp;
/** is the status code informational */
#define ap_is_HTTP_INFO(x)     (((x) &gt;= 100)&amp;&amp;((x) &lt; 200))
/** is the status code OK ?*/
#define ap_is_HTTP_SUCCESS(x)    (((x) &gt;= 200)&amp;&amp;((x) &lt; 300))
/** is the status code a redirect */
#define ap_is_HTTP_REDIRECT(x)   (((x) &gt;= 300)&amp;&amp;((x) &lt; 400))
/** is the status code a error (client or server) */
#define ap_is_HTTP_ERROR(x)    (((x) &gt;= 400)&amp;&amp;((x) &lt; 600))
/** is the status code a client error  */
#define ap_is_HTTP_CLIENT_ERROR(x) (((x) &gt;= 400)&amp;&amp;((x) &lt; 500))
/** is the status code a server error  */
#define ap_is_HTTP_SERVER_ERROR(x) (((x) &gt;= 500)&amp;&amp;((x) &lt; 600))
/** is the status code a (potentially) valid response code?  */
#define ap_is_HTTP_VALID_RESPONSE(x) (((x) &gt;= 100)&amp;&amp;((x) &lt; 600))
&nbsp;
/** should the status code drop the connection */
#define ap_status_drops_connection(x) \
(((x) == HTTP_BAD_REQUEST)       || \
((x) == HTTP_REQUEST_TIME_OUT)    || \
((x) == HTTP_LENGTH_REQUIRED)     || \
((x) == HTTP_REQUEST_ENTITY_TOO_LARGE) || \
((x) == HTTP_REQUEST_URI_TOO_LARGE) || \
((x) == HTTP_INTERNAL_SERVER_ERROR) || \
((x) == HTTP_SERVICE_UNAVAILABLE) || \
((x) == HTTP_NOT_IMPLEMENTED))</pre>


<h4>HTTP_INFO</h4>
<p><strong>Is the status code (x) informational?</strong></p>
<pre>x &gt;= 100 &amp;&amp; x &lt; 200</pre>


<h4>HTTP_SUCCESS</h4>
<p><strong>Is the status code (x) OK?</strong></p>
<pre>x &gt;= 200 &amp;&amp; x &lt; 300</pre>


<h4>HTTP_REDIRECT</h4>
<p><strong>Is the status code (x) a redirect?</strong></p>
<pre>x &gt;= 300 &amp;&amp; x &lt; 400</pre>


<h4>HTTP_ERROR</h4>
<p><strong>Is the status code (x) a error (client or server)?</strong></p>
<pre>x &gt;= 400 &amp;&amp; x &lt; 600</pre>


<h4>HTTP_CLIENT_ERROR</h4>
<p><strong>Is the status code (x) a client error?</strong></p>
<pre>x &gt;= 400 &amp;&amp; x &lt; 500</pre>


<h4>HTTP_SERVER_ERROR</h4>
<p><strong>Is the status code (x) a server error?</strong></p>
<pre>x &gt;= 500 &amp;&amp; x &lt; 600</pre>


<h4>HTTP_VALID_RESPONSE</h4>
<p><strong>Is the status code (x) a (potentially) valid response code?</strong></p>
<pre>x &gt;= 100 &amp;&amp; x &lt; 600</pre>


<h3> <a href="#http_protocol-c" name="http_protocol-c" id="http_protocol-c">http_protocol.c</a> </h3>
<p>From <a href="http://uploads.askapache.com/2007/02/http_protocol.c" title="http_protocol.c">http_protocol.c</a> </p>
<pre>static const char * status_lines[RESPONSE_CODES] =
static const char * const status_lines[RESPONSE_CODES] =
"100 Continue",
"101 Switching Protocols",
"102 Processing",
"200 OK",
"201 Created",
"202 Accepted",
"203 Non-Authoritative Information",
"204 No Content",
"205 Reset Content",
"206 Partial Content",
"207 Multi-Status",
"300 Multiple Choices",
"301 Moved Permanently",
"302 Found",
"303 See Other",
"304 Not Modified",
"305 Use Proxy",
"306 unused",
"307 Temporary Redirect",
"400 Bad Request",
"401 Authorization Required",
"402 Payment Required",
"403 Forbidden",
"404 Not Found",
"405 Method Not Allowed",
"406 Not Acceptable",
"407 Proxy Authentication Required",
"408 Request Time-out",
"409 Conflict",
"410 Gone",
"411 Length Required",
"412 Precondition Failed",
"413 Request Entity Too Large",
"414 Request-URI Too Large",
"415 Unsupported Media Type",
"416 Requested Range Not Satisfiable",
"417 Expectation Failed",
"418 unused",
"419 unused",
"420 unused",
"421 unused",
"422 Unprocessable Entity",
"423 Locked",
"424 Failed Dependency",
"425 No code",
"426 Upgrade Required",
"500 Internal Server Error",
"501 Method Not Implemented",
"502 Bad Gateway",
"503 Service Temporarily Unavailable",
"504 Gateway Time-out",
"505 HTTP Version Not Supported",
"506 Variant Also Negotiates",
"507 Insufficient Storage",
"508 unused",
"509 unused",
"510 Not Extended"</pre>


<h2>IANA HTTP Status Code Registry</h2>
<table cellpadding="3" cellspacing="0">
    <thead>
        <tr>
            <th>Value</th>
            <th>Description</th>
            <th>Reference</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>100</td>
            <td>Continue</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.1.1">Section 10.1.1</a> </td>
        </tr>
        <tr>
            <td>101</td>
            <td>Switching Protocols</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.1.2">Section 10.1.2</a> </td>
        </tr>
        <tr>
            <td>102</td>
            <td>Processing</td>
            <td> <a href="#RFC2518"><cite title="HTTP Extensions for Distributed Authoring -- WEBDAV">[RFC2518]</cite></a> , <a href="http://rfc.askapache.com/rfc2518#section-10.1">Section 10.1</a> </td>
        </tr>
        <tr>
            <td>200</td>
            <td>OK</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.1">Section 10.2.1</a> </td>
        </tr>
        <tr>
            <td>201</td>
            <td>Created</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.2">Section 10.2.2</a> </td>
        </tr>
        <tr>
            <td>202</td>
            <td>Accepted</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.3">Section 10.2.3</a> </td>
        </tr>
        <tr>
            <td>203</td>
            <td>Non-Authoritative Information</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.4">Section 10.2.4</a> </td>
        </tr>
        <tr>
            <td>204</td>
            <td>No Content</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.5">Section 10.2.5</a> </td>
        </tr>
        <tr>
            <td>205</td>
            <td>Reset Content</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.6">Section 10.2.6</a> </td>
        </tr>
        <tr>
            <td>206</td>
            <td>Partial Content</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.2.7">Section 10.2.7</a> </td>
        </tr>
        <tr>
            <td>207</td>
            <td>Multi-Status</td>
            <td> <a href="#RFC4918"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a> , <a href="http://rfc.askapache.com/rfc4918#section-11.1">Section 11.1</a> </td>
        </tr>
        <tr>
            <td>226</td>
            <td>IM Used</td>
            <td> <a href="#RFC3229"><cite title="Delta encoding in HTTP">[RFC3229]</cite></a> , <a href="http://rfc.askapache.com/rfc3229#section-10.4.1">Section 10.4.1</a> </td>
        </tr>
        <tr>
            <td>300</td>
            <td>Multiple Choices</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.1">Section 10.3.1</a> </td>
        </tr>
        <tr>
            <td>301</td>
            <td>Moved Permanently</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.2">Section 10.3.2</a> </td>
        </tr>
        <tr>
            <td>302</td>
            <td>Found</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.3">Section 10.3.3</a> </td>
        </tr>
        <tr>
            <td>303</td>
            <td>See Other</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.4">Section 10.3.4</a> </td>
        </tr>
        <tr>
            <td>304</td>
            <td>Not Modified</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.5">Section 10.3.5</a> </td>
        </tr>
        <tr>
            <td>305</td>
            <td>Use Proxy</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.6">Section 10.3.6</a> </td>
        </tr>
        <tr>
            <td>306</td>
            <td>(Reserved)</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.7">Section 10.3.7</a> </td>
        </tr>
        <tr>
            <td>307</td>
            <td>Temporary Redirect</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.3.8">Section 10.3.8</a> </td>
        </tr>
        <tr>
            <td>400</td>
            <td>Bad Request</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.1">Section 10.4.1</a> </td>
        </tr>
        <tr>
            <td>401</td>
            <td>Unauthorized</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.2">Section 10.4.2</a> </td>
        </tr>
        <tr>
            <td>402</td>
            <td>Payment Required</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.3">Section 10.4.3</a> </td>
        </tr>
        <tr>
            <td>403</td>
            <td>Forbidden</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.4">Section 10.4.4</a> </td>
        </tr>
        <tr>
            <td>404</td>
            <td>Not Found</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.5">Section 10.4.5</a> </td>
        </tr>
        <tr>
            <td>405</td>
            <td>Method Not Allowed</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.6">Section 10.4.6</a> </td>
        </tr>
        <tr>
            <td>406</td>
            <td>Not Acceptable</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.7">Section 10.4.7</a> </td>
        </tr>
        <tr>
            <td>407</td>
            <td>Proxy Authentication Required</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.8">Section 10.4.8</a> </td>
        </tr>
        <tr>
            <td>408</td>
            <td>Request Timeout</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.9">Section 10.4.9</a> </td>
        </tr>
        <tr>
            <td>409</td>
            <td>Conflict</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.10">Section 10.4.10</a> </td>
        </tr>
        <tr>
            <td>410</td>
            <td>Gone</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.11">Section 10.4.11</a> </td>
        </tr>
        <tr>
            <td>411</td>
            <td>Length Required</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.12">Section 10.4.12</a> </td>
        </tr>
        <tr>
            <td>412</td>
            <td>Precondition Failed</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.13">Section 10.4.13</a> </td>
        </tr>
        <tr>
            <td>413</td>
            <td>Request Entity Too Large</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.14">Section 10.4.14</a> </td>
        </tr>
        <tr>
            <td>414</td>
            <td>Request-URI Too Long</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.15">Section 10.4.15</a> </td>
        </tr>
        <tr>
            <td>415</td>
            <td>Unsupported Media Type</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.16">Section 10.4.16</a> </td>
        </tr>
        <tr>
            <td>416</td>
            <td>Requested Range Not Satisfiable</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.17">Section 10.4.17</a> </td>
        </tr>
        <tr>
            <td>417</td>
            <td>Expectation Failed</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.4.18">Section 10.4.18</a> </td>
        </tr>
        <tr>
            <td>422</td>
            <td>Unprocessable Entity</td>
            <td> <a href="#RFC4918"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a> , <a href="http://rfc.askapache.com/rfc4918#section-11.2">Section 11.2</a> </td>
        </tr>
        <tr>
            <td>423</td>
            <td>Locked</td>
            <td> <a href="#RFC4918"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a> , <a href="http://rfc.askapache.com/rfc4918#section-11.3">Section 11.3</a> </td>
        </tr>
        <tr>
            <td>424</td>
            <td>Failed Dependency</td>
            <td> <a href="#RFC4918"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a> , <a href="http://rfc.askapache.com/rfc4918#section-11.4">Section 11.4</a> </td>
        </tr>
        <tr>
            <td>426</td>
            <td>Upgrade Required</td>
            <td> <a href="#RFC2817"><cite title="Upgrading to TLS Within HTTP/1.1">[RFC2817]</cite></a> , <a href="http://rfc.askapache.com/rfc2817#section-6">Section 6</a> </td>
        </tr>
        <tr>
            <td>500</td>
            <td>Internal Server Error</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.1">Section 10.5.1</a> </td>
        </tr>
        <tr>
            <td>501</td>
            <td>Not Implemented</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.2">Section 10.5.2</a> </td>
        </tr>
        <tr>
            <td>502</td>
            <td>Bad Gateway</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.3">Section 10.5.3</a> </td>
        </tr>
        <tr>
            <td>503</td>
            <td>Service Unavailable</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.4">Section 10.5.4</a> </td>
        </tr>
        <tr>
            <td>504</td>
            <td>Gateway Timeout</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.5">Section 10.5.5</a> </td>
        </tr>
        <tr>
            <td>505</td>
            <td>HTTP Version Not Supported</td>
            <td> <a href="#RFC2616"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a> , <a href="http://rfc.askapache.com/rfc2616#section-10.5.6">Section 10.5.6</a> </td>
        </tr>
        <tr>
            <td>506</td>
            <td>Variant Also Negotiates</td>
            <td> <a href="#RFC2295"><cite title="Transparent Content Negotiation in HTTP">[RFC2295]</cite></a> , <a href="http://rfc.askapache.com/rfc2295#section-8.1">Section 8.1</a> </td>
        </tr>
        <tr>
            <td>507</td>
            <td>Insufficient Storage</td>
            <td> <a href="#RFC4918"><cite title="HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)">[RFC4918]</cite></a> , <a href="http://rfc.askapache.com/rfc4918#section-11.5">Section 11.5</a> </td>
        </tr>
        <tr>
            <td>510</td>
            <td>Not Extended</td>
            <td> <a href="#RFC2774"><cite title="An HTTP Extension Framework">[RFC2774]</cite></a> , <a href="http://rfc.askapache.com/rfc2774#section-7">Section 7</a> </td>
        </tr>
    </tbody>
</table>


<h2>WordPress 2.8 Changes</h2>
<p>I just learned that <a href="https://core.trac.wordpress.org/ticket/9297">my modification</a> to the WordPress core was <a href="https://core.trac.wordpress.org/changeset/10740">accepted</a> and will be implemented for version 2.8!  This may mean WordPress is the only 100% HTTP/1.1 compliant software on the net!  Below is the new list (<em>I thought someone out there could use the php array</em>) and as you can see, unfortunately<strong>418 I'm a teapot</strong>didn't make it ;)</p>
<pre>$wp_header_to_desc = array(
  100 =&gt; &#039;Continue&#039;,
  101 =&gt; &#039;Switching Protocols&#039;,
  102 =&gt; &#039;Processing&#039;,
&nbsp;
  200 =&gt; &#039;OK&#039;,
  201 =&gt; &#039;Created&#039;,
  202 =&gt; &#039;Accepted&#039;,
  203 =&gt; &#039;Non-Authoritative Information&#039;,
  204 =&gt; &#039;No Content&#039;,
  205 =&gt; &#039;Reset Content&#039;,
  206 =&gt; &#039;Partial Content&#039;,
  207 =&gt; &#039;Multi-Status&#039;,
  226 =&gt; &#039;IM Used&#039;,
&nbsp;
  300 =&gt; &#039;Multiple Choices&#039;,
  301 =&gt; &#039;Moved Permanently&#039;,
  302 =&gt; &#039;Found&#039;,
  303 =&gt; &#039;See Other&#039;,
  304 =&gt; &#039;Not Modified&#039;,
  305 =&gt; &#039;Use Proxy&#039;,
  306 =&gt; &#039;Reserved&#039;,
  307 =&gt; &#039;Temporary Redirect&#039;,
&nbsp;
  400 =&gt; &#039;Bad Request&#039;,
  401 =&gt; &#039;Unauthorized&#039;,
  402 =&gt; &#039;Payment Required&#039;,
  403 =&gt; &#039;Forbidden&#039;,
  404 =&gt; &#039;Not Found&#039;,
  405 =&gt; &#039;Method Not Allowed&#039;,
  406 =&gt; &#039;Not Acceptable&#039;,
  407 =&gt; &#039;Proxy Authentication Required&#039;,
  408 =&gt; &#039;Request Timeout&#039;,
  409 =&gt; &#039;Conflict&#039;,
  410 =&gt; &#039;Gone&#039;,
  411 =&gt; &#039;Length Required&#039;,
  412 =&gt; &#039;Precondition Failed&#039;,
  413 =&gt; &#039;Request Entity Too Large&#039;,
  414 =&gt; &#039;Request-URI Too Long&#039;,
  415 =&gt; &#039;Unsupported Media Type&#039;,
  416 =&gt; &#039;Requested Range Not Satisfiable&#039;,
  417 =&gt; &#039;Expectation Failed&#039;,
  422 =&gt; &#039;Unprocessable Entity&#039;,
  423 =&gt; &#039;Locked&#039;,
  424 =&gt; &#039;Failed Dependency&#039;,
  426 =&gt; &#039;Upgrade Required&#039;,
&nbsp;
  500 =&gt; &#039;Internal Server Error&#039;,
  501 =&gt; &#039;Not Implemented&#039;,
  502 =&gt; &#039;Bad Gateway&#039;,
  503 =&gt; &#039;Service Unavailable&#039;,
  504 =&gt; &#039;Gateway Timeout&#039;,
  505 =&gt; &#039;HTTP Version Not Supported&#039;,
  506 =&gt; &#039;Variant Also Negotiates&#039;,
  507 =&gt; &#039;Insufficient Storage&#039;,
  510 =&gt; &#039;Not Extended&#039;
);</pre>


<h2>RIPE WHOIS</h2>
<blockquote cite="http://labs.ripe.net/content/ripe-database-api-documentation">
    <p>
    <p>All the status codes are standard HTTP codes ( <a href="http://www.iana.org/assignments/http-status-codes">http://www.iana.org/assignments/http-status-codes</a> ).</p>
    <p></p>
    <p>Clients should avoid any form of coupling with the the text/plain error message contained in response body since it may change between different releases of the API and is only intended as a starting point for indentifying the real causes of the exception event.</p>
    <p>The following table gives a brief description of the mapping between standard Whois V.3 responses and the related REST services status codes. Consider this table as just an example of the error mapping strategy, it may change with future releases.</p>
    </p>
</blockquote>
<table>
    <tbody>
        <tr>
            <th>System Exception</th>
            <th>Whois Error</th>
            <th>HTTP Status Code</th>
        </tr>
        <tr>
            <td>IllegalArgumentException</td>
            <td></td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>IllegalStateException</td>
            <td></td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>UnsupportedOperationException</td>
            <td></td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>ObjectNotFoundException</td>
            <td></td>
            <td>Not Found (404)</td>
        </tr>
        <tr>
            <td>IllegalStateException</td>
            <td></td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>IOException</td>
            <td></td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>SystemException</td>
            <td></td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>TooManyResultsException</td>
            <td></td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>No Entries Found (101)</td>
            <td>Not Found (404)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Unknown Source (102)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Unknown Object Type (103)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Unknown Attribute in Query (104)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Attribute Is Not Inverse Searchable (105)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>No Search Key Specified (106)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Access Denied (201)</td>
            <td>Forbidden (403)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Access Control Limit Reached (202)</td>
            <td>Forbidden (403)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Address Passing Not Allowed (203)</td>
            <td>Bad Request (400)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Maximum Referral Lines Exceeded (204)</td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Connection Has Been Closed(301)</td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Referral Timeout (302)</td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>No Referral Host (303)</td>
            <td>Internal Server Error (500)</td>
        </tr>
        <tr>
            <td>WhoisServerException</td>
            <td>Referral Host Not Responding (304)</td>
            <td>Internal Server Error (500)</td>
        </tr>
    </tbody>
</table>
<blockquote cite="http://labs.ripe.net/content/ripe-database-api-documentation">
    <p>
    <p>Clients will have to define error messages generic enough to represent the four main error conditions, that are Bad Request, Forbidden, Not Found and Internal Server Error.</p>
    <p>For example a possible mapping for client side error messages may be:</p>
    </p>
</blockquote>
<table>
    <tbody>
        <tr>
            <th>HTTP Status Code</th>
            <th>Error Message</th>
        </tr>
        <tr>
            <td>Bad Request (400)</td>
            <td>The service is unable to understand and process the query.</td>
        </tr>
        <tr>
            <td>Forbidden (403)</td>
            <td>Query limit exceeded.</td>
        </tr>
        <tr>
            <td>Not Found (404)</td>
            <td>No results were found for Your search "<tt>Search term</tt>"</td>
        </tr>
        <tr>
            <td>Internal Server Error (500)</td>
            <td>The server encountered an unexpected condition which prevented it from fulfilling the request.</td>
        </tr>
    </tbody>
</table>


<h2>Helpful HTTP Links</h2>
<ol>
    <li> <a href="http://www.iana.org/assignments/http-status-codes">IANA registry</a> </li>
    <li> <a href="http://rfc.askapache.com/rfc2324">Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)</a> </li>
    <li> <a href="http://livedocs.adobe.com/fms/2/docs/00000338.html">Adobe Flash status code definitions (ie 408)</a> </li>
    <li> <a href="http://support.microsoft.com/?id=318380">Microsoft Internet Information Server Status Codes and Sub-Codes</a> </li>
    <li> <a href="http://zamez.org/httplint?url=http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html">httplint</a> </li>
    <li> <a href="http://www.w3.org/Protocols/HTTP/HTRQ_Headers.html">HTTP Headers, brief intro.</a> </li>
    <li> <a href="http://www.w3.org/TR/cuap">Common User-Agent Issues</a> </li>
    <li>[RFC2295] <a href="mailto:koen@win.tue.nl" title="Technische Universiteit Eindhoven">Holtman, K.</a> and <a href="mailto:mutz@hpl.hp.com" title="Hewlett-Packard Company">A.H. Mutz</a> , " <a href="http://rfc.askapache.com/rfc2295">Transparent Content Negotiation in HTTP</a> ", RFC 2295, March 1998.</li>
    <li>[RFC2518] <a href="mailto:yarong@microsoft.com" title="Microsoft Corporation">Goland, Y.</a> , <a href="mailto:ejw@ics.uci.edu" title="Dept. Of Information and Computer Science, University of California, Irvine">Whitehead, E.</a> , <a href="mailto:asad@netscape.com" title="Netscape">Faizi, A.</a> , <a href="mailto:srcarter@novell.com" title="Novell">Carter, S.R.</a> , and <a href="mailto:dcjensen@novell.com" title="Novell">D. Jensen</a> , " <a href="http://rfc.askapache.com/rfc2518">HTTP Extensions for Distributed Authoring -- WEBDAV</a> ", RFC 2518, February 1999.</li>
    <li>[RFC2616] <a href="mailto:fielding@ics.uci.edu" title="University of California, Irvine">Fielding, R.</a> , <a href="mailto:jg@w3.org" title="W3C">Gettys, J.</a> , <a href="mailto:mogul@wrl.dec.com" title="Compaq Computer Corporation">Mogul, J.</a> , <a href="mailto:frystyk@w3.org" title="MIT Laboratory for Computer Science">Frystyk, H.</a> , <a href="mailto:masinter@parc.xerox.com" title="Xerox Corporation">Masinter, L.</a> , <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a> , and <a href="mailto:timbl@w3.org" title="W3C">T. Berners-Lee</a> , " <a href="http://rfc.askapache.com/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a> ", RFC 2616, June 1999.</li>
    <li>[RFC2774] <a href="mailto:frystyk@microsoft.com" title="Microsoft Corporation">Nielsen, H.</a> , <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a> , and <a href="mailto:lawrence@agranat.com" title="Agranat Systems, Inc.">S. Lawrence</a> , " <a href="http://rfc.askapache.com/rfc2774">An HTTP Extension Framework</a> ", RFC 2774, February 2000.</li>
    <li>[RFC2817] Khare, R. and S. Lawrence, " <a href="http://rfc.askapache.com/rfc2817">Upgrading to TLS Within HTTP/1.1</a> ", RFC 2817, May 2000.</li>
    <li>[RFC3229] Mogul, J., Krishnamurthy, B., Douglis, F., Feldmann, A., Goland, Y., van Hoff, A., and D. Hellerstein, " <a href="http://rfc.askapache.com/rfc3229">Delta encoding in HTTP</a> ", RFC 3229, January 2002.</li>
    <li>[RFC4918] <a href="mailto:ldusseault@commerce.net" title="CommerceNet">Dusseault, L., Ed.</a> , " <a href="http://rfc.askapache.com/rfc4918">HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</a> ", RFC 4918, June 2007.</li>
</ol><p><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html"></a><a href="http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html">HTTP Status Codes and Htaccess ErrorDocuments</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Actual Htaccess Files from My Server</title>
		<link>http://www.askapache.com/htaccess/real-world-htaccess-files.html</link>
		<comments>http://www.askapache.com/htaccess/real-world-htaccess-files.html#comments</comments>
		<pubDate>Sat, 17 Apr 2010 15:06:22 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4357</guid>
		<description><![CDATA[<pre>#### No https except to wp-admin -
# If the request is empty ( implies fopen or normal file access by a php script )
RewriteCond %{THE_REQUEST} ^$ [OR]

# OR if the request if for wp-admin or wp-login.php
RewriteCond %{REQUEST_URI} ^/(wp-admin&#124;wp-login\.php).*$ [NC,OR]

# OR if the Referer is https
RewriteCond %{HTTP_REFERER} ^https://www.askapache.com/.*$ [NC]

# THEN skip the following rule, basically all this does is force https or badhost to be redirected
# BUT because of the above 3 rewritecond's, this won't break poorly written admin scripts
RewriteRule .* - [S=1]

RewriteCond %{HTTPS} =on [OR]
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule .* http://www.askapache.com%{REQUEST_URI} [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(wp-admin/.*&#124;wp-login\.php.*)\ HTTP/ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]</pre>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/real-world-htaccess-files.html"></a><a href="http://www.askapache.com/htaccess/real-world-htaccess-files.html"><cite>AskApache.com</cite></a></p><p>I was going through some backups from years ago, and ran:</p>
<pre>locate .htaccess | xargs -I&#039;{}&#039; cat &#039;{}&#039; &gt;&gt; master-htaccesser.txt</pre>
<p>My site is named after reading source code because that is what helps me the most when I'm trying to learn something unusually difficult.   Just like functions and aliases, it is very helpful to have cheatsheets for common commands.. not much is better than real-world examples.  Unfortunately because this was compiled from hundreds of htaccess files on multiple hosts and platforms, and due to the concatenation, it's not organized.</p>

<p>Normally I would not publish something like this, who knows how much unreleased tricks I forgot about..  but in order to say thanks to all those working for open-source, the FSF, and to all those who don't steal content, and to all the incredible authors who shared with me (I twitter most of what I find, and follow my favs), here ya go..</p>


<p class="cnote"><strong>ATTN:</strong> Please let me know if this is total junk or not, this is around 1/500th of my master-htaccesser.txt file.. and I'd be happy to post more if it helps..</p>

<h2>Checking for Cookie</h2>
<p>Used this to stop mp3-scrapers.. checks for a cookie ending in MP3P=02357</p>
<pre>Options -Indexes
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*MP3P=([0-9]+).* [NC]
RewriteRule .* - [F,L]</pre>

<h2>Setting Environment Var if Proxied</h2>
<pre>RewriteEngine On
RewriteRule "\.(gif|png|jpg)$" "-" [ENV=proxied_image:1]
RewriteCond "%{ENV:proxied_image}" "!1"
RewriteRule "^" "-" [ENV=proxied_other:1]</pre>

<h2>nokeepalive for ErrorDocs and Abusers</h2>
<pre>Options SymLinksIfOwnerMatch IncludesNOEXEC
AddOutputFilter Includes html
SetEnv nokeepalive
Order Allow,Deny
Allow from all
# 1 YEAR
&lt;filesMatch "\.(js|css)$"&gt;
Header unset Pragma
FileETag None
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
Header unset Last-Modified
Header unset ETag
&nbsp;
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
&lt;/filesMatch&gt;
SecFilterEngine Off
&nbsp;
# 1 YEAR
&lt;filesMatch "\.(js|css)$"&gt;
Header unset Pragma
FileETag None
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
Header unset Last-Modified
Header unset ETag
&nbsp;
SetOutputFilter DEFLATE
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
&lt;/filesMatch&gt;</pre>








<h2>Unreleased Tests for AskApache Password Protection</h2>
<pre># +ASKAPACHE PASSPRO 4.6.6
#######################################################
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +APRO SIDS
# +SID 21030002
Order Deny,Allow
Deny from All
Satisfy Any
AuthType Digest
AuthName "Protected By AskApache"
AuthDigestDomain / http://www.askapache.com/
AuthDigestFile /home/.greer/askapache/sites/askapache.com/.htpasswda3
Require valid-user
&lt;filesMatch "\.(ico|pdf|flv|jpg|jpeg|mp3|mpg|mp4|mov|wav|wmv|png|gif|swf|css|js)$"&gt;
Allow from All
&lt;/filesMatch&gt;
&lt;filesMatch "(async-upload|admin-ajax)\.php$"&gt;
&lt;ifModule mod_security.c&gt;
SecFilterEngine Off
&lt;/ifModule&gt;
Allow from All
&lt;/filesMatch&gt;
# -SID 21030002
# -APRO SIDS
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
#######################################################
# -ASKAPACHE PASSPRO 4.6.6
&nbsp;
# +ASKAPACHE PASSPRO 4.6.6
#######################################################
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +APRO SIDS
# +SID Test
ErrorDocument 401 /wp-content/askapache/test.gif
ErrorDocument 403 /wp-content/askapache/test.gif
ErrorDocument 404 /wp-content/askapache/test.gif
ErrorDocument 500 /wp-content/askapache/test.gif
ServerSignature On
&lt;ifModule mod_alias.c&gt;
RedirectMatch 305 ^.*modaliastest$ http://www.askapache.com
&lt;/ifModule&gt;
&lt;ifModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} modrewritetest [NC]
RewriteRule .* http://www.askapache.com [R=307,L]
&lt;/ifModule&gt;
&lt;files modsec_check.gif&gt;
&lt;ifModule mod_security.c&gt;
SetEnv MODSEC_ENABLE On
SecFilterEngine On
SecFilterDefaultAction "nolog,noauditlog,pass"
SecAuditEngine Off
SecFilterInheritance Off
SecFilter modsecuritytest "deny,nolog,noauditlog,status:503"
Deny from All
&lt;/ifModule&gt;
&lt;/files&gt;
&lt;files basic_auth_test.gif&gt;
AuthType Basic
AuthName "askapache test"
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-basic
Require valid-user
&lt;/files&gt;
&lt;files digest_check.gif&gt;
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require none
&lt;/files&gt;
&lt;files authuserfile_test.gif&gt;
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthUserFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require valid-user
&lt;/files&gt;
&lt;files authdigestfile_test.gif&gt;
AuthType Digest
AuthName "askapache test"
AuthDigestDomain /wp-content/askapache/ http://www.askapache.com/wp-content/askapache/
AuthDigestFile /home/.greer/askapache/sites/askapache.com/htdocs/wp-content/askapache/.htpasswd-digest
Require valid-user
&lt;/files&gt;
# -SID Test
# -APRO SIDS
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
#######################################################
# -ASKAPACHE PASSPRO 4.6.6</pre>
















<h2>Warming up to the really advanced tests</h2>
<pre>Options +ExecCGI
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111 208.113.134.203 208.113.152.201 env=REDIRECT_STATUS
Satisfy Any
Options +FollowSymLinks
AddHandler application/x-httpd-php .php
&nbsp;
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^tyy+$ [NC]
RewriteCond %{REMOTE_USER} ^(.+)$
RewriteRule ^(.*)$ $1/-%1 [R=302,L]
Options +ExecCGI +FollowSymLinks
DirectoryIndex index.php
ErrorDocument 404 /cgi-bin/pro/index.php
&nbsp;
AuthType Digest
AuthName "AskApache Pro"
AuthDigestFile /home/askapache/sites/askapache.com/.htpasswd-pro
AuthDigestDomain /cgi-bin/pro/ http://www.askapache.com/cgi-bin/pro/ https://www.askapache.com/cgi-bin/pro/
Require user askapacheDirectoryIndex p.php
ErrorDocument 403 /cgi-bin/p/p.php
ErrorDocument 401 /cgi-bin/p/p.php
ErrorDocument 500 /cgi-bin/p/p.php
ErrorDocument 503 /cgi-bin/p/p.php
&nbsp;
RewriteEngine On
RewriteBase /
RewriteRule .* - [E=INFO_API_VERSION:%{API_VERSION}]
RewriteRule .* - [E=INFO_AUTH_TYPE:%{AUTH_TYPE}]
RewriteRule .* - [E=INFO_CONTENT_LENGTH:%{CONTENT_LENGTH}]
RewriteRule .* - [E=INFO_CONTENT_TYPE:%{CONTENT_TYPE}]
RewriteRule .* - [E=INFO_DOCUMENT_ROOT:%{DOCUMENT_ROOT}]
RewriteRule .* - [E=INFO_GATEWAY_INTERFACE:%{GATEWAY_INTERFACE}]
RewriteRule .* - [E=INFO_HTTPS:%{HTTPS}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT:%{HTTP:Accept}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_LANGUAGE:%{HTTP:Accept-Language}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_ENCODING:%{HTTP:Accept-Encoding}]
RewriteRule .* - [E=INFO_HTTP_ACCEPT_CHARSET:%{HTTP:Accept-Charset}]
RewriteRule .* - [E=INFO_HTTP_CACHE_CONTROL:%{HTTP:Cache-Control}]
RewriteRule .* - [E=INFO_HTTP_CONNECTION:%{HTTP:Connection}]
RewriteRule .* - [E=INFO_HTTP_COOKIE:%{HTTP_COOKIE}]
RewriteRule .* - [E=INFO_HTTP_FORWARDED:%{HTTP_FORWARDED}]
RewriteRule .* - [E=INFO_HTTP_HOST:%{HTTP_HOST}]
RewriteRule .* - [E=INFO_HTTP_KEEP_ALIVE:%{HTTP_KEEP_ALIVE}]
RewriteRule .* - [E=INFO_HTTP_PROXY_CONNECTION:%{HTTP_PROXY_CONNECTION}]
RewriteRule .* - [E=INFO_HTTP_REFERER:%{HTTP:Referer}]
RewriteRule .* - [E=INFO_HTTP_USER_AGENT:%{HTTP_USER_AGENT}]
RewriteRule .* - [E=INFO_IS_SUBREQ:%{IS_SUBREQ}]
RewriteRule .* - [E=INFO_ORIG_PATH_INFO:%{ORIG_PATH_INFO}]
RewriteRule .* - [E=INFO_ORIG_PATH_TRANSLATED:%{ORIG_PATH_TRANSLATED}]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_FILENAME:%{ORIG_SCRIPT_FILENAME}]
RewriteRule .* - [E=INFO_ORIG_SCRIPT_NAME:%{ORIG_SCRIPT_NAME}]
RewriteRule .* - [E=INFO_PATH:%{PATH}]
RewriteRule .* - [E=INFO_PATH_INFO:%{PATH_INFO}]
RewriteRule .* - [E=INFO_QUERY_STRING:%{QUERY_STRING}]
RewriteRule .* - [E=INFO_REDIRECT_QUERY_STRING:%{REDIRECT_QUERY_STRING}]
RewriteRule .* - [E=INFO_REDIRECT_REMOTE_USER:%{REDIRECT_REMOTE_USER}]
RewriteRule .* - [E=INFO_REDIRECT_STATUS:%{REDIRECT_STATUS}]
RewriteRule .* - [E=INFO_REDIRECT_URL:%{REDIRECT_URL}]
RewriteRule .* - [E=INFO_REMOTE_ADDR:%{REMOTE_ADDR}]
RewriteRule .* - [E=INFO_REMOTE_HOST:%{REMOTE_HOST}]
RewriteRule .* - [E=INFO_REMOTE_IDENT:%{REMOTE_IDENT}]
RewriteRule .* - [E=INFO_REMOTE_PORT:%{REMOTE_PORT}]
RewriteRule .* - [E=INFO_REMOTE_USER:%{REMOTE_USER}]
RewriteRule .* - [E=INFO_REQUEST_FILENAME:%{REQUEST_FILENAME}]
RewriteRule .* - [E=INFO_REQUEST_METHOD:%{REQUEST_METHOD}]
RewriteRule .* - [E=INFO_REQUEST_URI:%{REQUEST_URI}]
RewriteRule .* - [E=INFO_REDIRECT_REQUEST_URI:%{REDIRECT_REQUEST_URI}]
RewriteRule .* - [E=INFO_SCRIPT_FILENAME:%{SCRIPT_FILENAME}]
RewriteRule .* - [E=INFO_SCRIPT_GROUP:%{SCRIPT_GROUP}]
RewriteRule .* - [E=INFO_SCRIPT_NAME:%{SCRIPT_NAME}]
RewriteRule .* - [E=INFO_SCRIPT_URI:%{SCRIPT_URI}]
RewriteRule .* - [E=INFO_SCRIPT_URL:%{SCRIPT_URL}]
RewriteRule .* - [E=INFO_SCRIPT_USER:%{SCRIPT_USER}]
RewriteRule .* - [E=INFO_SERVER_ADDR:%{SERVER_ADDR}]
RewriteRule .* - [E=INFO_SERVER_ADMIN:%{SERVER_ADMIN}]
RewriteRule .* - [E=INFO_SERVER_NAME:%{SERVER_NAME}]
RewriteRule .* - [E=INFO_SERVER_PORT:%{SERVER_PORT}]
RewriteRule .* - [E=INFO_SERVER_PROTOCOL:%{SERVER_PROTOCOL}]
RewriteRule .* - [E=INFO_SERVER_SIGNATURE:%{SERVER_SIGNATURE}]
RewriteRule .* - [E=INFO_SERVER_SOFTWARE:%{SERVER_SOFTWARE}]
RewriteRule .* - [E=INFO_THE_REQUEST:%{THE_REQUEST}]
RewriteRule .* - [E=INFO_TIME:%{TIME}]
RewriteRule .* - [E=INFO_TIME_DAY:%{TIME_DAY}]
RewriteRule .* - [E=INFO_TIME_HOUR:%{TIME_HOUR}]
RewriteRule .* - [E=INFO_TIME_MIN:%{TIME_MIN}]
RewriteRule .* - [E=INFO_TIME_MON:%{TIME_MON}]
RewriteRule .* - [E=INFO_TIME_SEC:%{TIME_SEC}]
RewriteRule .* - [E=INFO_TIME_WDAY:%{TIME_WDAY}]
RewriteRule .* - [E=INFO_TIME_YEAR:%{TIME_YEAR}]
RewriteRule .* - [E=INFO_TZ:%{TZ}]
RewriteRule .* - [E=INFO_UNIQUE_ID:%{UNIQUE_ID}]
&nbsp;
RequestHeader set INFO_API_VERSION "%{INFO_API_VERSION}e"
RequestHeader set INFO_AUTH_TYPE "%{INFO_AUTH_TYPE}e"
RequestHeader set INFO_CONTENT_LENGTH "%{INFO_CONTENT_LENGTH}e"
RequestHeader set INFO_CONTENT_TYPE "%{INFO_CONTENT_TYPE}e"
RequestHeader set INFO_DOCUMENT_ROOT "%{INFO_DOCUMENT_ROOT}e"
RequestHeader set INFO_GATEWAY_INTERFACE "%{INFO_GATEWAY_INTERFACE}e"
RequestHeader set INFO_HTTPS "%{INFO_HTTPS}e"
RequestHeader set INFO_HTTP_ACCEPT "%{INFO_HTTP_ACCEPT}e"
RequestHeader set INFO_HTTP_ACCEPT_LANGUAGE "%{INFO_HTTP_ACCEPT_LANGUAGE}e"
RequestHeader set INFO_HTTP_ACCEPT_ENCODING "%{INFO_HTTP_ACCEPT_ENCODING}e"
RequestHeader set INFO_HTTP_ACCEPT_CHARSET "%{INFO_HTTP_ACCEPT_CHARSET}e"
RequestHeader set INFO_HTTP_CACHE_CONTROL "%{INFO_HTTP_CACHE_CONTROL}e"
RequestHeader set INFO_HTTP_CONNECTION "%{INFO_HTTP_CONNECTION}e"
RequestHeader set INFO_HTTP_COOKIE "%{INFO_HTTP_COOKIE}e"
RequestHeader set INFO_HTTP_FORWARDED "%{INFO_HTTP_FORWARDED}e"
RequestHeader set INFO_HTTP_HOST "%{INFO_HTTP_HOST}e"
RequestHeader set INFO_HTTP_KEEP_ALIVE "%{INFO_HTTP_KEEP_ALIVE}e"
RequestHeader set INFO_HTTP_PROXY_CONNECTION "%{INFO_HTTP_PROXY_CONNECTION}e"
RequestHeader set INFO_HTTP_REFERER "%{INFO_HTTP_REFERER}e"
RequestHeader set INFO_HTTP_USER_AGENT "%{INFO_HTTP_USER_AGENT}e"
RequestHeader set INFO_IS_SUBREQ "%{INFO_IS_SUBREQ}e"
RequestHeader set INFO_ORIG_PATH_INFO "%{INFO_ORIG_PATH_INFO}e"
RequestHeader set INFO_ORIG_PATH_TRANSLATED "%{INFO_ORIG_PATH_TRANSLATED}e"
RequestHeader set INFO_ORIG_SCRIPT_FILENAME "%{INFO_ORIG_SCRIPT_FILENAME}e"
RequestHeader set INFO_ORIG_SCRIPT_NAME "%{INFO_ORIG_SCRIPT_NAME}e"
RequestHeader set INFO_PATH "%{INFO_PATH}e"
RequestHeader set INFO_PATH_INFO "%{INFO_PATH_INFO}e"
RequestHeader set INFO_QUERY_STRING "%{INFO_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_QUERY_STRING "%{INFO_REDIRECT_QUERY_STRING}e"
RequestHeader set INFO_REDIRECT_REMOTE_USER "%{INFO_REDIRECT_REMOTE_USER}e"
RequestHeader set INFO_REDIRECT_STATUS "%{INFO_REDIRECT_STATUS}e"
RequestHeader set INFO_REDIRECT_URL "%{INFO_REDIRECT_URL}e"
RequestHeader set INFO_REMOTE_ADDR "%{INFO_REMOTE_ADDR}e"
RequestHeader set INFO_REMOTE_HOST "%{INFO_REMOTE_HOST}e"
RequestHeader set INFO_REMOTE_IDENT "%{INFO_REMOTE_IDENT}e"
RequestHeader set INFO_REMOTE_PORT "%{INFO_REMOTE_PORT}e"
RequestHeader set INFO_REMOTE_USER "%{INFO_REMOTE_USER}e"
RequestHeader set INFO_REQUEST_FILENAME "%{INFO_REQUEST_FILENAME}e"
RequestHeader set INFO_REQUEST_METHOD "%{INFO_REQUEST_METHOD}e"
RequestHeader set INFO_REQUEST_URI "%{INFO_REQUEST_URI}e"
RequestHeader set INFO_REQUEST_URI "%{INFO_REQUEST_URI}e"
RequestHeader set INFO_SCRIPT_FILENAME "%{INFO_SCRIPT_FILENAME}e"
RequestHeader set INFO_SCRIPT_GROUP "%{INFO_SCRIPT_GROUP}e"
RequestHeader set INFO_SCRIPT_NAME "%{INFO_SCRIPT_NAME}e"
RequestHeader set INFO_SCRIPT_URI "%{INFO_SCRIPT_URI}e"
RequestHeader set INFO_SCRIPT_URL "%{INFO_SCRIPT_URL}e"
RequestHeader set INFO_SCRIPT_USER "%{INFO_SCRIPT_USER}e"
RequestHeader set INFO_SERVER_ADDR "%{INFO_SERVER_ADDR}e"
RequestHeader set INFO_SERVER_ADMIN "%{INFO_SERVER_ADMIN}e"
RequestHeader set INFO_SERVER_NAME "%{INFO_SERVER_NAME}e"
RequestHeader set INFO_SERVER_PORT "%{INFO_SERVER_PORT}e"
RequestHeader set INFO_SERVER_PROTOCOL "%{INFO_SERVER_PROTOCOL}e"
RequestHeader set INFO_SERVER_SIGNATURE "%{INFO_SERVER_SIGNATURE}e"
RequestHeader set INFO_SERVER_SOFTWARE "%{INFO_SERVER_SOFTWARE}e"
RequestHeader set INFO_THE_REQUEST "%{INFO_THE_REQUEST}e"
RequestHeader set INFO_TIME "%{INFO_TIME}e"
RequestHeader set INFO_TIME_DAY "%{INFO_TIME_DAY}e"
RequestHeader set INFO_TIME_HOUR "%{INFO_TIME_HOUR}e"
RequestHeader set INFO_TIME_MIN "%{INFO_TIME_MIN}e"
RequestHeader set INFO_TIME_MON "%{INFO_TIME_MON}e"
RequestHeader set INFO_TIME_SEC "%{INFO_TIME_SEC}e"
RequestHeader set INFO_TIME_WDAY "%{INFO_TIME_WDAY}e"
RequestHeader set INFO_TIME_YEAR "%{INFO_TIME_YEAR}e"
RequestHeader set INFO_TZ "%{INFO_TZ}e"
RequestHeader set INFO_UNIQUE_ID "%{INFO_UNIQUE_ID}e"
&nbsp;
Options +FollowSymLinks +ExecCGI
DirectoryIndex /cgi-bin/rewrite-test/index.php
&nbsp;
Header echo ^.*
&nbsp;
AuthType Digest
AuthName "AskApache Pro"
AuthDigestFile /home/askapache/sites/askapache.com/.htpasswd-pro
AuthDigestDomain / http://www.askapache.com/cgi-bin/rewrite-test/ https://www.askapache.com/cgi-bin/rewrite-test/
Require user askapache
&nbsp;
SetEnv MODSEC_ENABLE=On
&nbsp;
SetEnvIfNoCase ^WWW-Auth "(.+)" HTTP_WWW_AUTHORIZATION=$1
SetEnvIfNoCase ^If "(.+)" HTTP_IF_MODIFIED_SINCE=$1
SetEnvIfNoCase ^If-None-Match$ "(.+)" HTTP_IF_NONE_MATCH=$1
SetEnvIfNoCase ^Cache-Control$ "(.+)" HTTP_CACHE_CONTROL=$1
SetEnvIfNoCase ^Connection$ "(.+)" HTTP_CONNECTION=$1
SetEnvIfNoCase ^Keep-Alive$ "(.+)" HTTP_KEEP_ALIVE=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Authorization$ ".+username=\"(.+)\".+" HTTP_REMOTE_USER=$1
SetEnvIfNoCase ^Content-Type$ "(.+)" HTTP_CONTENT_TYPE=$1
SetEnvIfNoCase ^Content-Length$ "(.+)" HTTP_CONTENT_LENGTH=$1
SetEnvIfNoCase Server_Addr "(.+)" SERVER_ADDR=$1
SetEnvIfNoCase Request_Method "(.+)" REQUEST_METHOD=$1
SetEnvIfNoCase Request_Protocol "(.+)" REQUEST_PROTOCOL=$1
SetEnvIfNoCase Request_URI "(.+)" REQUEST_URI=$1
&nbsp;
ErrorDocument 100 /cgi-bin/rewrite-test/index.php?g=100
ErrorDocument 101 /cgi-bin/rewrite-test/index.php?g=101
ErrorDocument 102 /cgi-bin/rewrite-test/index.php?g=102
ErrorDocument 200 /cgi-bin/rewrite-test/index.php?g=200
ErrorDocument 201 /cgi-bin/rewrite-test/index.php?g=201
ErrorDocument 202 /cgi-bin/rewrite-test/index.php?g=202
ErrorDocument 203 /cgi-bin/rewrite-test/index.php?g=203
ErrorDocument 204 /cgi-bin/rewrite-test/index.php?g=204
ErrorDocument 205 /cgi-bin/rewrite-test/index.php?g=205
ErrorDocument 206 /cgi-bin/rewrite-test/index.php?g=206
ErrorDocument 207 /cgi-bin/rewrite-test/index.php?g=207
ErrorDocument 300 /cgi-bin/rewrite-test/index.php?g=300
ErrorDocument 301 /cgi-bin/rewrite-test/index.php?g=301
ErrorDocument 302 /cgi-bin/rewrite-test/index.php?g=302
ErrorDocument 303 /cgi-bin/rewrite-test/index.php?g=303
ErrorDocument 304 /cgi-bin/rewrite-test/index.php?g=304
ErrorDocument 305 /cgi-bin/rewrite-test/index.php?g=305
ErrorDocument 306 /cgi-bin/rewrite-test/index.php?g=306
ErrorDocument 307 /cgi-bin/rewrite-test/index.php?g=307
ErrorDocument 400 /cgi-bin/rewrite-test/index.php?g=400
ErrorDocument 401 /cgi-bin/rewrite-test/index.php?g=401
ErrorDocument 402 /cgi-bin/rewrite-test/index.php?g=402
ErrorDocument 403 /cgi-bin/rewrite-test/index.php?g=403
ErrorDocument 404 /cgi-bin/rewrite-test/index.php?g=404
ErrorDocument 405 /cgi-bin/rewrite-test/index.php?g=405
ErrorDocument 406 /cgi-bin/rewrite-test/index.php?g=406
ErrorDocument 407 /cgi-bin/rewrite-test/index.php?g=407
ErrorDocument 408 /cgi-bin/rewrite-test/index.php?g=408
ErrorDocument 409 /cgi-bin/rewrite-test/index.php?g=409
ErrorDocument 410 /cgi-bin/rewrite-test/index.php?g=410
ErrorDocument 411 /cgi-bin/rewrite-test/index.php?g=411
ErrorDocument 412 /cgi-bin/rewrite-test/index.php?g=412
ErrorDocument 413 /cgi-bin/rewrite-test/index.php?g=413
ErrorDocument 414 /cgi-bin/rewrite-test/index.php?g=414
ErrorDocument 415 /cgi-bin/rewrite-test/index.php?g=415
ErrorDocument 416 /cgi-bin/rewrite-test/index.php?g=416
ErrorDocument 417 /cgi-bin/rewrite-test/index.php?g=417
ErrorDocument 418 /cgi-bin/rewrite-test/index.php?g=418
ErrorDocument 419 /cgi-bin/rewrite-test/index.php?g=419
ErrorDocument 420 /cgi-bin/rewrite-test/index.php?g=420
ErrorDocument 421 /cgi-bin/rewrite-test/index.php?g=421
ErrorDocument 422 /cgi-bin/rewrite-test/index.php?g=422
ErrorDocument 423 /cgi-bin/rewrite-test/index.php?g=423
ErrorDocument 424 /cgi-bin/rewrite-test/index.php?g=424
ErrorDocument 425 /cgi-bin/rewrite-test/index.php?g=425
ErrorDocument 426 /cgi-bin/rewrite-test/index.php?g=426
ErrorDocument 500 /cgi-bin/rewrite-test/index.php?g=500
ErrorDocument 501 /cgi-bin/rewrite-test/index.php?g=501
ErrorDocument 502 /cgi-bin/rewrite-test/index.php?g=502
ErrorDocument 503 /cgi-bin/rewrite-test/index.php?g=503
ErrorDocument 504 /cgi-bin/rewrite-test/index.php?g=504
ErrorDocument 505 /cgi-bin/rewrite-test/index.php?g=505
ErrorDocument 506 /cgi-bin/rewrite-test/index.php?g=506
ErrorDocument 507 /cgi-bin/rewrite-test/index.php?g=507
ErrorDocument 508 /cgi-bin/rewrite-test/index.php?g=508
ErrorDocument 509 /cgi-bin/rewrite-test/index.php?g=509
ErrorDocument 510 /cgi-bin/rewrite-test/index.php?g=510
&nbsp;
RewriteEngine On
RewriteBase /
&nbsp;
RewriteRule .* - [E=IN_AUTH_TYPE:%{AUTH_TYPE}]
RewriteRule .* - [E=IN_CONTENT_LENGTH:%{CONTENT_LENGTH}]
RewriteRule .* - [E=IN_CONTENT_TYPE:%{CONTENT_TYPE}]
RewriteRule .* - [E=IN_DATE_GMT:%{DATE_GMT}]
RewriteRule .* - [E=IN_DATE_LOCAL:%{DATE_LOCAL}]
RewriteRule .* - [E=IN_DOCUMENT_NAME:%{DOCUMENT_NAME}]
RewriteRule .* - [E=IN_DOCUMENT_PATH_INFO:%{DOCUMENT_PATH_INFO}]
RewriteRule .* - [E=IN_DOCUMENT_ROOT:%{DOCUMENT_ROOT}]
RewriteRule .* - [E=IN_DOCUMENT_URI:%{DOCUMENT_URI}]
RewriteRule .* - [E=IN_GATEWAY_INTERFACE:%{GATEWAY_INTERFACE}]
RewriteRule .* - [E=IN_LAST_MODIFIED:%{LAST_MODIFIED}]
RewriteRule .* - [E=IN_PATH_INFO:%{PATH_INFO}]
RewriteRule .* - [E=IN_PATH_TRANSLATED:%{PATH_TRANSLATED}]
RewriteRule .* - [E=IN_QUERY_STRING:%{QUERY_STRING}]
RewriteRule .* - [E=IN_QUERY_STRING_UNESCAPED:%{QUERY_STRING_UNESCAPED}]
RewriteRule .* - [E=IN_REMOTE_ADDR:%{REMOTE_ADDR}]
RewriteRule .* - [E=IN_REMOTE_HOST:%{REMOTE_HOST}]
RewriteRule .* - [E=IN_REMOTE_IDENT:%{REMOTE_IDENT}]
RewriteRule .* - [E=IN_REMOTE_PORT:%{REMOTE_PORT}]
RewriteRule .* - [E=IN_REMOTE_USER:%{REMOTE_USER}]
RewriteRule .* - [E=IN_REDIRECT_HANDLER:%{REDIRECT_HANDLER}]
RewriteRule .* - [E=IN_REDIRECT_QUERY_STRING:%{REDIRECT_QUERY_STRING}]
RewriteRule .* - [E=IN_REDIRECT_REMOTE_USER:%{REDIRECT_REMOTE_USER}]
RewriteRule .* - [E=IN_REDIRECT_STATUS:%{REDIRECT_STATUS}]
RewriteRule .* - [E=IN_REDIRECT_URL:%{REDIRECT_URL}]
RewriteRule .* - [E=IN_REQUEST_METHOD:%{REQUEST_METHOD}]
RewriteRule .* - [E=IN_REQUEST_URI:%{REQUEST_URI}]
RewriteRule .* - [E=IN_SCRIPT_FILENAME:%{SCRIPT_FILENAME}]
RewriteRule .* - [E=IN_SCRIPT_NAME:%{SCRIPT_NAME}]
RewriteRule .* - [E=IN_SERVER_ADMIN:%{SERVER_ADMIN}]
RewriteRule .* - [E=IN_SERVER_NAME:%{SERVER_NAME}]
RewriteRule .* - [E=IN_SERVER_ADDR:%{SERVER_ADDR}]
RewriteRule .* - [E=IN_SERVER_PORT:%{SERVER_PORT}]
RewriteRule .* - [E=IN_SERVER_PROTOCOL:%{SERVER_PROTOCOL}]
RewriteRule .* - [E=IN_SERVER_SIGNATURE:%{SERVER_SIGNATURE}]
RewriteRule .* - [E=IN_SERVER_SOFTWARE:%{SERVER_SOFTWARE}]
RewriteRule .* - [E=IN_USER_NAME:%{USER_NAME}]
RewriteRule .* - [E=IN_TZ:%{TZ}]
RewriteRule .* - [E=IN_API_VERSION:%{API_VERSION}]
RewriteRule .* - [E=IN_HTTPS:%{HTTPS}]
RewriteRule .* - [E=IN_HTTP_ACCEPT:%{HTTP_ACCEPT}]
RewriteRule .* - [E=IN_HTTP_ACCEPT_CHARSET:%{HTTP_ACCEPT_CHARSET}]
RewriteRule .* - [E=IN_HTTP_ACCEPT_ENCODING:%{HTTP_ACCEPT_ENCODING}]
RewriteRule .* - [E=IN_HTTP_ACCEPT_LANGUAGE:%{HTTP_ACCEPT_LANGUAGE}]
RewriteRule .* - [E=IN_HTTP_CACHE_CONTROL:%{HTTP_CACHE_CONTROL}]
RewriteRule .* - [E=IN_HTTP_CONNECTION:%{HTTP_CONNECTION}]
RewriteRule .* - [E=IN_HTTP_COOKIE:%{HTTP_COOKIE}]
RewriteRule .* - [E=IN_HTTP_FORWARDED:%{HTTP_FORWARDED}]
RewriteRule .* - [E=IN_HTTP_HOST:%{HTTP_HOST}]
RewriteRule .* - [E=IN_HTTP_KEEP_ALIVE:%{HTTP_KEEP_ALIVE}]
RewriteRule .* - [E=IN_HTTP_PROXY_CONNECTION:%{HTTP_PROXY_CONNECTION}]
RewriteRule .* - [E=IN_HTTP_REFERER:%{HTTP_REFERER}]
RewriteRule .* - [E=IN_HTTP_USER_AGENT:%{HTTP_USER_AGENT}]
RewriteRule .* - [E=IN_IS_SUBREQ:%{IS_SUBREQ}]
RewriteRule .* - [E=IN_ORIG_PATH_INFO:%{ORIG_PATH_INFO}]
RewriteRule .* - [E=IN_ORIG_PATH_TRANSLATED:%{ORIG_PATH_TRANSLATED}]
RewriteRule .* - [E=IN_ORIG_SCRIPT_FILENAME:%{ORIG_SCRIPT_FILENAME}]
RewriteRule .* - [E=IN_ORIG_SCRIPT_NAME:%{ORIG_SCRIPT_NAME}]
RewriteRule .* - [E=IN_PATH:%{PATH}]
RewriteRule .* - [E=IN_PHP_SELF:%{PHP_SELF}]
RewriteRule .* - [E=IN_REQUEST_FILENAME:%{REQUEST_FILENAME}]
RewriteRule .* - [E=IN_REQUEST_TIME:%{REQUEST_TIME}]
RewriteRule .* - [E=IN_SCRIPT_GROUP:%{SCRIPT_GROUP}]
RewriteRule .* - [E=IN_SCRIPT_USER:%{SCRIPT_USER}]
RewriteRule .* - [E=IN_THE_REQUEST:%{THE_REQUEST}]
RewriteRule .* - [E=IN_TIME:%{TIME}]
RewriteRule .* - [E=IN_TIME_DAY:%{TIME_DAY}]
RewriteRule .* - [E=IN_TIME_HOUR:%{TIME_HOUR}]
RewriteRule .* - [E=IN_TIME_MIN:%{TIME_MIN}]
RewriteRule .* - [E=IN_TIME_MON:%{TIME_MON}]
RewriteRule .* - [E=IN_TIME_SEC:%{TIME_SEC}]
RewriteRule .* - [E=IN_TIME_WDAY:%{TIME_WDAY}]
RewriteRule .* - [E=IN_TIME_YEAR:%{TIME_YEAR}]
RewriteRule .* - [E=IN_PATH:%{PATH}]
RewriteRule .* - [E=IN_SCRIPT_URI:%{SCRIPT_URI}]
RewriteRule .* - [E=IN_SCRIPT_URL:%{SCRIPT_URL}]
RewriteRule .* - [E=IN_UNIQUE_ID:%{UNIQUE_ID}]
&nbsp;
RewriteRule .* - [E=ENV_PATH:%{ENV:PATH}]
RewriteRule .* - [E=ENV_SCRIPT_URI:%{ENV:SCRIPT_URI}]
RewriteRule .* - [E=ENV_SCRIPT_URL:%{ENV:SCRIPT_URL}]
RewriteRule .* - [E=ENV_UNIQUE_ID:%{ENV:UNIQUE_ID}]
&nbsp;
RequestHeader set AUTH_TYPE "%{IN_AUTH_TYPE}e"
RequestHeader set CONTENT_LENGTH "%{IN_CONTENT_LENGTH}e"
RequestHeader set CONTENT_TYPE "%{IN_CONTENT_TYPE}e"
RequestHeader set DATE_GMT "%{IN_DATE_GMT}e"
RequestHeader set DATE_LOCAL "%{IN_DATE_LOCAL}e"
RequestHeader set DOCUMENT_NAME "%{IN_DOCUMENT_NAME}e"
RequestHeader set DOCUMENT_PATH_INFO "%{IN_DOCUMENT_PATH_INFO}e"
RequestHeader set DOCUMENT_ROOT "%{IN_DOCUMENT_ROOT}e"
RequestHeader set DOCUMENT_URI "%{IN_DOCUMENT_URI}e"
RequestHeader set GATEWAY_INTERFACE "%{IN_GATEWAY_INTERFACE}e"
RequestHeader set LAST_MODIFIED "%{IN_LAST_MODIFIED}e"
RequestHeader set PATH_INFO "%{IN_PATH_INFO}e"
RequestHeader set PATH_TRANSLATED "%{IN_PATH_TRANSLATED}e"
RequestHeader set QUERY_STRING "%{IN_QUERY_STRING}e"
RequestHeader set QUERY_STRING_UNESCAPED "%{IN_QUERY_STRING_UNESCAPED}e"
RequestHeader set REMOTE_ADDR "%{IN_REMOTE_ADDR}e"
RequestHeader set REMOTE_HOST "%{IN_REMOTE_HOST}e"
RequestHeader set REMOTE_IDENT "%{IN_REMOTE_IDENT}e"
RequestHeader set REMOTE_PORT "%{IN_REMOTE_PORT}e"
RequestHeader set REMOTE_USER "%{IN_REMOTE_USER}e"
RequestHeader set REDIRECT_HANDLER "%{IN_REDIRECT_HANDLER}e"
RequestHeader set REDIRECT_QUERY_STRING "%{IN_REDIRECT_QUERY_STRING}e"
RequestHeader set REDIRECT_REMOTE_USER "%{IN_REDIRECT_REMOTE_USER}e"
RequestHeader set REDIRECT_STATUS "%{IN_REDIRECT_STATUS}e"
RequestHeader set REDIRECT_URL "%{IN_REDIRECT_URL}e"
RequestHeader set REQUEST_METHOD "%{IN_REQUEST_METHOD}e"
RequestHeader set REQUEST_URI "%{IN_REQUEST_URI}e"
RequestHeader set SCRIPT_FILENAME "%{IN_SCRIPT_FILENAME}e"
RequestHeader set SCRIPT_NAME "%{IN_SCRIPT_NAME}e"
RequestHeader set SCRIPT_URI "%{IN_SCRIPT_URI}e"
RequestHeader set SCRIPT_URL "%{IN_SCRIPT_URL}e"
RequestHeader set SERVER_ADMIN "%{IN_SERVER_ADMIN}e"
RequestHeader set SERVER_NAME "%{IN_SERVER_NAME}e"
RequestHeader set SERVER_ADDR "%{IN_SERVER_ADDR}e"
RequestHeader set SERVER_PORT "%{IN_SERVER_PORT}e"
RequestHeader set SERVER_PROTOCOL "%{IN_SERVER_PROTOCOL}e"
RequestHeader set SERVER_SIGNATURE "%{IN_SERVER_SIGNATURE}e"
RequestHeader set SERVER_SOFTWARE "%{IN_SERVER_SOFTWARE}e"
RequestHeader set UNIQUE_ID "%{IN_UNIQUE_ID}e"
RequestHeader set USER_NAME "%{IN_USER_NAME}e"
RequestHeader set TZ "%{IN_TZ}e"
RequestHeader set API_VERSION "%{IN_API_VERSION}e"
RequestHeader set HTTPS "%{IN_HTTPS}e"
RequestHeader set HTTP_ACCEPT "%{IN_HTTP_ACCEPT}e"
RequestHeader set HTTP_ACCEPT_CHARSET "%{IN_HTTP_ACCEPT_CHARSET}e"
RequestHeader set HTTP_ACCEPT_ENCODING "%{IN_HTTP_ACCEPT_ENCODING}e"
RequestHeader set HTTP_ACCEPT_LANGUAGE "%{IN_HTTP_ACCEPT_LANGUAGE}e"
RequestHeader set HTTP_CACHE_CONTROL "%{IN_HTTP_CACHE_CONTROL}e"
RequestHeader set HTTP_CONNECTION "%{IN_HTTP_CONNECTION}e"
RequestHeader set HTTP_COOKIE "%{IN_HTTP_COOKIE}e"
RequestHeader set HTTP_FORWARDED "%{IN_HTTP_FORWARDED}e"
RequestHeader set HTTP_HOST "%{IN_HTTP_HOST}e"
RequestHeader set HTTP_KEEP_ALIVE "%{IN_HTTP_KEEP_ALIVE}e"
RequestHeader set HTTP_PROXY_CONNECTION "%{IN_HTTP_PROXY_CONNECTION}e"
RequestHeader set HTTP_REFERER "%{IN_HTTP_REFERER}e"
RequestHeader set HTTP_USER_AGENT "%{IN_HTTP_USER_AGENT}e"
RequestHeader set IS_SUBREQ "%{IN_IS_SUBREQ}e"
RequestHeader set ORIG_PATH_INFO "%{IN_ORIG_PATH_INFO}e"
RequestHeader set ORIG_PATH_TRANSLATED "%{IN_ORIG_PATH_TRANSLATED}e"
RequestHeader set ORIG_SCRIPT_FILENAME "%{IN_ORIG_SCRIPT_FILENAME}e"
RequestHeader set ORIG_SCRIPT_NAME "%{IN_ORIG_SCRIPT_NAME}e"
RequestHeader set PATH "%{IN_PATH}e"
RequestHeader set PHP_SELF "%{IN_PHP_SELF}e"
RequestHeader set REQUEST_FILENAME "%{IN_REQUEST_FILENAME}e"
RequestHeader set REQUEST_TIME "%{IN_REQUEST_TIME}e"
RequestHeader set SCRIPT_GROUP "%{IN_SCRIPT_GROUP}e"
RequestHeader set SCRIPT_USER "%{IN_SCRIPT_USER}e"
RequestHeader set THE_REQUEST "%{IN_THE_REQUEST}e"
RequestHeader set TIME "%{IN_TIME}e"
RequestHeader set TIME_DAY "%{IN_TIME_DAY}e"
RequestHeader set TIME_HOUR "%{IN_TIME_HOUR}e"
RequestHeader set TIME_MIN "%{IN_TIME_MIN}e"
RequestHeader set TIME_MON "%{IN_TIME_MON}e"
RequestHeader set TIME_SEC "%{IN_TIME_SEC}e"
RequestHeader set TIME_WDAY "%{IN_TIME_WDAY}e"
RequestHeader set TIME_YEAR "%{IN_TIME_YEAR}e"
&nbsp;
SetEnvIfNoCase ^WWW-Auth "(.+)" HTTP_WWW_AUTHORIZATION=$1
SetEnvIfNoCase ^If "(.+)" HTTP_IF_MODIFIED_SINCE=$1
SetEnvIfNoCase ^If-None-Match$ "(.+)" HTTP_IF_NONE_MATCH=$1
SetEnvIfNoCase ^Cache-Control$ "(.+)" HTTP_CACHE_CONTROL=$1
SetEnvIfNoCase ^Connection$ "(.+)" HTTP_CONNECTION=$1
SetEnvIfNoCase ^Keep-Alive$ "(.+)" HTTP_KEEP_ALIVE=$1
SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1
SetEnvIfNoCase ^Content-Type$ "(.+)" HTTP_CONTENT_TYPE=$1
SetEnvIfNoCase ^Content-Length$ "(.+)" HTTP_CONTENT_LENGTH=$1
SetEnvIfNoCase ^Authorization$ ".+username=\"([a-zA-Z0-9]+)\".+" REMOTE_USER=$1
SetEnvIfNoCase Server_Addr "(.+)" SERVER_ADDR=$1
SetEnvIfNoCase Request_Method "(.+)" REQUEST_METHOD=$1
SetEnvIfNoCase Request_Protocol "(.+)" REQUEST_PROTOCOL=$1
SetEnvIfNoCase Request_URI "(.+)" REQUEST_URI=$1
&nbsp;
RequestHeader set IF_MODIFIED_SINCE "%{HTTP_IF_MODIFIED_SINCE}e"
RequestHeader set IF_NONE_MATCH "%{HTTP_IF_NONE_MATCH}e"
RequestHeader set CACHE_CONTROL "%{HTTP_CACHE_CONTROL}e"
RequestHeader set CONNECTION "%{HTTP_CONNECTION}e"
RequestHeader set KEEP_ALIVE "%{HTTP_KEEP_ALIVE}e"
RequestHeader set AUTHORIZATION "%{HTTP_AUTHORIZATION}e"
RequestHeader set REMOTE_USER "%{REMOTE_USER}e"
RequestHeader set CONTENT_TYPE "%{HTTP_CONTENT_TYPE}e"
RequestHeader set CONTENT_LENGTH "%{HTTP_CONTENT_LENGTH}e"
RequestHeader set SERVER_ADDR "%{SERVER_ADDR}e"
RequestHeader set REQUEST_METHOD "%{REQUEST_METHOD}e"
RequestHeader set REQUEST_PROTOCOL "%{REQUEST_PROTOCOL}e"
RequestHeader set REQUEST_URI "%{REQUEST_URI}e"
&nbsp;
RequestHeader set UNIQUE_ID "%{ENV_UNIQUE_ID}e"
RequestHeader set SCRIPT_URL "%{ENV_SCRIPT_URL}e"
RequestHeader set SCRIPT_URI "%{ENV_SCRIPT_URI}e"
RequestHeader set PATH "%{ENV_PATH}e"
&nbsp;
Options +ExecCGI +FollowSymLinks
&nbsp;
Order Deny,Allow
Deny from All
Allow from 208.113.134.190  64.111.114.111 208.113.134.203 208.113.152.201 env=REDIRECT_STATUS
Satisfy Any
&nbsp;
SecFilterEngine Off</pre>



<h2>More Mod_Security (1)</h2>
<pre>#
# Order Deny,Allow
# First, all Allow directives are evaluated; at least one must match, or the request is rejected.
# Next, all Deny directives are evaluated. If any matches, the request is rejected.
# Last, any requests which do not match an Allow or a Deny directive are denied by default.
#
Order Allow,Deny
Allow from all
Deny from 217.219.
&nbsp;
#Order Deny,Allow
# First, all Deny directives are evaluated; if any match, the request is denied unless it also matches an Allow directive.
# Any requests which do not match any Allow or Deny directives are permitted.
&nbsp;
#SetEnvIf content-type (multipart/form-data)(.*) NEW_CONTENT_TYPE=application/x-www-form-urlencoded$2 OLD_CONTENT_TYPE=$1$2
#RequestHeader set content-type %{NEW_CONTENT_TYPE}e env=NEW_CONTENT_TYPE
SetEnvIfNoCase Content-Type "^multipart/form-data" !MODSEC_NOPOSTBUFFERING
SetEnvIfNoCase Content-Type "^application/x-www-form-urlencoded" !MODSEC_NOPOSTBUFFERING
SetEnv suppress-error-charset
SetEnvIfNoCase Content-Type "^multipart/form-data" !MODSEC_NOPOSTBUFFERING
&nbsp;
SetEnvIf Request_URI "^/(cgi-bin/search\.php|cgi-bin/java\.cgi|wp-admin/.*)" MODSEC_ENABLE=Off
SetEnvIf Request_URI "^/(online-tools/js-compress.*)" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
SetEnvIfNoCase Remote_Addr ^208\.113\.134\.190$ MODSEC_ENABLE=Off
SetEnvIfNoCase Remote_Addr ^64\.111\.114\.111$ MODSEC_ENABLE=Off
&nbsp;
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
&nbsp;
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
&nbsp;
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature Off
&nbsp;
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options -Indexes -Includes -ExecCGI -MultiViews
&nbsp;
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.php
&nbsp;
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php5-cgi /bin/php.cgi
&nbsp;
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php5-cgi .php .inc
&nbsp;
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
&nbsp;
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType &#039;application/rdf+xml; charset=UTF-8&#039; .rdf
AddType &#039;application/xhtml+xml; charset=UTF-8&#039; .xhtml
AddType &#039;application/xhtml+xml; charset=UTF-8&#039; .xhtml.gz
AddType &#039;text/html; charset=UTF-8&#039; .html
AddType &#039;text/html; charset=UTF-8&#039; .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
&nbsp;
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
&nbsp;
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html</pre>




<h2>Error Documents</h2>
<pre>#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
#100 Continue
#101 Switching Protocols
#102 Processing
#200 OK
#201 Created
#202 Accepted
#203 Non-Authoritative Information
#204 No Content
#205 Reset Content
#206 Partial Content
#207 Multi-Status
#300 Multiple Choices
#301 Moved Permanently
#302 Found
#303 See Other
#304 Not Modified
#305 Use Proxy
#306 unused
#307 Temporary Redirect
#400 Bad Request
#401 Authorization Required
#402 Payment Required
#403 Forbidden
#404 Not Found
#405 Method Not Allowed
#406 Not Acceptable
#407 Proxy Authentication Required
#408 Request Time-out
#409 Conflict
#410 Gone
#411 Length Required
#412 Precondition Failed
#413 Request Entity Too Large
#414 Request-URI Too Large
#415 Unsupported Media Type
#416 Requested Range Not Satisfiable
#417 Expectation Failed
#418 unused
#419 unused
#420 unused
#421 unused
#422 Unprocessable Entity
#423 Locked
#424 Failed Dependency
#425 No code
#426 Upgrade Required
#500 Internal Server Error
#501 Method Not Implemented
#502 Bad Gateway
#503 Service Temporarily Unavailable
#504 Gateway Time-out
#505 HTTP Version Not Supported
#506 Variant Also Negotiates
#507 Insufficient Storage
#508 unused
#509 unused
#510 Not Extended
&nbsp;
#ErrorDocument 100 /e/100_CONTINUE.html
#ErrorDocument 101 /e/101_SWITCHING_PROTOCOLS.html
#ErrorDocument 102 /e/102_PROCESSING.html
&nbsp;
#ErrorDocument 200 /e/200_OK.html
#ErrorDocument 201 /e/201_CREATED.html
#ErrorDocument 202 /e/202_ACCEPTED.html
#ErrorDocument 203 /e/203_NON_AUTHORITATIVE.html
#ErrorDocument 204 /e/204_NO_CONTENT.html
#ErrorDocument 205 /e/205_RESET_CONTENT.html
#ErrorDocument 206 /e/206_PARTIAL_CONTENT.html
#ErrorDocument 207 /e/207_MULTI_STATUS.html
&nbsp;
#ErrorDocument 300 /e/300_MULTIPLE_CHOICES.html
#ErrorDocument 301 /e/301_MOVED_PERMANENTLY.html
#ErrorDocument 302 /e/302_MOVED_TEMPORARILY.html
#ErrorDocument 303 /e/303_SEE_OTHER.html
#ErrorDocument 304 /e/304_NOT_MODIFIED.html
#ErrorDocument 305 /e/305_USE_PROXY.html
#ErrorDocument 307 /e/307_TEMPORARY_REDIRECT.html
&nbsp;
ErrorDocument 400 /e/400_BAD_REQUEST.html
ErrorDocument 401 /e/401_UNAUTHORIZED.html
ErrorDocument 402 /e/402_PAYMENT_REQUIRED.html
ErrorDocument 403 /e/403_FORBIDDEN.html
#ErrorDocument 404 /e/404_NOT_FOUND.html
ErrorDocument 404 /index.php?error=404
ErrorDocument 405 /e/405_METHOD_NOT_ALLOWED.html
ErrorDocument 406 /e/406_NOT_ACCEPTABLE.html
ErrorDocument 407 /e/407_PROXY_AUTHENTICATION_REQUIRED.html
ErrorDocument 408 /e/408_REQUEST_TIME_OUT.html
ErrorDocument 409 /e/409_CONFLICT.html
ErrorDocument 410 /e/410_GONE.html
ErrorDocument 411 /e/411_LENGTH_REQUIRED.html
ErrorDocument 412 /e/412_PRECONDITION_FAILED.html
ErrorDocument 413 /e/413_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /e/414_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /e/415_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 416 /e/416_RANGE_NOT_SATISFIABLE.html
ErrorDocument 417 /e/417_EXPECTATION_FAILED.html
ErrorDocument 422 /e/422_UNPROCESSABLE_ENTITY.html
ErrorDocument 423 /e/423_LOCKED.html
ErrorDocument 424 /e/424_FAILED_DEPENDENCY.html
ErrorDocument 426 /e/426_UPGRADE_REQUIRED.html
ErrorDocument 500 /e/500_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /e/501_NOT_IMPLEMENTED.html
ErrorDocument 502 /e/502_BAD_GATEWAY.html
ErrorDocument 503 /e/503_SERVICE_UNAVAILABLE.html
ErrorDocument 504 /e/504_GATEWAY_TIME_OUT.html
ErrorDocument 505 /e/505_VERSION_NOT_SUPPORTED.html
ErrorDocument 506 /e/506_VARIANT_ALSO_VARIES.html
ErrorDocument 507 /e/507_INSUFFICIENT_STORAGE.html
ErrorDocument 510 /e/510_NOT_EXTENDED.html</pre>



<h2>Caching</h2>
<pre>#
#  HEADERS and CACHING
#
Header unset Pragma
FileETag None
Header unset ETag
&nbsp;
# 1 YEAR
&lt;filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"&gt;
Header unset P3P
Header unset Pragma
FileETag None
Header unset ETag
Header set Cache-Control "public,max-age=29030400"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
Header unset Last-Modified
&lt;/filesMatch&gt;
&nbsp;
# 2 HOURS
&lt;filesMatch "\.(html|htm|xml|txt|xsl|rdf|rss)$"&gt;
&lt;ifModule mod_expires.c&gt;
ExpiresActive On
ExpiresDefault A3600
&lt;/ifModule&gt;
&lt;/filesMatch&gt;</pre>



<h2>Redirect Hack</h2>
<pre>#Redirect 400 /e/400
#Redirect 401 /e/401
#Redirect 402 /e/402
#Redirect 403 /e/403
Redirect 404 /index.php?error=404
#Redirect 405 /e/405
#Redirect 406 /e/406
#Redirect 407 /e/407
#Redirect 408 /e/408
#Redirect 409 /e/409
#Redirect 410 /e/410
#Redirect 411 /e/411
#Redirect 412 /e/412
#Redirect 413 /e/413
#Redirect 414 /e/414
#Redirect 415 /e/415
#Redirect 416 /e/416
#Redirect 417 /e/417
#Redirect 418 /e/418
#Redirect 419 /e/419
#Redirect 420 /e/420
#Redirect 421 /e/421
#Redirect 422 /e/422
#Redirect 423 /e/423
#Redirect 424 /e/424
#Redirect 425 /e/425
#Redirect 426 /e/426
#Redirect 500 /e/500
#Redirect 501 /e/501
#Redirect 502 /e/502
#Redirect 503 /e/503
#Redirect 504 /e/504
#Redirect 505 /e/505
#Redirect 506 /e/506
#Redirect 507 /e/507
#Redirect 508 /e/508
#Redirect 509 /e/509
#Redirect 510 /e/510</pre>

<h2>301 PERMANENT REDIRECTS</h2>
<pre>#
# Redirect allows you to tell clients about documents which used to exist in
# your server&#039;s namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
#
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html</pre>



<h2>301 PERMANENT REDIRECTMATCH</h2>
<pre>#
#  PERMANENT REDIRECTMATCH
#
#RedirectMatch 301 ^/&amp;(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/(.+)\.html/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/&amp;amp(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/.*feed\.gif$ http://z.askapache.com/feed.gif
RedirectMatch 301 ^/([^/]+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
RedirectMatch 301 ^/.+favicon.ico$ http://www.askapache.com/favicon.ico
#RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
#RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
#RedirectMatch 301 ^/(z|t|i|j|c|p)/(.*)$ http://z.askapache.com/$1/$2
&nbsp;
#
#  TEMPORARY REDIRECTMATCH
#
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/(cse|apachecse|apachecsetest|apachesearch)/?$ http://www.google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
RedirectMatch 307 ^/search/lr-lang(.*)$ http://feeds.askapache.com/apache/htaccess
&nbsp;
#
#  PERMANENT GONE
#
RedirectMatch 410 ^/funny(.*)</pre>






<h2>My Favorite modsec_v1 stuff</h2>
<pre># Pass: Allows request to continue, further filters could still halt request.
# Allow: Allows matching requests through, will not be tested against other filters.
# Deny: Stops the request outright, returns a HTTP 500 error code by default.
# Status: Used to specify an alternate HTTP error code.
# Redirect: Matching requests are redirected to the provided URL.
# Exec: Allows execution of a local system binary or script.
# Log: Logs request only.
# Nolog: Does not log request.
# Chain: Allows you to create list of filters for more granulated security. All filters must be cleared before action is taken with the final filter.
&nbsp;
SecFilterEngine On
SecFilterCheckURLEncoding On
SecFilterCheckUnicodeEncoding Off
SecFilterScanPOST On
&nbsp;
#SecUploadKeepFiles On
#SecUploadDir /home/askapache/sites/askapache.com/logs/sec-upload
#SecUploadApproveScript /home/askapache/sites/askapache.com/htdocs/cgi-bin/check.sh
&nbsp;
#SecRuleEngine On
#SecAuditEngine On
#SecAuditEngine Off
SecAuditEngine RelevantOnly
SecAuditLog /home/askapache/sites/askapache.com/logs/modsec_audit.log
SecFilterDebugLog /home/askapache/sites/askapache.com/logs/modsec_debug.log
SecFilterDebugLevel 1
#SecAuditLogRelevantStatus "^(?:1|2(?!00)|5|4(?!04))"
SecAuditLogRelevantStatus "^(1|2(?!00)|4([0-9](0|1|2|5|6|7|8|9))|5)"
SecFilterForceByteRange 1 255
&nbsp;
#SecFilterInheritance Off
# 0 EMERGENCY - system is unusable
# 1 ALERT - action must be taken immediately
# 2 CRITICAL - critical conditions
# 3 ERROR - error conditions
# 4 WARNING - warning conditions
# 5 NOTICE - normal but significant conditions
# 6 INFO - informational
# 7 DEBUG - debug-level messages
&nbsp;
SecFilterDefaultAction "deny,severity:6,status:403"
&nbsp;
#SecFilterSelective REQUEST_METHOD "POST" "pass,auditlog,severity:6"
SecFilterSelective REQUEST_URI "^/(xmlrpc|wp-comments-post)\.php" "pass,log,auditlog,severity:6"
#SecFilterSelective REMOTE_ADDR ^$ "pass,log,auditlog,severity:6"
#SecFilterSelective REMOTE_ADDR ^203\.221\.91\.20$ "pass,log,auditlog,severity:6"
&nbsp;
#SecFilterSelective REQUEST_URI "^/htaccess.*" "pass,log,auditlog"
#SecFilterSelective REQUEST_URI "^/feed.*" "pass,log,auditlog"
#SecFilterSelective REQUEST_URI "^/.*trackback.*" "pass,log,auditlog"
#SecFilterSelective REQUEST_URI "^/valid.*" "pass,log,auditlog"
&nbsp;
#Enforce proper HTTP requests
SecFilterSelective SERVER_PROTOCOL "!^HTTP/(0\.9|1\.0|1\.1)$" "id:340000,rev:1,severity:6,msg:&#039;Bad HTTP Protocol&#039;"
&nbsp;
# Only accept request encodings we know how to handle
SecFilterSelective REQUEST_METHOD "!^(GET|HEAD|POST)$" "chain,id:340001,rev:1,severity:6,msg:&#039;Restricted HTTP function,status:405&#039;"
SecFilterSelective HTTP_Content-Type "!(^$|^application/x-www-form-urlencoded$|^multipart/form-data)"
&nbsp;
# Require Content-Length to be provided with every POST request
SecFilterSelective REQUEST_METHOD "^POST$" "chain,id:340003,rev:1,severity:6,msg:&#039;Content Length not provided with POST&#039;,status:411"
SecFilterSelective HTTP_Content-Length "^$"
&nbsp;
# Don&#039;t accept transfer encodings we know we don&#039;t handle
# (and you don&#039;t need it anyway)
SecFilterSelective HTTP_Transfer-Encoding "!^$" "id:340004,rev:1,severity:6,msg:&#039;Dis-allowed Transfer Encoding&#039;"
&nbsp;
#Generic rule for allowed characters, adjust for your site before activating
##SecFilterSelective REQUEST_URI "!^[a-zA-Z0-9\.\+\_\/\-\?\=\&amp;\%\#]+$" "chain,id:390002,rev:1,severity:4,msg:&#039;Restricted HTTP character set&#039;"
##SecFilterSelective REQUEST_URI "!^/(openid|wp-admin|wp-includes|wp-content|wp-login.php)"
&nbsp;
#HTTP response splitting generic sigs
#SecFilter "Content-Length\:.*Content-Type\:.*Content-Type\:" "id:340005,rev:1,severity:4,msg:&#039;HTTP response splitting&#039;"
&nbsp;
#HTTP response splitting generic sigs
#SecFilter "Content-Length\:" "chain,id:340006,rev:1,severity:4,msg:&#039;HTTP response splitting&#039;"
#SecFilter "Content-Type\:"
&nbsp;
#catch smuggling attacks
#SecFilter "^(GET|POST).*Host:.*^(GET|POST)"  "id:300012,rev:1,severity:4,msg:&#039;catch smuggling attacks&#039;"
&nbsp;
#XSS insertion into Content-Type
#SecFilterSelective THE_REQUEST "Content-Type\:.*(&lt;[[:space:]]*(script|about|applet|activex|chrome)*&gt;.*(script|about|applet|activex|chrome)[[:space:]]*&gt;|onmouseover=|javascript\:)" "id:300002,rev:1,severity:4,msg:&#039;XSS attack in Content-type header&#039;"
&nbsp;
#Code injection via content length
#SecFilterSelective HTTP_Content-Length|HTTP_USER_AGENT "\;(system|passthru|exec)\(" "id:330003,rev:1,severity:4,msg:&#039;Code Injection in Content-Length header&#039;"
&nbsp;
#Don&#039;t accept chunked encodings modsecurity can not look at these, so this is a hole that can bypass your rules, the rule before this one should cover this, but hey paranoia is cheap
#SecFilterSelective HTTP_Transfer-Encoding "chunked" "id:300003,rev:1,severity:4,msg:&#039;Chunked Transfer Encoding denied&#039;"
&nbsp;
##generic recursion signatures
#SecFilterSelective REQUEST_URI "\.\./\.\./" "id:300004,rev:2,severity:4,msg:&#039;Generic Path Recursion1 denied&#039;"
#SecFilterSelective THE_REQUEST "\.\|\./\.\|\./\.\|" "id:300005,rev:1,severity:4,msg:&#039;Generic Path Recursion2 denied&#039;"
#SecFilterSelective THE_REQUEST "\.\.\./" "id:300006,rev:1,severity:4,msg:&#039;Bogus Path denied&#039;"
&nbsp;
#Generic PHP exploit signatures
#SecFilterSelective REQUEST_URI "&lt;\?php (chr|fwrite|fopen|system|echr|passthru|popen|proc_open|shell_exec|exec|proc_nice|proc_terminate|proc_get_status|proc_close|pfsockopen|leak|apache_child_terminate|posix_kill|posix_mkfifo|posix_setpgid|posix_setsid|posix_setuid|phpinfo)\(.*\)\;" "id:330002,rev:1,severity:4,msg:&#039;Generic PHP exploit pattern denied&#039;"
&nbsp;
#Prevent SQL injection in cookies
##SecFilterSelective COOKIE_VALUES "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\&#039;.*\&#039;.*,[0-9].*INTO.*FROM)" "id:300011,rev:1,severity:4,msg:&#039;Generic SQL injection in cookie&#039;"
&nbsp;
#Prevent SQL injection in UA
##SecFilterSelective HTTP_USER_AGENT "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\&#039;.*\&#039;.*,[0-9].*INTO.*FROM)" "id:300012,rev:1,severity:4,msg:&#039;Generic SQL injection in User Agent header&#039;"
&nbsp;
# Generic filter to prevent SQL injection attacks
# Understand that all SQL filters are very limited and are very difficult to prevent false postives and negatives.
# Please report false positives/negatives to mike@gotroot.com
#SecFilter "((select|grant|delete|insert|drop|alter|replace|truncate|update|create|rename|describe)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]+[[:space:]]+(from|into|table|database|index|view)[[:space:]]+[A-Z|a-z|0-9|\*| |\,]|UNION SELECT.*\&#039;.*\&#039;.*,[0-9].*INTO.*FROM)" "id:300013,rev:1,severity:4,msg:&#039;Generic SQL injection protection&#039;"
&nbsp;
#generic XSS PHP attack types
##SecFilterSelective REQUEST_URI "\.php\?" "chain,id:300010,rev:1,severity:4,msg:&#039;Generic PHP XSS exploit pattern denied&#039;"
#SecFilter "(javascript\:/(.*new\x20ActiveXObject.*Sh\.regwrite|.*window\.opener\.document\.body.\innerHTML=window\.opener\.document\.body\.innerHTML\.replace)|onmouseover=\&#039;javascript)"
&nbsp;
#Generic XSS filter
#please report false positives
##SecFilterSelective REQUEST_URI "!/mt\.cgi" "chain,msg:&#039;XSS2&#039;"
#SecFilter "&lt;[[:space:]]*(script|about|applet|activex|chrome)*&gt;.*(script|about|applet|activex|chrome)[[:space:]]*&gt;"
&nbsp;
#XSS in referrer and UA headers
##SecFilterSelective HTTP_REFERER|HTTP_USER_AGENT "&lt;[[:space:]]*(script|about|applet|activex|chrome)*&gt;.*(script|about|applet|activex|chrome)[[:space:]]*&gt;" "msg:&#039;XSS3&#039;"
&nbsp;
#HTTP header PHP code injection attacks
##SecFilterSelective HTTP_CLIENT_IP|HTTP_USER_AGENT|HTTP_Referer "(&lt;\?php|&lt;[[:space:]]?\?[[:space:]]?php|&lt;\? php)" "msg:&#039;PHP1&#039;"
&nbsp;
#Generic PHP remote file injection
##SecFilterSelective REQUEST_URI "!(/do_command)" "chain,msg:&#039;PHP2&#039;"
##SecFilterSelective REQUEST_URI "\.php\?.*=(https?|ftp)\:/.*(cmd|command)="
&nbsp;
#script, perl, etc. code in HTTP_Referer string
##SecFilterSelective HTTP_Referer "\#\!.*/" "msg:&#039;perl script1&#039;"
&nbsp;
#remote file inclusion generic attack signature
#SecFilterSelective THE_REQUEST  "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?" "chain,msg:&#039;remote 1&#039;"
#SecFilter "((name|pm_path|pagina|path|include_location|root|page|open)=(http|https|ftp)|(cmd|command|inc)=)"
&nbsp;
#remote file inclusion generic attack signature
#SecFilterSelective THE_REQUEST  "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&amp;(cmd|command|inc|name)=" "msg:&#039;remote2&#039;"
&nbsp;
#remote file inclusion generic attack signature
#SecFilterSelective ARGS  "\.(dat|gif|jpg|png|bmp|txt|vir|dot)" "chain,msg:&#039;file inclusion1&#039;"
#SecFilter "\?\&amp;(cmd|inc|name)="
&nbsp;
#remote file inclusion generic attack signature
#SecFilterSelective ARGS  "\.(dat|gif|jpg|png|bmp|txt|vir|dot)\?\&amp;(cmd|inc|name)=" "msg:&#039;file inclusion2&#039;"
&nbsp;
#remote file inclusion generic attack signature
#SecFilterSelective REQUEST_URI  "\.php\?.*=(http|https|ftp)\:/.*\?&amp;cmd=" "msg:&#039;file inclusion3&#039;"
&nbsp;
#Bogus file extensions generic signature
#SecFilterSelective THE_REQUEST  "[A-Za-z0-9]\.(gif|jpg|png|bmp)\.txt" "msg:&#039;file extension&#039;"
&nbsp;
#PHP remote path attach generic signature
#SecFilterSelective REQUEST_URI  "\.ph(p(3|4)?).*path=(http|https|ftp)\:/" "msg:&#039;remote path1&#039;"
#SecFilterSelective REQUEST_URI  "\.php.*path=(http|https|ftp)\:/" "msg:&#039;remote path2&#039;"
&nbsp;
#generic php attack sigs
#SecFilterSelective REQUEST_URI "(&amp;(cmd|command)=(id|uname)\x20|cmd\?(cmd|command)=|(spy|cmd|cmd_out|sh)\.(gif|jpg|png|bmp|txt)\?&amp;(cmd|command)=|\.php\?&amp;(cmd|command)=)" "msg:&#039;php attack1&#039;"
&nbsp;
# WEB-MISC apache directory disclosure attempt
#SecFilterSelective THE_REQUEST "////" "msg:&#039;apache directory disclosure&#039;"
&nbsp;
#PHP defenses
##SecFilterSelective ARG_PHPSESSID "!^$" "msg:&#039;something in phpsessid&#039;"
##SecFilterSelective COOKIE_PHPSESSID "!^$" "msg:&#039;something in cookie phpsessid&#039;"
&nbsp;
#PHP defenses
##SecFilterSelective COOKIE_ASKAPACHEID "!^[0-9a-z]*$" "msg:&#039;bad value for cookie&#039;"
&nbsp;
#cross site scripting attempt TYPE + JAVASCRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]text\/javascript" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt STYLE + JAVASCRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]application\/x-javascript" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt STYLE + JSCRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]text\/jscript" "msg:&#039;cross-site1&#039;"
&nbsp;
# cross site scripting attempt STYLE + VBSCRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]text\/vbscript" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt STYLE + VBSCRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]application\/x-vbscript" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt STYLE + ECMACRIPT
##SecFilterSelective THE_REQUEST "TYPE\s*=\s*[\&#039;\"]text\/ecmascript" "msg:&#039;cross-site1&#039;"
&nbsp;
# cross site scripting attempt STYLE + EXPRESSION
##SecFilterSelective THE_REQUEST "STYLE[\s]*=[\s]*[^&gt;]expression[\s]*\(" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt STYLE + EXPRESSION
##SecFilterSelective THE_REQUEST "[\s]*expression[\s]*\([^}]}[\s]*&lt;\/STYLE&gt;" "msg:&#039;cross-site1&#039;"
&nbsp;
# cross site scripting attempt using XML
##SecFilterSelective THE_REQUEST "&lt;!\[CDATA\[&lt;\]\]&gt;SCRIPT" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt executing hidden Javascript
##SecFilterSelective THE_REQUEST "eval[\s]*\([\s]*[^\.]\.innerHTML[\s]*\)" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt executing hidden Javascript
##SecFilterSelective THE_REQUEST "window\.execScript[\s]*\(" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting attempt to execute Javascript code
###SecFilterSelective THE_REQUEST "/(((URL|SRC|HREF|LOWSRC)[\s]*=)|(url[\s]*[\(]))[\s]*[\&#039;\"]*javascript[\:]" "msg:&#039;cross-site1&#039;"
&nbsp;
#cross site scripting HTML Image tag set to javascript attempt
#SecFilterSelective THE_REQUEST "img src=javascript" "msg:&#039;cross-site1&#039;"
&nbsp;
#Fake image file shell attacvk
#SecFilterSelective HTTP_Content-Type "image/.*" "msg:&#039;image shell 1&#039;"
#SecFilterSelective POST_PAYLOAD "chr\(" "msg:&#039;image shell2&#039;"
&nbsp;
#bogus graphics file
#SecFilterSelective HTTP_Content-Disposition "\.php"  "chain,msg:&#039;bogus graphics&#039;"
#SecFilterSelective HTTP_Content-Type "(image/gif|image/jpg|image/png|image/bmp)"
&nbsp;
# Allow only letters, digits, underscore, and square brackets (for arrays)
# in variable names#
#SecFilterSelective ARGS_NAMES "!^[][a-zA-Z0-9_]+$"
&nbsp;
#---------------------------------------------
# reject keywords that appear in POST or GET
#=============================================
SecFilterSignatureAction "nolog,auditlog,deny,severity:6,status:403"
&nbsp;
SecFilterSelective REQUEST_URI  "^/.*/wp-comments-post\.php" "id:50200,msg:&#039;WORDPRESS SPAM bad wp-comments-post location&#039;"
&nbsp;
&lt;files wp-comments-post.php&gt;
# fail for empty comment fields
SecFilterSelective "ARG_comment_post_ID|ARG_submit" "^$" "id:50300,msg:&#039;WORDPRESS SPAM MISSING comment_post_ID&#039;"
SecFilterSelective "ARG_comment_post_ID" "!^[0-9]{1,6}$" "id:50301,msg:&#039;WORDPRESS SPAM BAD comment_post_ID&#039;"
SecFilterSelective "HTTP_Cookie" "^$" "id:50302,msg:&#039;WORDPRESS SPAM No cookie&#039;"
&nbsp;
##SecFilterSelective "comment_post_DI" "^$" "id:50310,msg:&#039;WORDPRESS SPAM MISSING comment_post_DI&#039;"
##SecFilterSelective "comment_post_DI" "!^[0-9]{1,2}$" "id:50311,msg:&#039;WORDPRESS SPAM MISSING comment_post_DI&#039;"
&lt;/files&gt;
&lt;pre&gt;
&nbsp;
&lt;h2&gt;MODSEC Continued.. Custom Anti-Spam (WordPress) I made&lt;/h2&gt;
&lt;pre&gt;
SecFilterSignatureAction "nolog,noauditlog,deny,severity:6,redirect:http://www.askapache.com/feed/"
SecFilterSelective ARGS|THE_REQUEST "00bp\.com|360\.yahoo|987mb\.com|Ambien|American airline" "id:50010,msg:&#039;SPAM 10&#039;
SecFilterSelective ARGS|THE_REQUEST "Ativan|Caresoprodol|Darvocet|Ephedra|Ephedrine" "id:50011,msg:&#039;SPAM 11&#039;
SecFilterSelective ARGS|THE_REQUEST "Gambling|Lexapro|Tramadol|Venlafaxine" "id:50012,msg:&#039;SPAM 12&#039;
SecFilterSelective ARGS|THE_REQUEST "\[URL=|abgood|acura|acyclovir|adderall" "id:50013,msg:&#039;SPAM 13&#039;
SecFilterSelective ARGS|THE_REQUEST "adipex|alcohol|alprazolam|amateur|amrit" "id:50014,msg:&#039;SPAM 14&#039;
SecFilterSelective ARGS|THE_REQUEST "anal sex|analfinder|angelina jolie|asshole|axspace\.com" "id:50015,msg:&#039;SPAM 15&#039;
SecFilterSelective ARGS|THE_REQUEST "baccarat|bankrupt|bikini|biotic|black jack|blowjob" "id:50016,msg:&#039;SPAM 16&#039;
SecFilterSelective ARGS|THE_REQUEST "blackjack|blog\.360|brutality|buddhism|butalbital" "id:50017,msg:&#039;SPAM 17&#039;
SecFilterSelective ARGS|THE_REQUEST "cadillac|canalis|card credit|card stud|carisoprodol" "id:50018,msg:&#039;SPAM 18&#039;
SecFilterSelective ARGS|THE_REQUEST "carmen|cash advance|cash credit|casino|catch\.com" "id:50019,msg:&#039;SPAM 19&#039;
SecFilterSelective ARGS|THE_REQUEST "celebrex|celexa|cellulite|cheap|cheerleader" "id:50020,msg:&#039;SPAM 20&#039;
SecFilterSelective ARGS|THE_REQUEST "chevrolet|child abuse|cialis|cigarette|cipro" "id:50021,msg:&#039;SPAM 21&#039;
SecFilterSelective ARGS|THE_REQUEST "citroen|claritin|cleavage|clomid|codeine" "id:50022,msg:&#039;SPAM 22&#039;
SecFilterSelective ARGS|THE_REQUEST "consulting23|craps online|credit card|credit debt|crestor" "id:50023,msg:&#039;SPAM 23&#039;
SecFilterSelective ARGS|THE_REQUEST "dealership|debt free|desnudas|diazepam|dick" "id:50024,msg:&#039;SPAM 24&#039;
SecFilterSelective ARGS|THE_REQUEST "dildo|drugstore|earrings|endometrioma|endowment" "id:50025,msg:&#039;SPAM 25&#039;
SecFilterSelective ARGS|THE_REQUEST "erotic|estrogen|fioricet|francaise|freehost\.com" "id:50026,msg:&#039;SPAM 26&#039;
SecFilterSelective ARGS|THE_REQUEST "freehostia|freemb\.com|fuck|geocities\.com|hacking myspace" "id:50027,msg:&#039;SPAM 27&#039;
SecFilterSelective ARGS|THE_REQUEST "holdem|honda|hotels|hydrocodone|hypnotic" "id:50028,msg:&#039;SPAM 28&#039;
SecFilterSelective ARGS|THE_REQUEST "hyundai|implants|incest|instant approval|insurance" "id:50029,msg:&#039;SPAM 29&#039;
SecFilterSelective ARGS|THE_REQUEST "interracial|jaguar|jenny movie|johanson|kasino" "id:50030,msg:&#039;SPAM 30&#039;
SecFilterSelective ARGS|THE_REQUEST "lesbian|levitra|lipitor|loan|lolita" "id:50031,msg:&#039;SPAM 31&#039;
SecFilterSelective ARGS|THE_REQUEST "lorazepam|lorcet|lyrics|madamic|majorette" "id:50032,msg:&#039;SPAM 32&#039;
SecFilterSelective ARGS|THE_REQUEST "malaria|mastercar|masturbate|masturbation|maturewomen" "id:50033,msg:&#039;SPAM 33&#039;
SecFilterSelective ARGS|THE_REQUEST "mazda|medication|medicine|megsfree5\.com|mercedes" "id:50034,msg:&#039;SPAM 34&#039;
SecFilterSelective ARGS|THE_REQUEST "meridia|metformin|mitsubishi|mortgage|myspace profile" "id:50035,msg:&#039;SPAM 35&#039;
SecFilterSelective ARGS|THE_REQUEST "naked|neocool|nexium|nimire\.com|nissan" "id:50036,msg:&#039;SPAM 36&#039;
SecFilterSelective ARGS|THE_REQUEST "nokia|nude|nudism|nymph|open toe" "id:50037,msg:&#039;SPAM 37&#039;
SecFilterSelective ARGS|THE_REQUEST "oprodol|orgasm|oxycodone|oxycontin|packages" "id:50038,msg:&#039;SPAM 38&#039;
SecFilterSelective ARGS|THE_REQUEST "painrelief|pantyhose|paxil|payday|penis" "id:50039,msg:&#039;SPAM 39&#039;
SecFilterSelective ARGS|THE_REQUEST "percocet|pharmacy|phentermine|phetermine|phpbb_root" "id:50040,msg:&#039;SPAM 40&#039;
SecFilterSelective ARGS|THE_REQUEST "pictaboo|pictorial|pills|pissing|play craps" "id:50041,msg:&#039;SPAM 41&#039;
SecFilterSelective ARGS|THE_REQUEST "playgirl|pocker web|poker|pontiac|poquer" "id:50042,msg:&#039;SPAM 42&#039;
SecFilterSelective ARGS|THE_REQUEST "porn|pounder|prescription|preteen|prevacid" "id:50043,msg:&#039;SPAM 43&#039;
SecFilterSelective ARGS|THE_REQUEST "price1|prilosec|propecia|proza|prozac" "id:50044,msg:&#039;SPAM 44&#039;
SecFilterSelective ARGS|THE_REQUEST "puddled|pussy|refinance|rentals|replica" "id:50045,msg:&#039;SPAM 45&#039;
SecFilterSelective ARGS|THE_REQUEST "ringtones|roulette|screensaver|seduced|sexual" "id:50046,msg:&#039;SPAM 46&#039;
SecFilterSelective ARGS|THE_REQUEST "sexy|shemale|shiloh|singulair|site-host" "id:50047,msg:&#039;SPAM 47&#039;
SecFilterSelective ARGS|THE_REQUEST "slot machine|slot maschine|slots machine|solpip\.com|soma" "id:50048,msg:&#039;SPAM 48&#039;
SecFilterSelective ARGS|THE_REQUEST "sperm|starlets|supplier|suzuki|tadalafil" "id:50049,msg:&#039;SPAM 49&#039;
SecFilterSelective ARGS|THE_REQUEST "toyota|tylenol|ultram|valium|viagra" "id:50050,msg:&#039;SPAM 50&#039;
SecFilterSelective ARGS|THE_REQUEST "vigora|vioxx|wallpaper|warez|webcam" "id:50051,msg:&#039;SPAM 51&#039;
SecFilterSelective ARGS|THE_REQUEST "webpages\.com|wellbutrin|whitesluts|wholesale|whore" "id:50052,msg:&#039;SPAM 52&#039;
SecFilterSelective ARGS|THE_REQUEST "windshield|xanax|xenical|y lohan|yourgirls" "id:50053,msg:&#039;SPAM 53&#039;
SecFilterSelective ARGS|THE_REQUEST "youtube\.com|zantac|sex offenders|hotgay|Zoloft|celtic women" "id:50054,msg:&#039;SPAM 54&#039;
SecFilterSelective ARGS|THE_REQUEST "dollhouse|freehot|kardashian|oralsex" "id:50055,msg:&#039;SPAM 55&#039;
SecFilterSelective ARGS|THE_REQUEST "freeimghost" "id:50056,msg:&#039;SPAM 56&#039;</pre>





<h2>Unreleased AskApache Lightning code - caching plugin for WordPress</h2>
<pre>RewriteEngine On
RewriteBase /
&nbsp;
RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|test/).* [NC,OR]
RewriteCond %{ENV:REDIRECT_STATUS} =200
RewriteRule .* - [L]
&nbsp;
RewriteCond %{HTTP_HOST} !=www.askapache.com
RewriteCond %{HTTP_HOST} !=z.askapache.com
RewriteRule .? http://www.askapache.com%{REQUEST_URI}%{QUERY_STRING} [R=301,L]
&nbsp;
#RewriteCond %{HTTPS} =on
#RewriteCond %{THE_REQUEST} !^[A-Z]{3,9}\ /(wp-login.php|wp-admin)(.*)\ HTTP/ [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)\ HTTP/ [NC]
#RewriteRule .* http://www.askapache.com/$1 [R=301,L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)%20(.+)\ HTTP/ [NC]
RewriteRule .* http://www.askapache.com/%1-%2 [R=301,L]
&nbsp;
RewriteCond %{THE_REQUEST} ^GET\ /valid-html/.*\ HTTP/ [NC]
RewriteCond %{HTTP_REFERER} ^https?://www.askapache.com(.+).*$ [NC]
RewriteRule .* http://validator.w3.org/check?uri=http://www.askapache.com%1;ss=1;outline=1;debug [R=307,L,NE]
&nbsp;
RewriteCond %{THE_REQUEST} ^GET\ /valid-css/.*\ HTTP/ [NC]
RewriteRule .* http://jigsaw.w3.org/css-validator/validator?uri=z.askapache.com/z/c/apache-10.css [R=301,L]
&nbsp;
RewriteCond %{THE_REQUEST} ^GET\ /search/.*\ HTTP/ [NC]
RewriteCond %{QUERY_STRING} ^s=(.+)$ [NC]
RewriteRule .* http://www.askapache.com/search/%1? [R=302,L]
&nbsp;
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/X%{REQUEST_URI}index.html -f
RewriteRule ^(.*)$ /X%{REQUEST_URI}index.html [L]
&nbsp;
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}/X%{REQUEST_URI} -f
RewriteRule ^(.*)$ /X%{REQUEST_URI} [L]</pre>



<h2>Passing Parameters to CGI through HTTP Headers</h2>
<p>This deserves a note.. this trick lets you bypass so many hosting environment restrictions it's not even funny... like you can run bash as your webserver instead of apache!  (kinda...)</p>
<pre>RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java)\.cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]</pre>



<h2>Redirect to FeedBurner</h2>
<p>Yes.. I was the first to do this (parse the real rewrites internally in wordpress for no bypassing possibilities)... </p>
<pre>#RewriteCond %{REQUEST_URI} ^/feed/.*?$ [NC,OR]
#RewriteCond %{HTTP_REFERER} ^https?://www.askapache.com/wp-admin(.+).*$ [NC]
RewriteCond %{HTTP_USER_AGENT} FeedBurner [NC]
RewriteRule .* - [S=1]
&nbsp;
RewriteCond %{REQUEST_URI} ^/(feed|rdf|rss|rss2|atom).* [NC,OR]
RewriteCond %{REQUEST_URI} ^/wp-(feed|rdf|rss|rss2|atom).* [NC,OR]
RewriteCond %{REQUEST_FILENAME} ^.*/(wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2)\.php$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} ^.*/wp-includes/feed[^\.]*\.php$ [NC,OR]
RewriteCond %{QUERY_STRING} .*(feed|rdf|rss|rss2|atom).* [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]</pre>
































<h2>More Unreleased Caching Tests</h2>
<pre># +ASKAPACHE CRAZYCACHE 2.3
#######################################################
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +ACACHE RULES
# +RULE
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ //?(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-cache/%2.html/index.rdf -f
RewriteRule ^(.+)\.rdf$ /wp-cache/%2.html/index.rdf [L,S=3]
&nbsp;
RewriteCond %{QUERY_STRING} !^.*cacheit.* [NC]
#RewriteCond %{HTTP_USER_AGENT} W3C_Validator [OR,NC]
#RewriteCond %{REMOTE_ADDR} = [OR]
&nbsp;
RewriteCond %{REQUEST_METHOD} =POST [OR]
RewriteCond %{THE_REQUEST} ^$ [OR]
RewriteCond %{QUERY_STRING} nocache [OR]
RewriteCond %{REMOTE_ADDR} = [OR]
RewriteCond %{HTTP_COOKIE} ^.*wordpress_logged_in_.*$ [NC]
RewriteRule .+ - [S=2]
&nbsp;
RewriteCond %{DOCUMENT_ROOT}/wp-cache%{REQUEST_URI} !-d
RewriteRule .+ - [S=1]
&nbsp;
RewriteCond %{DOCUMENT_ROOT}/wp-cache%{REQUEST_URI}/index.html -f
RewriteRule .+ /wp-cache%{REQUEST_URI}/index.html [L]
# -RULE
# -ACACHE RULES
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
#######################################################
# -ASKAPACHE CRAZYCACHE 2.3
&nbsp;
# +ASKAPACHE CRAZYCACHE 2.3
#######################################################
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
# +ACACHE RULES
# +RULE
FileETag None
AddOutputFilterByType DEFLATE text/html
&nbsp;
AddType &#039;text/html; charset=UTF-8&#039; .html
&nbsp;
Header set P3P "policyref=\"http://www.askapache.com/w3c/p3p.xml\""
Header set X-Pingback "http://www.askapache.com/xmlrpc.php"
Header set Content-Language "en-US"
Header set Vary "Accept-Encoding,Accept"
&nbsp;
&lt;ifModule mod_expires.c&gt;
ExpiresActive On
ExpiresDefault M7200
&lt;/ifModule&gt;
# -RULE
# -ACACHE RULES
# - - - - - - - - - - - - - - - - - - - - - - - - - - -
#               __                          __
#   ____ ______/ /______ _____  ____ ______/ /_  ___
#  / __ `/ ___/ //_/ __ `/ __ \/ __ `/ ___/ __ \/ _ \
# / /_/ (__  ) ,&lt; / /_/ / /_/ / /_/ / /__/ / / /  __/
# \__,_/____/_/|_|\__,_/ .___/\__,_/\___/_/ /_/\___/
#                     /_/
#######################################################
# -ASKAPACHE CRAZYCACHE 2.3
&nbsp;
Options +IndexesOptions +FollowSymLinks
AddHandler application/x-httpd-php .php
&nbsp;
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^tyy+$ [NC]
RewriteCond %{REMOTE_USER} ^(.+)$
RewriteRule ^(.*)$ $1/-%1 [R=302,L]
Options +FollowSymLinks
DirectoryIndex index.php
ErrorDocument 404 /cgi-bin/pro/index.php
&nbsp;
AuthName "Protection"
AuthUserFile /home/askapache/sites/askapache.com/.htpasswda1
AuthGroupFile /dev/null
AuthType Basic
Require valid-user
Satisfy Any
&nbsp;
&lt;ifModule mod_security.c&gt;
SecFilterEngine Off
&lt;/ifModule&gt;
Options +ExecCGI -Indexes -Includes +FollowSymLinks
Order Deny,Allow
Deny from All
Allow from 208.113.134.190 64.111.114.111  env=REDIRECT_STATUS
&nbsp;
#SetEnvIf Remote_Addr ^$ MODSEC_ENABLE=Off
#SetEnvIf Server_Addr ^$ MODSEC_ENABLE=Off
#SetEnvIf Remote_Addr ^({SERVER_ADDR}e)$ GOOD=$1
#SetEnvIf Server_Addr GOOD R</pre>


<h2>Default HTACCESS</h2>
<pre>#
# Directives controlling the display of server-generated directory listings.
#
# Required modules: mod_autoindex, mod_alias
#
# To see the listing of a directory, the Options directive for the
# directory must include "Indexes", and the directory must not contain
# a file matching those listed in the DirectoryIndex directive.
#
Options +Indexes +MultiViews -ExecCGI +FollowSymLinks
DirectoryIndex index.html
&nbsp;
#
#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing IconHeight=22 IconWidth=20 IgnoreClient NameWidth=* DescriptionWidth=* ScanHTMLTitles SuppressLastModified XHTML FoldersFirst SuppressHTMLPreamble
&nbsp;
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions.  These are only displayed for
# FancyIndexed directories.
#
&nbsp;
AddIconByEncoding (CMP,http://z.askapache.com/i/s/compressed.gif) x-compress x-gzip
&nbsp;
AddIconByType (IMG,http://z.askapache.com/i/s/image.gif) image/*
AddIconByType (SND,http://z.askapache.com/i/s/sound2.gif) audio/*
AddIconByType (TXT,http://z.askapache.com/i/s/text.gif) text/*
AddIconByType (VID,http://z.askapache.com/i/s/movie.gif) video/*
&nbsp;
AddIcon http://z.askapache.com/i/s/hand.right.gif README
AddIcon http://z.askapache.com/i/s/folder.gif ^^DIRECTORY^^
AddIcon http://z.askapache.com/i/s/dir.png ^^DIRECTORY^^
AddIcon http://z.askapache.com/i/s/blank.gif ^^BLANKICON^^
AddDescription "100 Continue" 100* 100/index.html
AddDescription "101 Switching Protocols" 101* 101/index.html
AddDescription "102 Processing" 102* 102/index.html
AddDescription "200 OK" 200* 200/index.html
AddDescription "201 Created" 201* 201/index.html
AddDescription "202 Accepted" 202* 202/index.html
AddDescription "203 Non-Authoritative Information" 203* 203/index.html
AddDescription "204 No Content" 204* 204/index.html
AddDescription "205 Reset Content" 205* 205/index.html
AddDescription "206 Partial Content" 206* 206/index.html
AddDescription "207 Multi-Status" 207* 207/index.html
AddDescription "300 Multiple Choices" 300* 300/index.html
AddDescription "301 Moved Permanently" 301* 301/index.html
AddDescription "302 Found" 302* 302/index.html
AddDescription "303 See Other" 303* 303/index.html
AddDescription "304 Not Modified" 304* 304/index.html
AddDescription "305 Use Proxy" 305* 305/index.html
AddDescription "306 unused" 306* 306/index.html
AddDescription "307 Temporary Redirect" 307* 307/index.html
AddDescription "400 Bad Request" 400* 400/index.html
AddDescription "401 Authorization Required" 401* 401/index.html
AddDescription "402 Payment Required" 402* 402/index.html
AddDescription "403 Forbidden" 403* 403/index.html
AddDescription "404 Not Found" 404* 404/index.html
AddDescription "405 Method Not Allowed" 405* 405/index.html
AddDescription "406 Not Acceptable" 406* 406/index.html
AddDescription "407 Proxy Authentication Required" 407* 407/index.html
AddDescription "408 Request Time-out" 408* 408/index.html
AddDescription "409 Conflict" 409* 409/index.html
AddDescription "410 Gone" 410* 410/index.html
AddDescription "411 Length Required" 411* 411/index.html
AddDescription "412 Precondition Failed" 412* 412/index.html
AddDescription "413 Request Entity Too Large" 413* 413/index.html
AddDescription "414 Request-URI Too Large" 414* 414/index.html
AddDescription "415 Unsupported Media Type" 415* 415/index.html
AddDescription "416 Requested Range Not Satisfiable" 416* 416/index.html
AddDescription "417 Expectation Failed" 417* 417/index.html
AddDescription "418 unused" 418* 418/index.html
AddDescription "419 unused" 419* 419/index.html
AddDescription "420 unused" 420* 420/index.html
AddDescription "421 unused" 421* 421/index.html
AddDescription "422 Unprocessable Entity" 422* 422/index.html
AddDescription "423 Locked" 423* 423/index.html
AddDescription "424 Failed Dependency" 424* 424/index.html
AddDescription "425 No code" 425* 425/index.html
AddDescription "426 Upgrade Required" 426* 426/index.html
AddDescription "500 Internal Server Error" 500* 500/index.html
AddDescription "501 Method Not Implemented" 501* 501/index.html
AddDescription "502 Bad Gateway" 502* 502/index.html
AddDescription "503 Service Temporarily Unavailable" 503* 503/index.html
AddDescription "504 Gateway Time-out" 504* 504/index.html
AddDescription "505 HTTP Version Not Supported" 505* 505/index.html
AddDescription "506 Variant Also Negotiates" 506* 506/index.html
AddDescription "507 Insufficient Storage" 507* 507/index.html
AddDescription "508 unused" 508* 508/index.html
AddDescription "509 unused" 509* 509/index.html
AddDescription "510 Not Extended" 510* 510/index.html
AddDescription ".htaccess ErrorDocuments" *
&nbsp;
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName /X/error/README.html
HeaderName /X/error/HEADER.html
&nbsp;
# DefaultIcon is which icon to show for where none is explicitly set.
DefaultIcon http://z.askapache.com/i/s/generic.gif</pre>


<h2>Ok I'm done commenting..</h2>
<pre>#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing.  Shell-style wildcarding is permitted.
#
IndexIgnore .??*  *_notes *~
RewriteEngine On
RewriteCond %{HTTPS} !=on [NC]
RewriteRule .* https://www.askapache.com%{REQUEST_URI}
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
&nbsp;
#RewriteCond %{QUERY_STRING} openid.mode=authorize
#RewriteCond %{REQUEST_URI} ^/openid.*$ [NC]
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},E=REMOTE_USER:%{HTTP:Authorization}]
Options +FollowSymLinks
DirectoryIndex index.html
&nbsp;
#SetEnvIfNoCase ^Cookie$ "(.*)" HTTP_MY_COOKIE=$1
#SetEnvIfNoCase Remote_Addr "(.*)" HTTP_MY_REMOTE_ADDR=$1
ExpiresActive Off
FileETag None
Header unset Connection
Header set Connection "close"
Header unset Last-Modified
Header unset ETag
Header unset Accept-Ranges
Header unset Vary
Header unset Content-Type
Header unset X-Pingback
Header unset P3P
#Header add RouterBits "%D %t"
#Header add Location "http://www.askapache.com/feed/"
#Header add Found "http://askapache.com/feed/"
#Header add Content-Location "http://www.askapache.com/feed/"
#Header add Refresh "http://www.askapache.com/feed/"
#Header set Hi "%{HTTP_MY_REMOTE_ADDR}e"
### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#
#
# TZ: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
SetEnv TZ America/Indianapolis
&nbsp;
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
SetEnv SERVER_ADMIN webmaster@askapache.com
&nbsp;
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.0/mod/core.html#options
# for more information.
#
Options  +FollowSymLinks -ExecCGI -Indexes -Includes -MultiViews
&nbsp;
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
DirectoryIndex index.html index.php /index.php
&nbsp;
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
&lt;filesMatch "^\.ht"&gt;
    Order allow,deny
    Deny from all
  Satisfy All
&lt;/filesMatch&gt;
&nbsp;
#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/html
&nbsp;
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of:  On | Off | EMail
#
ServerSignature Off
&nbsp;
##############################################
#           HEADERS and CACHING              #
##############################################
Header unset Pragma
Header unset Last-Modified
FileETag None
&nbsp;
Redirect 400 /e/400
Redirect 401 /e/401
Redirect 402 /e/402
Redirect 403 /e/403
Redirect 404 /e/404
Redirect 405 /e/405
Redirect 406 /e/406
Redirect 407 /e/407
Redirect 408 /e/408
Redirect 409 /e/409
Redirect 410 /e/410
Redirect 411 /e/411
Redirect 412 /e/412
Redirect 413 /e/413
Redirect 414 /e/414
Redirect 415 /e/415
Redirect 416 /e/416
Redirect 417 /e/417
Redirect 418 /e/418
Redirect 419 /e/419
Redirect 420 /e/420
Redirect 421 /e/421
Redirect 422 /e/422
Redirect 423 /e/423
Redirect 424 /e/424
Redirect 425 /e/425
Redirect 426 /e/426
Redirect 500 /e/500
Redirect 501 /e/501
Redirect 502 /e/502
Redirect 503 /e/503
Redirect 504 /e/504
Redirect 505 /e/505
Redirect 506 /e/506
Redirect 507 /e/507
Redirect 508 /e/508
Redirect 509 /e/509
Redirect 510 /e/510
&nbsp;
#
# Redirect allows you to tell clients about documents which used to exist in
# your server&#039;s namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
##############################################
#          PERMANENT REDIRECTS               #
##############################################
Redirect 301 /12-lessons-for-those-afraid-of-css.html http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html
Redirect 301 /2006/htaccess/htaccesselite-ultimate-htaccess-article.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /2007/phpbb/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/custom-phpini-with-fastcgi-on-dreamhost.html http://www.askapache.com/dreamhost/custom-phpini-with-fastcgi-on-dreamhost.html
Redirect 301 /2007/webmaster/php-and-ajax-shell-console.html http://www.askapache.com/tools/php-and-ajax-shell-console.html
Redirect 301 /27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html http://www.askapache.com/htaccess/27-request-methods-for-use-with-apache-and-rewritecond-and-htaccess.html
Redirect 301 /404-google-wordpress-plugin.html http://www.askapache.com/seo/404-google-wordpress-plugin.html
Redirect 301 /503-service-temporarily-unavailable.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /Overview-about.rdf http://www.askapache.com/askapache-home.rdf
Redirect 301 /abbr-acronym.html http://www.askapache.com/xhtml/abbr-acronym.html
Redirect 301 /adsense-robots.html http://www.askapache.com/google/adsense-robots.html
Redirect 301 /alexa-toolbar-firefox.html http://www.askapache.com/tools/alexa-toolbar-firefox.html
Redirect 301 /allowing-access-from-1-static-ip-and-deny-the-rest.html http://www.askapache.com/htaccess/apache-htaccess.html
Redirect 301 /anti-virus-spyware-rootkit.html http://www.askapache.com/security/anti-virus-spyware-rootkit.html
Redirect 301 /apache-ssl-in-htaccess-examples.html http://www.askapache.com/htaccess/apache-ssl-in-htaccess-examples.html
Redirect 301 /awk-tutorial.html http://www.askapache.com/awk/awk-tutorial.html
Redirect 301 /best-adsense-optimization.html http://www.askapache.com/wordpress/best-adsense-optimization.html
Redirect 301 /commonly-used-htaccess-code-examples.html http://www.askapache.com/htaccess/commonly-used-htaccess-code-examples.html
Redirect 301 /css-background-image-sprite.html http://www.askapache.com/css/css-background-image-sprite.html
Redirect 301 /css-browser-screenshots.html http://www.askapache.com/tools/css-browser-screenshots.html
Redirect 301 /css-class-example.html http://www.askapache.com/css/css-class-example.html
Redirect 301 /curl-multi-downloads.html http://www.askapache.com/php/curl-multi-downloads.html
Redirect 301 /custom-boot-menu-in-windows-xp.html http://www.askapache.com/windows/custom-boot-menu-in-windows-xp.html
Redirect 301 /donate http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /donate/ http://www.dreamhost.com/donate.cgi?id=8261
Redirect 301 /htaccess.txt http://z.askapache.com/p/htaccess.txt
Redirect 301 /htaccess/404-errorpages.html http://www.askapache.com/seo/google-ajax-search-seo-tips.html
Redirect 301 /htaccess/feedsmith http://www.askapache.com/htaccess/feedsmith-htaccess.html
Redirect 301 /htaccess/http-status-codes.html http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html
Redirect 301 /htaccess/instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /htaccess/speed-up-the-apache-web-server-with-configuration-hacks.html http://www.askapache.com/htaccess/apache-web-server-speed-configuration-hacks.html
Redirect 301 /instruct-search-engines-to-come-back-to-site-after-you-finish-working-on-it.html http://www.askapache.com/htaccess/503-service-temporarily-unavailable.html
Redirect 301 /security/bypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/bypassing-vlanbypassing-vlan.html http://www.askapache.com/security/hacking-vlan-switched-networks.html
Redirect 301 /security/rigging-the-dreamhost-site-of-the-month-contest.html http://www.askapache.com/dreamhost/rigging-the-dreamhost-site-of-the-month-contest.html
Redirect 301 /seo/tailrankcom-robot.html http://www.askapache.com/seo/tailrank-robot.html
Redirect 301 /webmaster/caching-tutorial-for-webmasters.html http://www.askapache.com/htaccess/caching-tutorial-for-webmasters.html
Redirect 301 /webmaster/lft-traceroute-tool.html http://www.askapache.com/tools/lft-traceroute-tool.html
&nbsp;
##############################################
#          PERMANENT REDIRECTMATCH           #
##############################################
#RedirectMatch 301 ^/&amp;(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/&amp;amp(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^/]+)//$ http://www.askapache.com/$1/
RedirectMatch 301 ^/(.+)/htaccesselite-ultimate-htaccess-article.html(.*) http://www.askapache.com/htaccess/apache-htaccess.html
RedirectMatch 301 ^/(.+)\.html/([a-z][a-z])/$ http://www.askapache.com/$1.html
RedirectMatch 301 ^/([\(]+)(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/([^9]*)9O1X.3y(.*)/(.*)$ http://www.askapache.com/$2
RedirectMatch 301 ^/.3y(.*)$ http://www.askapache.com/
RedirectMatch 301 ^/200([0-9])/([0-9])(.*)$ http://www.askapache.com/top-100/
RedirectMatch 301 ^/200([0-9])/([^01])(.*)$ http://www.askapache.com/$2$3
RedirectMatch 301 ^/about/glossary(.*)$ http://www.askapache.com/glossary$1
RedirectMatch 301 ^/apache-speed(.*)$ http://www.askapache.com/htaccess/apache-speed$1
RedirectMatch 301 ^/category/(.+)$ http://www.askapache.com/$1
RedirectMatch 301 ^/docs/(.*)$ http://askapache.info/$1
RedirectMatch 301 ^/htaccess/feedsmith-htaccess(.*) http://www.askapache.com/htaccess/redirecting-wordpress-feeds-to-feedburner.html
RedirectMatch 301 ^/robots-txt(.*)$ http://www.askapache.com/robots.txt
#RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://z.askapache.com/uploads/$1
RedirectMatch 301 ^/z/(.+)$ http://z.askapache.com/$1
RedirectMatch 301 ^/(z|t|i|j|c|p)/(.*)$ http://z.askapache.com/$1/$2
RedirectMatch 301 ^/hosting/?$ http://www.askapache.com/hosting/
&nbsp;
##############################################
#          TEMPORARY REDIRECTMATCH           #
##############################################
RedirectMatch 307 ^/getflash/?$ http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash
RedirectMatch 307 ^/dream/?$ http://www.askapache.com/dreamhost/
RedirectMatch 307 ^/(cse|apachecse|apachecsetest|apachesearch)/?$ http://www.google.com/coop/cse?cx=002660089121042511758%3Akk7rwc2gx0i
&nbsp;
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddDefaultCharset UTF-8
&nbsp;
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
#
AddType &#039;application/rdf+xml; charset=UTF-8&#039; .rdf
AddType &#039;application/xhtml+xml; charset=UTF-8&#039; .xhtml
AddType &#039;application/xhtml+xml; charset=UTF-8&#039; .xhtml.gz
AddType &#039;text/html; charset=UTF-8&#039; .html
AddType &#039;text/html; charset=UTF-8&#039; .html.gz
AddType application/octet-stream .rar .chm .bz2 .tgz .msi .pdf .exe
AddType application/vnd.ms-excel .csv
AddType application/x-httpd-php-source .phps
AddType application/x-pilot .prc .pdb
AddType application/x-shockwave-flash .swf
AddType application/xrds+xml .xrdf
AddType text/plain .ini .sh .bsh .bash .awk .nawk .gawk .csh .var .c .in .h .asc .md5 .sha .sha1
AddType video/x-flv .flv
&nbsp;
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
# Despite the name similarity, the following Add* directives have nothing
# to do with the FancyIndexing customization directives above.
#
AddEncoding x-compress .Z
AddEncoding x-gzip .gz .tgz
&nbsp;
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler php-cgi .php
&nbsp;
#
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
#
Action php-cgi /cgi-bin/php.cgi
&nbsp;
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
#100 Continue
#101 Switching Protocols
#102 Processing
#200 OK
#201 Created
#202 Accepted
#203 Non-Authoritative Information
#204 No Content
#205 Reset Content
#206 Partial Content
#207 Multi-Status
#300 Multiple Choices
#301 Moved Permanently
#302 Found
#303 See Other
#304 Not Modified
#305 Use Proxy
#306 unused
#307 Temporary Redirect
#400 Bad Request
#401 Authorization Required
#402 Payment Required
#403 Forbidden
#404 Not Found
#405 Method Not Allowed
#406 Not Acceptable
#407 Proxy Authentication Required
#408 Request Time-out
#409 Conflict
#410 Gone
#411 Length Required
#412 Precondition Failed
#413 Request Entity Too Large
#414 Request-URI Too Large
#415 Unsupported Media Type
#416 Requested Range Not Satisfiable
#417 Expectation Failed
#418 unused
#419 unused
#420 unused
#421 unused
#422 Unprocessable Entity
#423 Locked
#424 Failed Dependency
#425 No code
#426 Upgrade Required
#500 Internal Server Error
#501 Method Not Implemented
#502 Bad Gateway
#503 Service Temporarily Unavailable
#504 Gateway Time-out
#505 HTTP Version Not Supported
#506 Variant Also Negotiates
#507 Insufficient Storage
#508 unused
#509 unused
#510 Not Extended
&nbsp;
#ErrorDocument 100 /X/err/1/HTTP_CONTINUE.html
#ErrorDocument 101 /X/err/1/HTTP_SWITCHING_PROTOCOLS.html
#ErrorDocument 102 /X/err/1/HTTP_PROCESSING.html
&nbsp;
#ErrorDocument 200 /X/err/2/HTTP_OK.html
#ErrorDocument 201 /X/err/2/HTTP_CREATED.html
#ErrorDocument 202 /X/err/2/HTTP_ACCEPTED.html
#ErrorDocument 203 /X/err/2/HTTP_NON_AUTHORITATIVE.html
#ErrorDocument 204 /X/err/2/HTTP_NO_CONTENT.html
#ErrorDocument 205 /X/err/2/HTTP_RESET_CONTENT.html
#ErrorDocument 206 /X/err/2/HTTP_PARTIAL_CONTENT.html
#ErrorDocument 207 /X/err/2/HTTP_MULTI_STATUS.html
&nbsp;
#ErrorDocument 300 /X/err/HTTP_MULTIPLE_CHOICES.html
#ErrorDocument 301 /X/err/HTTP_MOVED_PERMANENTLY.html
#ErrorDocument 302 /X/err/HTTP_MOVED_TEMPORARILY.html
#ErrorDocument 303 /X/err/HTTP_SEE_OTHER.html
#ErrorDocument 304 /X/err/HTTP_NOT_MODIFIED.html
#ErrorDocument 305 /X/err/HTTP_USE_PROXY.html
#ErrorDocument 307 /X/err/HTTP_TEMPORARY_REDIRECT.html
#ErrorDocument 404 /X/err/HTTP_NOT_FOUND.html
&nbsp;
ErrorDocument 400 /X/err/4/HTTP_BAD_REQUEST.html
ErrorDocument 401 /X/err/4/HTTP_UNAUTHORIZED.html
ErrorDocument 402 /X/err/4/HTTP_PAYMENT_REQUIRED.html
ErrorDocument 403 /X/err/4/HTTP_FORBIDDEN.html
ErrorDocument 405 /X/err/4/HTTP_METHOD_NOT_ALLOWED.html
ErrorDocument 406 /X/err/4/HTTP_NOT_ACCEPTABLE.html
ErrorDocument 407 /X/err/4/HTTP_PROXY_AUTHENTICATION_REQUIRED.html
ErrorDocument 408 /X/err/4/HTTP_REQUEST_TIME_OUT.html
ErrorDocument 409 /X/err/4/HTTP_CONFLICT.html
ErrorDocument 410 /X/err/4/HTTP_GONE.html
ErrorDocument 411 /X/err/4/HTTP_LENGTH_REQUIRED.html
ErrorDocument 412 /X/err/4/HTTP_PRECONDITION_FAILED.html
ErrorDocument 413 /X/err/4/HTTP_REQUEST_ENTITY_TOO_LARGE.html
ErrorDocument 414 /X/err/4/HTTP_REQUEST_URI_TOO_LARGE.html
ErrorDocument 415 /X/err/4/TTP_UNSUPPORTED_MEDIA_TYPE.html
ErrorDocument 416 /X/err/4/HTTP_RANGE_NOT_SATISFIABLE.html
ErrorDocument 417 /X/err/4/HTTP_EXPECTATION_FAILED.html
ErrorDocument 422 /X/err/4/HTTP_UNPROCESSABLE_ENTITY.html
ErrorDocument 423 /X/err/4/HTTP_LOCKED.html
ErrorDocument 424 /X/err/4/HTTP_FAILED_DEPENDENCY.html
ErrorDocument 426 /X/err/4/HTTP_UPGRADE_REQUIRED.html
&nbsp;
ErrorDocument 500 /X/err/5/HTTP_INTERNAL_SERVER_ERROR.html
ErrorDocument 501 /X/err/5/HTTP_NOT_IMPLEMENTED.html
ErrorDocument 502 /X/err/5/HTTP_BAD_GATEWAY.html
ErrorDocument 503 /X/err/5/HTTP_SERVICE_UNAVAILABLE.html
ErrorDocument 504 /X/err/5/HTTP_GATEWAY_TIME_OUT.html
ErrorDocument 505 /X/err/5/HTTP_VERSION_NOT_SUPPORTED.html
ErrorDocument 506 /X/err/5/HTTP_VARIANT_ALSO_VARIES.html
ErrorDocument 507 /X/err/5/HTTP_INSUFFICIENT_STORAGE.html
ErrorDocument 510 /X/err/5/HTTP_NOT_EXTENDED.html
ErrorDocument 404 /index.php?error=404
&nbsp;
# 1 YEAR
&lt;filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"&gt;
Header unset P3P
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
&lt;/filesMatch&gt;
&nbsp;
# 2 HOURS
&lt;filesMatch "\.(html|htm|xml|txt|xsl)$"&gt;
&lt;ifModule mod_expires.c&gt;
ExpiresActive On
ExpiresDefault A3600
&lt;/ifModule&gt;
&lt;/filesMatch&gt;
&nbsp;
RewriteEngine On
RewriteBase /
&nbsp;
RewriteCond %{ENV:REDIRECT_STATUS} =200
RewriteRule .* - [L]
&nbsp;
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD) [OR]
#RewriteCond %{QUERY_STRING} !^$ [OR]
RewriteCond %{HTTP_COOKIE} ^.*(comment_author_|wordpress|wp-postpass_).*$ [NC]
RewriteRule ^(.*)$ - [S=6]
&nbsp;
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=5]
&nbsp;
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml.gz [L,S=4]
&nbsp;
RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html.gz -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html.gz [L,S=3]
&nbsp;
RewriteCond %{HTTP_USER_AGENT} .*W3C_Validator.* [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=2]
&nbsp;
RewriteCond %{HTTP:Accept} application/xhtml\+xml [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.xhtml -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.xhtml [L,S=1]
&nbsp;
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/aa/$1/index.html -f
RewriteRule ^(.*)$ /wp-content/cache/aa/$1/index.html [L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+)\.rdf\ HTTP/ [NC]
RewriteCond %{DOCUMENT_ROOT}/wp-content/rdf/%1.html/index.rdf -f
RewriteRule ^(.*)$ /wp-content/rdf/%1.html/index.rdf [L,S=1]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(error|w3c|openid)(/?.*)\ HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /X/%1%2 [L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(y_key_bf61afd498f7623a\.html|google3bb7b7e1032ad0d4\.html|yadis\.xrdf|askapache-home\.rdf|os-description\.xml|labels\.rdf|gnu-fdl\.txt|wlmmanifest\.xml|robots\.txt)\ HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /X/%1 [L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /X(.*)\ HTTP/ [NC]
RewriteRule .* - [F]
&nbsp;
RewriteRule ^osq?(.*)$ /wp-content/plugins/wp-opensearch.php?$1 [QSA,L]
&nbsp;
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-login(.+)\ HTTP/ [NC]
#RewriteRule .+ https://www.askapache.com/wp-login%1 [R,L]
&nbsp;
RewriteCond %{REQUEST_URI} ^/cgi-bin/(hash|java)\.cgi$ [NC]
RewriteCond %{HTTP:P3P} ^(([^:]+):(.+))$ [NC]
RewriteRule .* - [E=HTTP_JS:%{HTTP:P3P},E=HTTP_US:%2,E=HTTP_PA:%3]
&nbsp;
RewriteCond %{HTTP_ACCEPT} application/xrds\+xml
RewriteCond %{HTTP_ACCEPT} !application/xrds\+xml\s*;\s*q\s*=\s*0(\.0{1,3})?\s*(,|$)
RewriteRule ^$ http://www.askapache.com/yadis.xrdf [R,L]
&nbsp;
RewriteCond %{HTTP_USER_AGENT} !^(FeedBurner|FeedValidator|talkr.com).* [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom)/?.*\ HTTP/ [NC]
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(feed|rdf|rss|rss2|atom|wp-atom|wp-feed|wp-rdf|wp-rss|wp-rss2).*\ HTTP/ [NC]
RewriteRule .* http://feeds.askapache.com/apache/htaccess? [R=302,L]
&nbsp;
#RewriteCond %{REMOTE_ADDR} ^$
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.+)\.phps$ /cgi-bin/phps.php?file=$1.php [L,NC]</pre>

<p><a href="http://www.askapache.com/htaccess/real-world-htaccess-files.html"></a><a href="http://www.askapache.com/htaccess/real-world-htaccess-files.html">Actual Htaccess Files from My Server</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/real-world-htaccess-files.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Advanced .htaccess Tricks for Securing Sites</title>
		<link>http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html</link>
		<comments>http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html#comments</comments>
		<pubDate>Sat, 20 Dec 2008 02:28:25 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1916</guid>
		<description><![CDATA[<p>This is all new, experimental, and very very cool.  It literally uses .htaccess techniques to create several virtual "locked gates" that require a specific key to unlock, in a specific order that cannot be bypassed. It uses whitelisting .htaccess tricks to specify exactly what is allowed, instead of trying to specify everything that isn't allowed.   Also, by setting specific cookies/tokens after successfully passing through a gate, we can then require the exact cookie/token from the previous gate, which stops an attacker from skipping or bypassing gates.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html"></a><a href="http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html"><cite>AskApache.com</cite></a></p><p>I'm about 2 weeks away from publishing the upgrade for the WordPress .htaccess security plugin, and haven't had time to post for awhile as I've been doing mad research for the plugin, which is probably going to set the net on fire once its released... but today I spent all day doing work for one of my longtime security clients, and I thought I'd share some of the .htaccess tricks I used to increase the security.</p>
<p>The site runs on a privately hosted linux server and is setup to be as secure as possible in many different ways.  The site is a private forum with sensitive information, and needs to balance the highest amount of security possible without causing the many worldwide members any discomfort.</p>

<h2>Security System Overview</h2>
<p>This is all new, experimental, and very very cool.  It literally uses .htaccess techniques to create several virtual "locked gates" that require a specific key to unlock, in a specific order that cannot be bypassed.  The cool thing about this new experimental (but working flawlessly for 12+hours now) is that it uses whitelisting ideas to specify exactly what is allowed, instead of trying to specify everything that isn't allowed.  That specificity is also used to add additional layers of security onto the request at each virtual gate.  Also, by setting specific cookies/tokens after successfully passing through a gate, we can then require the exact cookie/token from the previous gate, which stops an attacker from skipping or bypassing gates.   Finally, this tiered approach allows all users who successfully authenticate all the way to the server to be able to bypass these gates for all further requests, and using nonce values and time-sensitive keys, we can specify the amount of time before a user has to do it all over again.</p>

<h2>Creation and Explanation</h2>
<p>I started out with a simple upgrade from HTTP Basic Authentication to HTTP Digest Authentication, which provides much greater security..  But I noticed that several of the various Browsers out there (like Google Chrome!) do NOT follow the RFC 2617 Specifications which cause a host of problems for the users running them.  The problem is bad programming on the part of the browser programmers.. Internet Explorer (IE) is the worst offender, but that is no surprise and even expected as its MS, but Google Chrome?  I wondered how Google was able to program an entire browser so fast...It appears they took shortcuts.</p>

<h3>Browser Digest Issues</h3>
<p>Without getting technical, the problem is how the bad browsers handle GET requests for resources that contain a query string like <code>/login.php?THIS_IS=a_query_string</code>.. The bad browsers compute the hash for the request using the query string, but the auth header request-uri doesn't have the query string, so the hash doesn't match and the authentication failes.</p>

<p>The solution I came up with was to turn Digest Authentication <strong>off</strong> for everything <strong>except</strong> <code>favicon.ico</code></p>
<p>This works because if the client successfully authenticates using Digest Authentication for the file <code>favicon.ico</code>, we can use .htaccess to set a special secret cookie that can be checked later to verify the Digest Auth was successful... Here's how this security handles any request to the server, without getting to technical:</p>

<ol>
<li>Client makes request to the server.</li>
<li>We check to make sure that https is being used or else it starts using it via a redirect.  This loop continues until https is used.</li>
<li>Now the server checks for a certain cookie being set and present in the request, if the cookie is incorrect or not present, the server forces a redirect to <code>favicon.ico</code> which then forces Digest Authentication.  If the digest authentication is successful then the server sets a special cookie to bypass this check for all future requests in the session.</li>
<li>Finally the user is presented with the phpBB login screen, and if they successfully log in and are using a valid account (ie, active and not a guest) then a 2nd special cookie is set.  If that 2nd special cookie isn't present or set then the user is continually redirected to the login screen until they have successfully logged in.</li>
</ol>
<p>All of this is done by the server using built-in apache security.  The only non-server part is the last cookie that is set upon successful login into the phpBB forum, that cookie is set in the code with a small modification I made to 1 phpBB core file.</p>


<h2>User-Friendly Transparency</h2>
<p>The only thing different when logging into this server from the users perspective, is the additional HTTP Digest User/Pass that they will need.  Other than that they just login to phpBB as normal.</p>
<pre>+----------------+
| client request |
+----------------+
  |
  |
===========
 +HTTPS   -=[ Require SSL Encrypted Connection to Continue
===========
  ||
  ||
======================
 +LOGIN CREDENTIALS  -=[Require Valid Digest User/Pass Authentication to Continue
======================
  |||
  |||
====================
 +DIGEST COOKIE  -=[Set Cookie to Save Digest Auth was successful, Require Cookie to Continue
====================
  ||||
  ||||
======================
 +PHPBB CREDENTIALS  -=[phpBB Forum Login System, Required to Continue
======================
  |||||
  |||||
==================
 +PHPBB COOKIE  -=[Set Cookie to Save success phpBB login, Required for non-login urls
==================
  ||||||
  ||||||
+----------------+
| server response |
+----------------+</pre>



<h2>The .htaccess</h2>
<p>Some basics, turning off everything and setting up default document to be used by the unix-dir handler.</p>
<pre>Options -Indexes -Includes -ExecCGI -MultiViews
&nbsp;
DirectoryIndex index.php /priv/index.php</pre>

<h3>HTTP Digest One-Time</h3>
<p>As a workaround to issues with Chrome, MSIE, and a few other browsers, we only require Digest Authentication for the favicon.ico file.  This also saves a lot of HTTP Requests and CPU.  We use RewriteRule's to force authentication, and then by setting a cookie if the authentication was successful, we can simply check for that cookie elsewhere instead of requiring Digest Auth for every single request.</p>
<pre>&lt;files favicon.ico&gt;
AuthType Digest
AuthName "askapache1"
AuthDigestDomain https://www.askapache.com/ /
AuthDigestFile /askapache/.htpasswdd
require valid-user
&lt;/files&gt;</pre>

<h3>Force SSL</h3>
<p>This completely forces SSL to be used, http isn't even an option.   To keep this from bugging users who type in the address <code>http://</code> we use the ErrorDocument directive below.</p>
<pre>SSLOptions +StrictRequire
SSLRequireSSL</pre>

<h3>ErrorDocuments</h3>
<p>By specifying that a 403 forbidden (which SSLRequireSSL sends for non-https requests) should redirect to the login page, users never have errors, and it also fixes the issue of double-password prompts for basic/digest authentication that would otherwise occur here.  The /error/ folder is a special folder that uses <code>+IncludesNoExec</code> to display helpful information about the request and how to contact me if they ever see it.</p>
<pre>ErrorDocument 400 /error/400.html
ErrorDocument 401 /error/401.html
ErrorDocument 403 https://www.askapache.com/priv/ucp.php
ErrorDocument 404 /error/404.html
ErrorDocument 405 /error/405.html
ErrorDocument 500 /error/500.html
ErrorDocument 503 /error/503.html</pre>


<h2>Mod_Rewrite hacks it Together</h2>
<p>Ok this is what makes it all work.   This is the experimental part of this system, as I haven't had time to fully debug it.. so far after 12+hours running, not a single problem.. but I did quite a bit of live http/htts sniffing to tweak it just right.  IOW, don't copy and paste this and expect something magical, unless magic to you is hard-to-trace redirect loops, errors, and bizarre user-agent/protocol issues.   This is actually pretty crazy...  I love it!</p>

<h3>Setup and Redirect Loop Stopping</h3>
<p>The <code>REDIRECT_STATUS</code> variable is only set after a request is redirected internally, so if its already set.. kill the rewrite processing.</p>
<pre>RewriteEngine On
RewriteBase /
&nbsp;
RewriteCond %{ENV:REDIRECT_STATUS} !^$
RewriteRule .* - [L]</pre>



<h3>.htaccess Meat and Potatoes</h3>
<p>Ok as short and simple as this looks, it's actually way serious and complex and at the moment I'm not going to attempt to walk you through it.  Like most articles and stuff on this blog, you have to do your own hacking to figure anything out..  partly because I'm not a great writer, but mostly because I spend my time learning new stuff, spelling it out for you makes you stupid, you have to do your own hacking if you want to understand it.</p>
<p>Try to figure out which piece of the below code fits into the chart above... </p>
<pre>RewriteCond %{THE_REQUEST} !^[A-Z]{1,4}\ /favicon\.ico\ HTTP/
RewriteCond %{HTTP_COOKIE} !^.*faviconcheck.*$
RewriteRule .* https://www.askapache.com/favicon.ico? [R,L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{1,4}\ /favicon\.ico\ HTTP/
RewriteCond %{HTTP_COOKIE} !^.*faviconcheck.*$
RewriteRule .* https://www.askapache.com/priv/index.php? [CO=faviconcheck:1:www.askapache.com:6400,R]
&nbsp;
RewriteCond %{HTTP_COOKIE} ^.*phpbb_c3_u=1\;.*$
RewriteRule ^cron\.php$ - [S=1]
&nbsp;
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} \.php
RewriteCond %{THE_REQUEST} !^[A-Z]{1,4}\ /priv/ucp\.php.*\ HTTP/
RewriteCond %{HTTP_COOKIE} !^.*phpbb_c3_u8=keyok\;.*$
RewriteRule ^priv.*$ https://www.askapache.com/priv/ucp.php [R=302,L]</pre>



<h2>Apache's Workaround</h2>
<p>See the <a href="http://www.askapache.com/htaccess/setenvif.html">SetEnvIf directive</a> for more details on conditionally setting environment variables.</p>
<blockquote cite="http://httpd.apache.org/docs/trunk/mod/mod_auth_digest.html#msie">
<p><a href="http://httpd.apache.org/docs/trunk/mod/mod_auth_digest.html#msie">Working with MS Internet Explorer</a>
<p>The Digest authentication implementation in previous Internet Explorer for Windows versions (5 and 6) had issues, namely that <strong>GET requests with a query string were not RFC compliant</strong>. There are a few ways to work around this issue.</p>
<p>The first way is to use POST requests instead of GET requests to pass data to your program. This method is the simplest approach if your application can work with this limitation.</p>
<p>Since version 2.0.51 Apache also provides a workaround in the AuthDigestEnableQueryStringHack environment variable. If AuthDigestEnableQueryStringHack is set for the request, Apache will take steps to work around the MSIE bug and remove the query string from the digest comparison. Using this method would look similar to the following.  Using Digest Authentication with MSIE:</p>
<pre>BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On</pre>
<p>This workaround is not necessary for MSIE 7, though enabling it does not cause any compatibility issues or significant overhead.</p>
</blockquote>


<h2>Help</h2>
<p>Every piece of the puzzle above is explained somewhere on this blog.. the search in the top right of this site works great.</p>
<p>As always, please add your comments, especially if you have an idea to make this better or improved in any way..</p><p><a href="http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html"></a><a href="http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html">Advanced .htaccess Tricks for Securing Sites</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/advanced-htaccess-tricks-for-securing-sites.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>About AskApache</title>
		<link>http://www.askapache.com/about</link>
		<comments>http://www.askapache.com/about#comments</comments>
		<pubDate>Mon, 15 Sep 2008 12:26:49 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
		
		<guid isPermaLink="false">http://www.askapache.com/about/</guid>
		<description><![CDATA[<p><a href="http://www.askapache.com/about"></a><a href="http://www.askapache.com/about"><cite>AskApache.com</cite></a></p><p>The goal of AskApache.com is simple - To provide free access to knowledge and data with the goal of empowering people.. or more melodramatically:  <strong>"Power to the People!"</strong></p>
<p><strong>Why the name AskApache?</strong>  AskApache was chosen to show and pay <strong>respect</strong> to the contributors of the <a href="http://httpd.apache.org">Apache Web Server</a>.  Literally it means to ask Apache when facing a problem, &#8230; <a href="http://www.askapache.com/about" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/about"></a><a href="http://www.askapache.com/about"><cite>AskApache.com</cite></a></p><p>The goal of AskApache.com is simple - To provide free access to knowledge and data with the goal of empowering people.. or more melodramatically:  <strong>"Power to the People!"</strong></p>
<p><strong>Why the name AskApache?</strong>  AskApache was chosen to show and pay <strong>respect</strong> to the contributors of the <a href="http://httpd.apache.org">Apache Web Server</a>.  Literally it means to ask Apache when facing a problem, by searching the <strong>Open-Source</strong>, contacting a board/list, or browsing the documentation.</p>

<h2>The Author</h2>

<p>I work for a multimedia production / brand development &amp; marketing company here in Indianapolis, the greatest city in the world!  I started this blog in Dec., '06 to familiarize myself with WordPress as a blogging platform among other things for my job.  I help expand/create a growing companies market-share online (and offline) by managing and building the brand and developing high-quality leads and loyal customers by building online funnels fed by SEO traffic and on/offline marketing campaigns.  Other than the design and development costs for our minimum 12 month contract, we operate using a gain-share formula where we receive a percentage of the increased revenue that results from our services.  This translates to fanatical attention to improving the bottom-line, and focus on long-term sustainable growth and overall success.<br class="C" /></p>

<p>It's important to me to note that unlike most systems set up like this, we are absolutely interested in creating customers/leads/whatever by providing real value for them.  It's much more difficult and takes a lot longer, but it is also self-sustaining as value attracts in an exponential manner.  We are likely different than any model you've seen before in terms of lead-sales-marketing types.</p>


<h3>My Background</h3>
<p>I started on DOS, then Windows 2.11 (released 1989), and learned BASIC for my first language...  then IBM PC assembly followed by Java, which I used as an excuse to stop learning assembly..  And the visual studio suite I used for several years around win95 era.  Hearing so much about linux I went out and immersed myself in Red Hat, which had great documentation and books.  Then came the BSD's..  The first computer I had access to was DOS but not windows yet, so thats why I learned the BASIC languages.  I liked DOS so much I got some DOS POWER TOOLS books from PC Mag and was able to do whatever.  DOS was like my gameboy or xbox, and knowing it so well has really come in handy since a form of DOS is still to this day in Windows, it's kinda like having cheat codes.</p>

<p>C and C++ are the only languages I ever took a class on in school and I know them decent enough.  The thing is, I've spent my whole computer life reverse-engineering everything I can get ahold of, and so I read source code more than I would care to say.  Almost all of it is C, perl, or more unusual stuff like yacc, bison, or some type of scripting.   Sometimes I get my best ideas from reading source code and am always looking for new more optimized ways to get something done in the worlds best code.  I read it like a book more than code because I've just been doing that my whole life.  Nobody said hey here's a computer, this is called DOS, and here's how you do this:..  I literally didn't even know what a computer did, so I learned DOS at first by traversing the whole dir-tree and trying to open everything.  The worst part is that unlike any linux windows doesn't have any kind of man pages, so I learned by doing something and seeing what happened!  It's amazing what you can learn by viewing every file included with an operating system, and that was my start.</p>

<p>I've used javascript for maybe 10 years.. CSS and xhtml I've learned in great detail since 03.  Flash, actionscript, pretty much anything ever released by Adobe/Macromedia I've been using since 2000.  PERL was the first main language I learned when I switched to linux, I also code in PYTHON, RUBY, and OCAML, but now I use PHP more than anything for web dev.</p>

<p>The only formal programming classes I've taken was a semester of C in a high school AP class back in the day.   BASIC and QBASIC was a game to me, found it by accident.  At that point I was maybe around 8 or so, and I went to the public library and got a book on Assembly called (<em>it's currently sitting on my bookshelf</em>) "Assembly language primer for the IBM PC and XT".  I remember going through it page by page and taking detailed notes and following along with the book.  Definately the hardest thing I had ever tried to learn in my life, but I stuck with it for a whole summer since I didn't know any better, and wrote a few simple programs from within DOS.   I'm convinced that experience of trying to learn assembly before even knowing much about ocmputers is the reason why I find languages so intuitive, nothing else I code is even close to being as difficult as learning assembly, which is about as low-level as you can get, its been around for over half a century.</p>

<p>So I'm definately not even close to being as good as the best coders of the world and their various specialty languages..  But on the other hand I am totally flexible attaining the best possible solution, so it's like the Bruce Lee method of having no method, and this lets me be extremely flexible when going about trying to find the best solution.  I look at the whole spectrum from the network level to the host and app level and my experience at reverse-engineering security, networks, and software gives me a very different way of looking at things.  Coders are taught to plan and build from start to finish.  I have always done the exact opposite.  Once I know the finish point it's a done deal, I will be able to get there no matter what and the code is usually much smaller and leaner doing it that way..  Or maybe I'm just dyslexic or something like that.</p>

<p>Of all the areas of study relating to computers, I was most fascinated with networking and communication, and wanted to reverse-engineer everything to really understand it.  Somehow I figured out how to use the hyperterm of windows 3x and hooked the computer up like the fax machine was and all of a sudden my world became much much bigger as I discovered the web, arpanet,gopher repos, telnet servers, etc..  </p>

<p>I frequented BBS's regularly before the "Internet Browser" became available with mosaic.  At that time before HTTP was standardized it was like, 100% text only, no presentation or style.. it was all about the content.  I taught myself how to use terminal and a modem to wardial (calling phone numbers sequentially searching for a computer) based on that old War Games movie, and it actually worked.  The first machine I got access to in this way was a Sun machine used by a library.  That was my first network experience and within 5 years me and a couple friends had gained access to machines all over the world, including the Indianapolis International Airport Ticket Terminals and the Air Traffic Control itself!  But then HTTP and Mosaic exploded on the scene and were soon followed by the great censor AOL.  After the novelty wore off and everyone used AOL, that's when today's Internet was born in my opinion.  AOL censored the net and was really it's own network, and that is what people got used to thinking about the Internet in terms of what it was.</p>



<h3>Security Focus</h3>
<p>Most people like me who were lucky enough to discover the Internet (gopher, ftp, etc.) at the time when you could only surf the web using text-based tools were also lucky to learn alot of great security information that was freely shared all over the world by various hackers and groups.</p>

<h3>Security Path</h3>
<p>From those early days on I was heavily involved in the security research scene, mostly networking security, then server/application security.  I know quite a bit about the malicious activities one hears about from time to time, but other than learning how they work and how to execute them (against a test system mostly) I stayed away from cracking.</p>
<p>Of course back in those days I would occasionally create a virus or trojan but just for fun and not for exportation.  Does anyone else remember all those automatic virus creation tools that came out once Windows 95 was released?  Haha those old progs rock!<br class="C" /></p>


<h2>Working for an ISP</h2>
<p>Around the turn of the Millenium I worked for a small Internet Service Provider.  I learned how to wire buildings, houses, and the networking devices required by the ISP to connect to the backbone and customers.  My boss's previous job was for the US Military, and all he could tell me about his work there was that it was top-secret cryptography work.  I learned alot about OS security and Network Security while working there.</p>

<p>The coolest thing about working for an ISP was learning about the Networking and Administrative capabilities and requirements specific to ISP's..  I learned how to setup, operate, debug, and admin switches, hubs, routers, servers, backup systems, ISDN connects, etc..</p>

<h2>Unix - Linux - BSD</h2>
<p>Working at the ISP opened my eyes to the power of BSD/Unix, and I've spent almost a decade using hundreds of linux distro's and all BSD flavors.  My favorite Linux distro's are Arch Linux, BackTrack 4, Gentoo, Ubuntu, and Slackware, in that order.  I love debian.  I run OpenBSD 24/7 but I also always like to have 1 computer running FreeBSD for "fun."</p>

<h2>Education Background</h2>
<p>For a longgg time I was planning on going to school for an advanced network security degree, available at only a couple of colleges in the whole country.  So I took all the networking/computer courses available at my college, and I even managed to convince the Department Head to allow me to skip all pre-requisites for any CIS courses and enrolled as a freshmen in the advanced classes.</p>

<p>I was immediately frustrated with the curriculum, none of it was challenging or new... it was just the same boring path towards a degree :(.  So I kept the books, ditched class for a couple years, and went into business for myself doing freelance custom security audits for organizations and interested parties. That allowed me to spend my time hacking and educating myself, and paid the rent in my one-bedroom apartment.</p>

<h2>Employed as a Security auditor/analyst</h2>
<p>For about 5 years I helped small but very privacy-conscious organizations identify exploits in their operations and policies.. Basically I hacked until I got in or got fired.. A couple times I got root the same day I started the initial recon, but those were ALL Windows machines run by amateurs so it doesn't really count..</p>

<p>Most of the time it would take several weeks or months of mapping.. probing.. reading.. reading.. reading.. and packet-crafting before I had to give up on what I think of as the <strong>Technical phase</strong> of an operation.  I was unsuccessful many, many, times at this phase, but rarely unsuccessful after the second phase, which is where I would utilize sneaky social engineering.</p>

<p>One technique that worked extremely well was to spoof an email from some service company used by the target organization to an employee's email account and immediately call that employee and walk them through opening the email and unknowingly installing my customized trojan.  The customized trojans were really devious and really really cool.  These were the precursors to the IRC botnet virii.  Once I had the trojan installed I could generally get to any computer on the network within a day or two.</p>

<h3>Areas I worked in</h3>
<p>While I was a security consultant I was basically a Jack-of-all-trades kind of resource.  The audits I performed were incredibly lengthy and all were done remotely.  Meaning that I wasn't going to visit your organization and run diagnostics and security scanners on your internal network, I would literally insist that my clients only provide me with a public facing node, mostly a domain/server address.</p>

<p>This allowed me to perform the audit the same way that a real hacker would.  And which was a methodology I had used for several years and was comfortable with.  The goal with every audit was to systematically look for vulnerabilities or misconfigurations that when exploited would provide me with root access to the internal/external network of the organization.</p>

<p>Most of the exploits that I used to gain access were application-level vulnerabilities like sendmail, ssh, phpBB, shopping carts, etc..  Nothing very advanced, just a lot of research and testing.</p>

<p>Once I achieved access (a few times I was totally unsuccessful) and outlined how I did it and/or how to fix the vulnerabilities I was basically done.  More often than not my clients would be pretty happy about my services and would ask me to do other misc. work.</p>

<p>I was involved in securing and locking down many web applications like phpBB, Joomla, Shopping carts, etc.. and also was hired to setup or re-configure servers and software to be more secure.</p>

<p>Alot of my clients would want hire me to provide information about someone.  I would be enlisted to trace and locate various entities, such as:</p>
<ul>
<li>The source of a DDOS attack against a website (potentially one hired by a competitor)</li>
<li>A spammer masquerading as my client</li>
<li>A cracker selling stolen credit card numbers or other merchandise on the internet black market</li>
<li>A person spreading lies or talking bad about my client on the Web</li>
</ul>

<p>I became pretty proficient at being able to identify, find, and locate anyone using the Internet for communication.  For example, many times a client would locate some private information that wasn't supposed to be public posted anonymously on some forum or message board or email.  I was very successful at this, and I don't think I ever failed to trace the owner of an email account.  This activity got me involved with honeypots and honeynets, among other tracking tech.</p>


<h2>Leaving Security to Pursue Web Development</h2>
<p>So I was all fired up to get my Masters degree from the best school in the country and that degree would guarantee me a good job in a field I absolutely love, but around 2006 I switched.</p>


<h3>Government, Public Sector, Private Sector Security Ambitions</h3>
<p>Ok so in the security world, everybody knows that Governments have the best toys, the secret technology, carte blanche for its employees, basically everything on my "Top 10" list.  But most people also know that the Government doesn't pay very well and there are some personal security concerns that crop up when working for a Superpower.  I disdain money..To me its an invention someone came up with a long time ago, and I won't let the economic vultures steal my dreams.</p>

<p>After graduation I was interested in working for the US Air Force, which has some of the highest tech in the world, or for an intelligence-related government agency.  I am not that into cryptography, so the NSA didn't look like a good fit.  Today there are dozens of Government computer security agencies and groups, and most of the major nations are building the armies of the future cyber wars today and have been for years.  Some big players:  China, U.S., Soviet-Union Countries, N. Korea, Italy, France, Japan, and Germany.</p>


<h3>Exact Moment I switched to Web Development</h3>
<p>Of course security means constant never-ending research, and I had been researching the possible ways of exploiting a systems security by hijacking the boot-up process.  Mostly this requires physical access, such as plugging in a USB drive, CD, serial line, etc.. But I was also learning about the boot process that networking devices like switches and routers execute.  Many of these devices automatically look for configuration files, operating-system upgrades, or boot files on their network while booting up, and to make a long subject short by using some network hacking you could talk to these devices and provide them with modified files, effectively taking over the device.</p>

<p>For regular computers I was learning about the various boot loaders used by the different operating systems like Windows, BSD, Linux, etc.. (think grub, lilo, etc.).  The exciting thing I learned was that all these OS's that can be booted from a floppy or CD basically can write data directly to specific areas on the actual root drive...</p>

<p>During my research of the various OS's boot process (from when you turn on the machine to when the operating system starts) I learned alot about rootkit technology.. kernel-level rootkits interested me and led me to some very dangerous areas on the net.  At this point I was surfing the web from a Linux machine using a VMWare Virtual workstation for extra protection.  That machine's internet connection came through a customized OpenBSD Machine that was running Snort for Intrusion Detection and IPTables - a fully stateful firewall.  That firewall was connected to the net through an additional Stateful firewall/router.  So I was being very very careful to avoid getting cracked.</p>

<p>I won't divulge what exactly I was researching, but I discovered an incredible resource of information on some security topics that I had never before (or since) seen.  The day after I found this site my VMware workstation was rooted, my underlying linux operating system was rooted, and my firewall/IDS was rooted. Luckily I had configured an older 3rd machine as a syslog server and cut the TX wires so it was invisible, and thats how I discovered the intrusion.  All I will say about it is that the intrusion was so sophisticated and the attackers tracks so well covered that I took out all the hard-drives and put them in storage so I could examine them in a few years with better tools and hopefully I can discover the methods used by the attacker and maybe discover where they came from.  Needless to say, I was out of my league and someone was watching me.</p>


<h2>Web Development Opportunity</h2>
<p>So I had spent all those years learning about the vulnerabilities of various software and hardware, and then learning how to fix and correctly setup and run them.  I already knew html, javascript, basic perl/php/shell-scripting, and I was experienced at running and administrating web servers at this point, so when one of my clients called me late on a Friday and begged me to help them build a website due on Monday I decided to give it a shot.</p>

<h3>My First Website</h3>
<p>OWWW!  Thats me howling in pain when I recall that weekend of web design hell.  I built the whole site using Microsoft Frontpage, something which should be outlawed, and not knowing much about CSS I built the whole 4 page site using HTML tables.</p>

<p>The site was completed on time and opened my eyes to the endless possibilities of web development.  I spent the next year trying to MASTER CSS and best-practice standards-based coding, then I learned more about Ajax and javascript, and also started using server-side programming quite a bit.</p>

<p>My first 10 or so websites were each drastically better than the last, and all of them were created by hand in code without templates of any kind.  A good 15+ page site would take me about 3weeks to 5weeks to complete back then, now I build online presence's designed to increase the clients bottom line.  This includes everything and anything our client wants and to start we do a 1year contract, it takes a lot of time and effort over a long period to really achieve greater market share (leads) using the web in high-competition markets.  I tell the sales/marketing people who work with me to tell the clients that we can do anything, because we pretty much can.  I'm just so thrilled at how easy all this web development stuff is compared to the security stuff... It's night and day and I'm really enjoying myself.</p>



<p><a id="partnerup" name="partnerup"></a></p>
<h2>Ideal Candidate looking to work with me</h2>
<ol>
    <li>The right attitudes</li>
    <li>Willing to challenge and be challenged</li>
    <li>Scrappy &amp; will do whatever it takes</li>
    <li>High attention to detail</li>
    <li>Want to make history not read it</li>
    <li>You have a history of achievement at whatever level you've been at.</li>
    <li>You are the best person you know at what you do.</li>
    <li>You are faster than fast</li>
    <li>You can be competitive but nice at the same time</li>
    <li><strong>Skills</strong></li>
</ol>

<p>If you fit these characteristics then you should definately NOT send your resume as I hate computer science resumes, what a freaking waste of time.  I don't care if you are physically and mentally handicapped or even completely just a repulsive individual :)  Truly, the only thing that counts with me is skills. . .  either technical prowess or non-technical business know-how -- I always enjoy meeting new people in the industry so send me an email and introduce yourself, It's great fun to call up fellow developers in London and Japan... Feels cool so it must be!</p>










<h3>Technology Interests</h3>
<ol>
    <li><strong>CSS</strong></li>
    <li><strong>XHTML</strong> (<em>strict!</em>)</li>
    <li><strong>Javascript</strong> (<em>unobtrusive, strict!</em>)</li>
    <li><strong>NetSec</strong> (<em>network security, hack the planet</em>)    </li>
    <li><strong>PHP, Python, Ruby, Perl, Ocaml, Shell-Scripting</strong> (<em>strict mostly!</em>)</li>
    <li><strong>AJAX</strong> (<em>strict,crossbrowser,degrades gracefully!</em>)</li>
    <li><strong>Linux</strong> <em>{Arch-Linux, Slackware, Gentoo, Red Hat, Fedora}</em></li>
    <li><strong>BSD/Unix</strong> <em>{OpenBSD, FreeBSD, NetBSD}</em></li>
    <li><strong>Software</strong> <em>{Photoshop, Dreamweaver, Sorenson, Flash, QuickTime, ffmpeg, nirsoft, sysinternals, Adobe Creative Suite, etc.}</em></li>
    <li><strong>Windows</strong> <em>{for Workgroups, 3.1, 95, 98, me, 2000, NT Workstation&amp;Server,  XP Pro&amp;Home SP1&amp;SP2}</em></li>
    <li>And of course, if not especially, the <strong><a href="http://www.askapache.com/htaccess/htaccess.html">Apache Web Server, .htaccess, and mod_rewrite</a>!</strong></li>
</ol>



<h3>AskApache.com Info</h3>
<ol>
    <li><a href="https://plus.google.com/101616558702207714980" rel="me">Google +</a></li>
    <li>Popular Web Design and Development Blogs on Google</li>
    <li><a href="http://www.alexa.com/topsites/category/Top/Computers/Internet/Web_Design_and_Development/Weblogs">Top Weblogs on Alexa</a></li>
    <li><a href="http://www.technorati.com/people/technorati/askapache">Technorati</a></li>
    <li><a href="http://twitter.com/AskApache">AskApache Twitter</a></li>
    <li><a href="http://profile.typekey.com/AskApache/">Typekey</a></li>
    <li><a href="http://askapache.stumbleupon.com/">Stumbleupon</a></li>
    <li><a href="http://www.last.fm/user/AskApache">Last.fm</a></li>
    <li><a href="http://www.seomoz.org/users/view/25352">seomoz</a></li>
    <li><a href="http://www.livejournal.com/userinfo.bml?userid=15825935&amp;t=I">LiveJournal</a></li>
    <li><a href="http://digg.com/users/apachehtaccess">Digg</a></li>
    <li><a href="http://flickr.com/people/htaccess/">Flickr</a></li>
    <li><a href=" http://www.mybloglog.com/buzz/members/AskApache">MyBlogLog</a></li>
    <li><a href="http://wordpress.org/extend/plugins/profile/askapache">WordPress Plugins</a>, <a href="http://wordpress.org/support/profile/407510">Support Forum</a>, <a href="http://codex.wordpress.org/User:AskApache">Codex Wiki</a></li>
    <li><a href="http://www.blogcatalog.com/user/askapache">BlogCatalog</a></li>
</ol>


<h2>More AskApache</h2>
<ol>
    <li><a rel="nofollow" href="http://www.blogcatalog.com/blogs/askapache-web-fire.html">BlogCatalog</a></li>
    <li><a rel="nofollow" href="http://www.statsaholic.com/askapache.com">StatsAholic</a></li>
    <li><a rel="nofollow" href="http://www.alexa.com/data/details/main?url=askapache.com">Alexa</a></li>
    <li><a rel="nofollow" href="http://www.technorati.com/search/askapache.com">Technorati</a></li>
    <li><a rel="nofollow" href="http://siteanalytics.compete.com/askapache.com/">Compete</a></li>
    <li><a rel="nofollow" href="http://www.quantcast.com/askapache.com">Quantcast</a></li>
    <li><a rel="nofollow" href="http://whois.domaintools.com/askapache.com">DomainTools</a></li>
    <li><a rel="nofollow" href="http://search.live.com/results.aspx?q=%2Bsite%3Awww.askapache.com">Live</a></li>
    <li><a rel="nofollow" href="http://www.google.com/search?q=site%3Aaskapache.com">Google</a></li>
    <li><a rel="nofollow" href="http://www.findforward.com/?q=askapache&amp;t=world">FindForward</a></li>
    <li><a href="http://www.alexa.com/topsites/category/Top/Computers/Internet/Web_Design_and_Development/Weblogs">Alexa Directory</a><a href="http://www.alexa.com/search?q=askapache.com">Alexa Info</a></li>
    <li><a rel="nofollow" href="http://www.mybloglog.com/buzz/community/apache-htaccess/">MyBlogLog htaccess Group</a></li>
</ol>


<h2>AskApache mirrors</h2>
<p>Every once in awhile I come across a project that is so indescribably great that I decide to help out by mirroring and contributing to the content.</p>
<ul>
    <li><a href="http://curl.askapache.com/" title="curl, libcurl">cURL / libcurl</a></li>
    <li><a href="http://nongnu.askapache.com/" title="Savannah Non-gnu free software">Savannah - nongnu</a></li>
    <li><a href="http://wireshark.askapache.com/" title="WireShark">WireShark Network God</a></li>
</ul>
<p><em>Google if you are reading this, I'm willing to relocate. ;)  Microsoft, no thanks.</em></p><p><a href="http://www.askapache.com/about"></a><a href="http://www.askapache.com/about">About AskApache</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/about/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Encrypted WordPress / phpBB Backups</title>
		<link>http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html</link>
		<comments>http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html#comments</comments>
		<pubDate>Mon, 04 Aug 2008 16:28:00 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Shell Scripting]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1049</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL hs hs11" href='http://www.askapache.com/linux/encrypted-wordpress-site-backups.html' title="Bash Shell Script for Encrypted WordPress and phpBB Backups"></a>Enter your DOMAIN_ROOT and the location of your wp-config.php or config.php, and this script finds all the mysql settings by parsing the phpbb or wordpress config file, then creates GPG encrypted backups, and saves your settings for future automation.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html"></a><a href="http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html"><cite>AskApache.com</cite></a></p><p><a rel="lb" class="IFL hs hs11" href='http://uploads.askapache.com/2008/07/sbackup.png' title="Bash Shell Script for Encrypted WordPress and phpBB Backups"></a>Because backups contain all your sensitive information, its smart to encrypt any sql backups.. and while we're at it, also encrypt any site backups.<br /><br />This simple shell-script is a useful and easy way to securely backup your wordpress and/or phpBB site files and database without confusing you.  Just generate a GPG key once, enter in 3 settings once, and from then on it runs without any user-input whenever you want.<br class="C" /></p>


<h2>What it Does</h2>
<p>When run, this script asks you for the location of your websites document root and the location of your wp-config.php or config.php file.  It also asks you for your encryption UID.  Then this script saves those settings in a file called .sbackup so that the next time you run the script it will run without having to re-enter that information, making it nice for cronjobs or quick and easy on-demand backups.  Another cool feature that I added is this script automatically parses your wp-config.php file for the mysql database name, user, host, and password, meaning you don't have to compromise your security or take the time to type those settings in manually.</p>


<h2>What is Backed Up</h2>
<p>This script creates a tarred and gzipped archive of your entire document root in the folder <code>~/backups/domain.com/domain.com-date.tgz</code> and also creates a backup of your WordPress database and phpBB database in a format that is ideal for restoring from.  Both of these files are then encrypted using your GPG key and can then be safely downloaded as a password and key is required to decrypt them.</p>


<h2>Generating a GPG Key</h2>
<p>If you don't already have one setup for your shell account run this command remembering the uid which you will enter in the shell script.</p>
<pre>gpg --gen-key</pre>

<h3>Decrypting Files</h3>
<pre>gpg -r UID --output FILENAME.tgz --decrypt FILENAME.tgz.asc</pre>


<h2>The Shell Script</h2>
<p><a href='http://uploads.askapache.com/2008/12/_sbackup.sh'>site-backup.sh</a></p>

<pre>#!/bin/bash
# SiteBack Version 3.3, 2008-12-17
# GNU Free Documentation License 1.2
# 12-17-08 - AskApache (www.askapache.com)
umask 022
&nbsp;
### SHELL OPTIONS
set +o noclobber # allowed to clobber files
set +o noglob # globbing on
set +o xtrace # change to - to enable tracing
set +o verbose # change to - to enable verbose debugging
set -e # abort on first error
shopt -s extglob
&nbsp;
###########################################################################--=--=--=--=--=--=--=--=--=--=--#
###
### SETTINGS
###
###########################################################################==-==-==-==-==-==-==-==-==-==-==#
&nbsp;
DT=$(date +%x); DT=${DT//\/}
DTX=$(date +%x-%H%M); DTX=${DTX//\/}
BDIR=${HOME}/backups
RUN_FILE=${BDIR}/$$.bk.log
MY_CONFIG=".sbackup"
DOMAIN=;DB_NAME=;DB_USER=;DB_PASSWORD=;DB_HOST=;APP_CONFIG=;SQL_DEST=;ARC_DEST=;ENCRYPT_USER=
E_SUCCESS=0;E_YN=0;E_YES=251;E_NO=250;E_RETURN=65;C0=;C1=;C2=;C3=;C4=;C5=;C5=;C7=
&nbsp;
###########################################################################--=--=--=--=--=--=--=--=--=--=--#
###
### FUNCTIONS
###
###########################################################################==-==-==-==-==-==-==-==-==-==-==#
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# script_title
#==-==-==-==-==-==-==-==-==-==-==#
function script_title(){
 local e="\033["
 local l=&#039; ___________________________________________________________________ &#039;
&nbsp;
 # SET WINDOW TITLE AND COLORS IF CLIENT CAPABLE
 case $TERM in xterm*|vt*|ansi|rxvt|gnome*)
 C0="${e}0m";C1="${e}1;30m";C2="${e}1;32m";C3="${e}0;32m";C4="${e}1;37m";C5="${e}1;35m";C6="${e}30;42m"
 esac
&nbsp;
 echo -e "\n${C0}$l${C1}"
 echo -e "|             ${C2}___       __    ___                 __${C1}                |"
 echo -e "|            ${C2}/ _ | ___ / /__ / _ | ___  ___ _____/ /  ___${C1}           |"
 echo -e "|           ${C2}/ __ |(_-&lt;/  &#039;_// __ |/ _ \/ _ \`/ __/ _ \/ -_)${C1}          |"
 echo -e "|          ${C3}/_/ |_/___/_/\_\/_/ |_/ .__/\_,_/\__/_//_/\__/${C1}           |"
 echo -e "|                               ${C3}/_/${C1}                                 |"
 echo -e "|                                                                   |"
 echo -e "|       ${C1}+--${C0} SITE BACKUP SCRIPT Version 3.3${C1}                          |"
 echo -e "${C0}$l\n\n"
}
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# pm
#==-==-==-==-==-==-==-==-==-==-==#
function pm(){
 START=$(date +%s) &amp;&amp; touch ${RUN_FILE}
 case "${2:-title}" in
  "title") echo -en "\n\n${C2}&gt;&gt;&gt; ${C4}${1} ${C0} \n\n"; ;;
   "info") echo -e "${C5}=&gt; ${C4}${1} ${C0}"; ;;
   "item") echo -e "${C4}-- ${C0}${1} "; ;;
 esac
}
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# yes_no
#==-==-==-==-==-==-==-==-==-==-==#
function yes_no(){
 local ans
 echo -en "${1} [y/n] " ; read -n 1 ans
 case "$ans" in
  n|N) E_YN=$E_NO ;;
  y|Y) E_YN=$E_YES ;;
 esac
}
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# do_sleep
#==-==-==-==-==-==-==-==-==-==-==#
function do_sleep (){
 local END DIFF
 echo -en "${C5}${3:-.}"; while [ -r "$RUN_FILE" ]; do sleep ${2:-3}; echo -en "${3:-.}"; done;
 echo -e "${C0}"; sleep 1; END=$(date +%s);DIFF=$(( $END - $START ))
 echo -e "\n${C6} [T: ${SECONDS}] COMPLETED IN ${DIFF} SEC ${C0} \n\n"; sleep 1;
 return 0;
}
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# get_settings
#==-==-==-==-==-==-==-==-==-==-==#
function get_settings(){
 local cha HOSTED_SITES G GG
 clear; script_title
&nbsp;
 if [[ -r "$MY_CONFIG" ]]; then
&nbsp;
  OIFS=$IFS; while IFS=: read DOMAIN DOMAINROOT APP_CONFIG ENCRYPT_USER; do
   DOMAIN=${DOMAIN};
   DOMAINROOT=${DOMAINROOT};
   APP_CONFIG=${APP_CONFIG};
   ENCRYPT_USER=${ENCRYPT_USER};
   #E_YN=$E_YES;
   break
  done &lt;${MY_CONFIG};
  IFS=$OIFS
&nbsp;
 else
&nbsp;
  gpg --list-keys|grep uid.*|awk &#039;{print $2}&#039;
  echo -en "\n What userid to use for encryption?  ";
  read -e ENCRYPT_USER; echo
&nbsp;
  echo -en "\n What domain would you like to backup?  "; read -e DOMAIN; echo
&nbsp;
  echo $PWD
  until [ -d "$DOMAINROOT" ]; do echo -en "\n Folder where config file is located?  ";
  read -e DOMAINROOT; echo; done
&nbsp;
  [[ -r "$DOMAINROOT/config.php" ]] &amp;&amp; APP_CONFIG=$DOMAINROOT/config.php &amp;&amp; DOT=PHP
  [[ -r "$DOMAINROOT/wp-config.php" ]] &amp;&amp; APP_CONFIG=$DOMAINROOT/wp-config.php &amp;&amp; DOT=WP
&nbsp;
  echo $PWD
  until [[ -r "$APP_CONFIG" ]]; do echo -en "\n Where is the applications config file?  "; read -e APP_CONFIG; echo; done
&nbsp;
 fi
&nbsp;
  [[ -r "$DOMAINROOT/config.php" ]] &amp;&amp; APP_CONFIG=$DOMAINROOT/config.php &amp;&amp; DOT=PHP
  [[ -r "$DOMAINROOT/wp-config.php" ]] &amp;&amp; APP_CONFIG=$DOMAINROOT/wp-config.php &amp;&amp; DOT=WP
&nbsp;
  ### For phpBB
  if [[ "${DOT}" == "PHP" ]]; then
    GG=$(sed -e &#039;/$db\(n\|u\|pa\|h\)/!d&#039; -e "s/$db_\(name\|user\|passwd\|host\)\ =\ &#039;\([^&#039;]*\).*\$/\1=&#039;\2&#039;;/g" -e &#039;s/$db/DB_/g&#039; ${APP_CONFIG});
    G=$(echo ${GG}|sed -e &#039;s/DB_name/DB_NAME/g&#039; -e &#039;s/DB_user/DB_USER/g&#039; -e &#039;s/DB_passwd/DB_PASSWORD/g&#039; -e &#039;s/DB_host/DB_HOST/g&#039;);
  else
    G=$(sed -e "/define(&#039;DB_\(NAME\|USER\|PASSWORD\|HOST\)/!d" -e "s/[^&#039;]*&#039;DB_\(NAME\|USER\|PASSWORD\|HOST\)&#039;[^&#039;]*&#039;\([^&#039;]*\)&#039;.*$/DB_\1=&#039;\2&#039;;/g" ${APP_CONFIG})
  fi
  eval $G;
&nbsp;
 mkdir -p ${BDIR}/${DOMAIN}
 SQL_DEST=${BDIR}/${DOMAIN}/${DOMAIN}-${DT}.sql;
 [[ -r "${SQL_DEST}.asc" ]] &amp;&amp; SQL_DEST=${BDIR}/${DOMAIN}/${DOMAIN}-${DTX}.sql
&nbsp;
 ARC_DEST=${BDIR}/${DOMAIN}/${DOMAIN}-${DT}.tgz;
 [[ -r "${ARC_DEST}.asc" ]] &amp;&amp; ARC_DEST=${BDIR}/${DOMAIN}/${DOMAIN}-${DTX}.tgz
&nbsp;
 if [[ "$E_YN" != "$E_YES" ]]; then
  for a in "DOMAIN" "DOMAINROOT" "APP_CONFIG" "ENCRYPT_USER" "DB_NAME" "DB_USER" "DB_PASSWORD" "DB_HOST"; do echo -e "${a}: ${!a}"; done
  echo; yes_no "ARE THESE SETTINGS CORRECT"
 fi
&nbsp;
 while [[ "$E_YN" != "$E_YES" ]]; do
  for a in "DOMAIN" "DOMAINROOT" "APP_CONFIG" "ENCRYPT_USER" "DB_NAME" "DB_USER" "DB_PASSWORD" "DB_HOST"; do
   echo -en "\n (Enter for Default: ${!a} )\n ${a}:&gt; "
   read -e cha; echo; [[ ${#cha} -gt 2 ]] &amp;&amp; eval "$a"=$cha
  done
  yes_no "ARE THESE SETTINGS CORRECT"
 done
&nbsp;
 echo -e "${DOMAIN}:${DOMAINROOT}:${APP_CONFIG}:${ENCRYPT_USER}" &gt; $MY_CONFIG
}
&nbsp;
#--=--=--=--=--=--=--=--=--=--=--#
# exit_cleanup
#==-==-==-==-==-==-==-==-==-==-==#
function exit_cleanup(){
 cd $OLDPWD
 [[ -r "${SQL_DEST}" ]] &amp;&amp; rm ${SQL_DEST}
 [[ -r "${ARC_DEST}" ]] &amp;&amp; rm ${ARC_DEST}
}
&nbsp;
############################################################################################################
###
### MAIN CODE
###
############################################################################################################
&nbsp;
#=# CATCH SCRIPT KILLED BY USER
trap exit_cleanup SIGHUP SIGINT SIGTERM
&nbsp;
#=# MAKE MAIN SCRIPT NICE
renice 19 -p $$ &amp;&gt;/dev/null
&nbsp;
cd `dirname $0`
&nbsp;
get_settings
&nbsp;
pm "CREATING SQL BACKUP"
mysqldump --opt -u${DB_USER} -p${DB_PASSWORD} -h ${DB_HOST} -r ${SQL_DEST} --add-drop-table ${DB_NAME} 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; sleep 2 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; rm ${RUN_FILE} 2&gt;&amp;1&amp;
do_sleep 1 1 ":"
&nbsp;
pm "ENCRYPTING SQL BACKUP"
gpg --armor --recipient ${ENCRYPT_USER} --output ${SQL_DEST}.asc --encrypt ${SQL_DEST} 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; sleep 2 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; rm ${RUN_FILE} 2&gt;&amp;1&amp;
do_sleep 1 1 ":"; rm ${SQL_DEST}
&nbsp;
pm "CREATING ARCHIVE BACKUP"
tar -czf ${ARC_DEST} . 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; rm ${RUN_FILE} 2&gt;&amp;1&amp;
do_sleep 1 5 ":"
&nbsp;
pm "ENCRYPTING ARCHIVE BACKUP"
gpg --armor --recipient ${ENCRYPT_USER} --output ${ARC_DEST}.asc --encrypt ${ARC_DEST} 1&gt;&amp;2 &amp;&gt;/dev/null &amp;&amp; rm ${RUN_FILE} 2&gt;&amp;1&amp;
do_sleep 1 1 ":"; rm ${ARC_DEST}
&nbsp;
echo -e "${C1} __________________________________________________________________________ "
echo -e "|                                                                          |"
echo -e "|                 ${C4} COMPLETED SUCCESSFULLY ${C1}                                 |"
echo -e "${C1} __________________________________________________________________________ ${C0} \n\n"
&nbsp;
cd $OLDPWD
&nbsp;
exit $?</pre><p><a href="http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html"></a><a href="http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html">Encrypted WordPress / phpBB Backups</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/shellscript/encrypted-wordpress-site-backups.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

