<?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;  cookies</title>
	<atom:link href="http://www.askapache.com/search/cookies/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Thu, 26 Apr 2012 11:29:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>3 Ways to Serve PDF Files using Htaccess Cookies, Headers, Rewrites</title>
		<link>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html</link>
		<comments>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html#comments</comments>
		<pubDate>Sun, 21 Aug 2011 03:07:53 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=2328</guid>
		<description><![CDATA[<p><a class="IFL" href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"><img height="60" width="45" src='http://uploads.askapache.com/2007/11/60x45_acrobat_trefoil.gif' alt='Adobe PDF' /></a>FYI, using the <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">Mod_Rewrite Variables Cheatsheet</a> makes this example, and all advanced .htaccess code easier to understand.  This demo lets you set a cookie with 1 of 3 values, then you just request the pdf file with a normal link click and get 1 of 3 different responses. This is accomplished with a nice bit of <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> code.<br class="C" /></p>
<div class="cnote">
<p><strong>Set PDF Viewing Mode</strong> - <kbd id="pdfr">Make a selection, then click the view pdf button.</kbd></p>
<p><span id="pdfi" class="FL btnn">Inline</span> <span id="pdfa" class="FL btnn">Download</span> <span id="pdfs" class="FL btnn">Save As</span> <a class="FL btnn" style="margin-left:10px; border-top:1px solid #96F8AF; background:-moz-linear-gradient(center top , #3E9D43, #6ED766) repeat scroll 0 0 transparent;margin-left:20px;" rel="nofollow" href="http://www.askapache.com/storage/pdf/AskApache-Test.pdf">View PDF using selected mode &#187;</a><br class="C" /></p>
</div>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"><cite>AskApache.com</cite></a></p><p><a class="IFL" id="id10" href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a>FYI, using the <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">Mod_Rewrite Variables Cheatsheet</a> makes this example, and all advanced .htaccess code easier to understand.  This demo lets you set a cookie with 1 of 3 values, then you just request the pdf file with a normal link click and get 1 of 3 different responses. This is accomplished with a nice bit of <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> code.<br /><br />As I explain the htaccess code that achieves this, keep in mind this is merely one simple application for this code.  It's much more advanced than your basic htaccess trick, notice how this htaccess acts like a php script, very unusual..  I really wanted to share this trick after I created it for one of my clients because this is the tip of the iceberg.  Another use would be to display an alternate style sheet depending on a users theme preference.  The coolest thing is that it uses multiple advanced .htaccess ideas.  This code uses mod_headers to set the Content-Disposition header for forcing a download and uses mod_rewrite to: Send different Content-Type headers, Check the value of a cookie, Set environment variables for use later by mod_headers header directive<br class="C" /></p>

<div class="cnote">
<p><strong>Set PDF Viewing Mode</strong> - <kbd id="pdfr">Make a selection, then click the view pdf button.</kbd></p>
<p><span id="pdfi" class="FL btnn">Inline</span> <span id="pdfa" class="FL btnn">Download</span> <span id="pdfs" class="FL btnn">Save As</span> <a class="FL btnn" style="margin-left:10px; border-top:1px solid #96F8AF; background:-moz-linear-gradient(center top , #3E9D43, #6ED766) repeat scroll 0 0 transparent;margin-left:20px;" rel="nofollow" href="http://www.askapache.com/storage/pdf/AskApache-Test.pdf">View PDF using selected mode &raquo;</a><br class="C" /></p>
</div>


<h2>What's Going On</h2>
<p>There are 3 different ways for a server to send a pdf file in response to a request for one.  This causes 3 different ways to open/view the pdf file in the clients browser.</p>
<ol>
<li>The browser display's a <strong>"Save File As"</strong> dialog, allowing you to save the file or open.</li>
<li>The browser opens the pdf file <strong>"Inline"</strong>, opening the pdf file in the browser like a web page.</li>
<li>The browser "<strong>Downloads</strong>" the pdf file automatically as an "<strong>Attachment</strong>" and then causes an external pdf reader program like adobe reader to open the file.</li>
</ol>
<p>Some people prefer to have the option of saving the file to view later, some prefer opening it with an external program, and some just like the pdf file to load right in the browser...  The point is that by using .htaccess, we can let them choose any of the 3 methods and save their preference for all further pdf files requested from our site by that user.</p>





<h2>How It Works</h2>
<p>When you click on one of the 3 demo buttons above, "Inline", "Save As", or "Download", a cookie named <code>askapache_pdf</code> is saved in your browser using the javascript below, with the value being set to which button you clicked.  Then when you request the pdf file the .htaccess code below uses mod_rewrite to read the value of the askapache_pdf cookie, and depending on which was your preference it will send alternate HTTP Headers that control how your browser handles the file.</p>


<h3>Unique HTTP Headers Returned</h3>
<p>When it comes down to it, the following information is the 3 modes.  Notice each one is different, because these headers are the only thing controlling how your browser handles the file.</p>
<h4>Save As Mode (askapache_pdf=s)</h4>
<pre>Content-Disposition: attachment
Content-Type: application/pdf</pre>
<h4>Inline Mode (askapache_pdf=i)</h4>
<pre>Content-Type: application/pdf</pre>
<h4>Download Mode (askapache_pdf=a)</h4>
<pre>Content-Type: application/octet-stream</pre>


<h3>Htaccess Demo File</h3>
<p>For the demo I created the folder /storage/pdf/ and this is the .htaccess file at /storage/pdf/.htaccess</p>
<p>The default Content-Type for .pdf files.  This will make .pdf files default Content-Type header have  the value 'application/pdf' - but the default can be overridden by using RewriteRule with the <code>[T=&#039;different/type&#039;]</code></p>
<pre>AddType application/pdf .pdf</pre>

<p>Turn on the rewrite engine if its already on you dont need this </p>
<pre>RewriteEngine On</pre>

<p>Skip RewriteRules if not .pdf request, like autoindexing. The next [2] RewriteRule directives are specific for .pdf files so if the filename requested does not end in .pdf then the <code>[S=2]</code> instructs the next 2 RewriteRule  directives to be completely skipped.</p>
<pre>RewriteRule !.*\.pdf$ - [S=2]</pre>


<p>The first RewriteCond checks to see if the askapache_pdf cookie is NOT set.  The second RewriteCond checks to see if the askapche_pdf cookie has the value of s, which is the value corresponding to someone clicking the "Save As" button.</p>
<p>The <code>[NC,OR]</code> flag means that if the cookie askapache_pdf does not exist, OR (next cond) if the askapache_pdf cookie does exist and is set to 's' then process the RewriteRule.  If neither cond is true the rewriterule is skipped.</p>
<p>If one of the RewriteCond is true, then the RewriteRule is processed.   The RewriteRule applies to any/all requests (.*) but doesn't rewrite anything (-) This RewriteRule sets an Apache environment variable ASKAPACHE_PDFS to have the value of 1 if either rewritecond is true.  The variable can be checked by any directives following the rewriterule in the whole htaccess file.  The ASKAPACHE_PDFS ends in S because if this variable exists then it means the users preference is 'Save As'</p>
<p>Notice that if the user requested the pdf file without selecting a preference i.e. no cookie exists, then the ASKAPACHE_PDFS variable is still set. This just lets us pick the default preference for them, in this example the default is 'Save As'</p>
<pre>RewriteCond %{HTTP_COOKIE} !^.*askapache_pdf.*$ [NC,OR]
RewriteCond %{HTTP_COOKIE} ^.*askapache_pdf=s.*$ [NC]
RewriteRule .* - [E=ASKAPACHE_PDFS:1]</pre>

<p>The RewriteCond checks the askapache_pdf cookie for the value 'a' which 'a' represents 'Download'</p>
<p>If the cookies value is 'a' then the RewriteRule overrides the default Content-Type from 'application/pdf' set with AddType earlier, to 'application/octet-stream', which is a special content-type that tells the browser that the file cannot be loaded by the browser 'Inline', but must be saved which will be opened by an external viewer depending on browser configuration and plugins.</p>
<pre>RewriteCond %{HTTP_COOKIE} ^.*askapache_pdf=a.*$
RewriteRule .* - [T=application/octet-stream]</pre>

<p>This is superfly.  If the cookie/users-preference was 'Save As' (s) then the RewriteRule above the last one set the environment variable ASKAPACHE_PDFS to have the value 1.  The Header directive here is ONLY processed in that variable ASKAPACHE_PDFS exists.  That is what the end 'env=ASKAPACHE_PDFS' does, it is the condition that must be met or the Header directive is skipped.  If the ASKAPACHE_PDFS environment variable set by RewriteRule does exist then the header directive adds the header '<code>Content-Disposition: attachment</code>' to  the normal Response Headers.  The 'Content-Disposition: attachment' header instructs your browser to present you with the 'Save As' dialog box allowing you to choose whether you want to save or open.</p>
<pre>Header set Content-Disposition "attachment" env=ASKAPACHE_PDFS</pre>






<h2>Javascript used by Demo</h2>
<p>The best place for javascript is quirksmode, here is a definitive article on setting, reading, parsing, etc.. <a title="I am a javascript cookie monster" href="http://www.quirksmode.org/js/cookies.html">COOKIES</a>.</p>
<p>Note, I now prefer using jQuery over my AAJS javascript library.  Also, the whole using cookies aspect is just to highlight some advanced htaccess, you can accomplish this much easier without javascript or cookies.</p>
<pre>if(!gi(&#039;pdfr&#039;))return;
var pdfr=gi(&#039;pdfr&#039;);
var cval=getCookie(&#039;askapache_pdf&#039;);
&nbsp;
if(cval==&#039;i&#039;){pdfr.innerHTML=&#039;Currently set to "Inline".&#039;;}
else if(cval==&#039;a&#039;){pdfr.innerHTML=&#039;Currently set to "Download" mode.&#039;;}
else if(cval==&#039;s&#039;){pdfr.innerHTML=&#039;Currently set to "Save As" mode.&#039;;}
&nbsp;
addMyEvent(gi(&#039;pdfi&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "i", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Inline".&#039;; return false; });
addMyEvent(gi(&#039;pdfa&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "a", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Download".&#039;; return false; });
addMyEvent(gi(&#039;pdfs&#039;),"mousedown",function(){
  setCookie("askapache_pdf", "s", "", "/", "www.askapache.com"); gi(&#039;pdfr&#039;).innerHTML = &#039;Changed mode to "Save As".&#039;; return false; });</pre>

<h2>Alternative Method - No Cookies + PHP</h2>
<p>This is what I came up with first for my client, and then while programming the php I noticed.. Hey!  I think I can do the same thing using .htaccess, which would save me on cpu/memory/potential security/etc.. but this works great too.  Though you will need to hack the code to get it working probably..</p>
<p>Note that the .htaccess rewrite code I used here used FILENAME-i.pdf or FILENAME-s.pdf to pass the preference to the pdf-dl.php script, it also worked for FILENAME.pdf?i=i</p>

<h3>pdf-dl.php</h3>
<pre>&lt;?php
if (
  !isset($_GET[&#039;file&#039;])
  || ($f=$_GET[&#039;file&#039;])===false
  || ($fp=@fopen($f,"rb"))===false
  || ($fi=pathinfo($f))===false
  || ($fi[&#039;fsize&#039;]=filesize($f))===false
  || strtolower($fi["extension"])!=&#039;pdf&#039;
) die(&#039;Failed&#039;);
&nbsp;
ob_start();
header(&#039;Accept-Ranges: bytes&#039;);
header("Content-Length: {$fi[&#039;fsize&#039;]}");
header(&#039;Content-Type: application/pdf&#039;);
if(!isset($_GET[&#039;i&#039;])) header("Content-Disposition: attachment; filename=\"{$fi[&#039;basename&#039;]}\"");
&nbsp;
$sent = 0;
while ( !feof($fp) &amp;&amp; $sent &lt; $fi[&#039;fsize&#039;] &amp;&amp; ($buf = fread($fp, 8192)) != &#039;&#039; ){
  echo $buf;
  $sent += strlen($buf);
  flush();  ob_flush();
}
fclose($fp);
exit;
?&gt;</pre>


<h3>Alternate Method .htaccess</h3>
<p>Deny direct request to pdf-dl.php file</p>
<pre>RewriteCond %{THE_REQUEST} ^.*pdf-dl\.php.*$ [NC]
RewriteRule .* - [F]</pre>
<p>Handle PDF files named anything-i.pdf as inline</p>
<pre>RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^/]*)-i\.pdf$  /cgi-bin/pdf-dl.php?i=i&amp;file=%{DOCUMENT_ROOT}/storage/pdf/$1.pdf [L,NC,QSA,S=1]</pre>
<p>Handle PDF files without -i.pdf as attachments</p>
<pre>RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^/]*)\.pdf$  /cgi-bin/pdf-dl.php?file=%{DOCUMENT_ROOT}/storage/pdf/$1.pdf [L,NC,QSA]</pre>




<h2>More Info</h2>
<p>The following is more information about the Content-Dispositon header and related subjects for fast readers.</p>

<h3>Interesting Reading</h3>
<p>Here is the thread of the original draft proposal for the Content-Disposition header.</p>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03620.html">Content-Disposition Header</a>, <em>Rens Troost - 22 Jun 1993</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03629.html">Re: Content-Disposition Header</a>, <em>Nathaniel Borenstein</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03630.html">Re: Content-Disposition Header</a>, <em>Gabe Beged-Dov</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03631.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03635.html">Re: Content-Disposition Header</a>, <em>Gabe Beged-Dov</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03641.html">Content-Disposition Header and multipart/alternative</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03645.html">Re: Content-Disposition Header and multipart/alternative</a>, <em>Nathaniel Borenstein</em></li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03632.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03633.html">Re: Content-Disposition Header</a>, <em>Nathaniel Borenstein</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03634.html">Re: Content-Disposition Header</a>, <em>Ed Levinson (Contractor)</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03636.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03640.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em></li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03650.html">Re: Content-Disposition Header</a>, <em>Harald Tveit Alvestrand</em></li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03621.html">Re: Content-Disposition Header</a>, <em>Steve Dorner</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03622.html">Re: Content-Disposition Header</a>, <em>Rens Troost</em>
<ul>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03624.html">Re: Content-Disposition Header</a>, <em>Keith Moore</em></li>
</ul>
</li>
</ul>
</li>
<li><a href="http://www.imc.org/ietf-822/old-archive1/msg03652.html">Re: Content-Disposition Header</a>, <em>Carlyn M. Lowery</em></li>
</ul>
</li>
</ul>
</li>
</ul>



<h3>Intense Reading</h3>
<ul>
<li><a href="http://www2.roguewave.com/support/docs/leif/sourcepro/html/protocolsug/10-1.html">Using the MIME Headers Effectively</a></li>
<li><a href="http://www.iana.org/assignments/mail-cont-disp">Mail Content Disposition Values and Parameters</a></li>
<li><cite><a href="http://rfc.askapache.com/rfc1766/rfc1766.txt">Tags for the Identification of Languages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1436/rfc1436.txt">The Internet Gopher Protocol (a distributed document search and retrieval protocol)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1630/rfc1630.txt">Universal Resource Identifiers in WWW</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1738/rfc1738.txt">Uniform Resource Locators (URL)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1866/rfc1866.txt">Hypertext Markup Language - 2.0</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1945/rfc1945.txt">Hypertext Transfer Protocol -- HTTP/1.0</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2045/rfc2045.txt">Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1123/rfc1123.txt">Requirements for Internet Hosts -- Communication Layers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc822/rfc822.txt">Standard for The Format of ARPA Internet Text Messages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1808/rfc1808.txt">Relative Uniform Resource Locators</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1036/rfc1036.txt">Standard for Interchange of USENET Messages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc977/rfc977.txt">Network News Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2047/rfc2047.txt">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1867/rfc1867.txt">Form-based File Upload in HTML</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc821/rfc821.txt">Simple Mail Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1590/rfc1590.txt">Media Type Registration Procedure</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc959/rfc959.txt">File Transfer Protocol</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1700/rfc1700.txt">Assigned Numbers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1737/rfc1737.txt">Functional Requirements for Uniform Resource Names</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1864/rfc1864.txt">The Content-MD5 Header Field</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1900/rfc1900.txt">Renumbering Needs Work</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1952/rfc1952.txt">GZIP file format specification version 4.3</a></cite></li>
<li><cite>Improving HTTP Latency</cite></li>
<li><cite><a href="http://www.isi.edu/touch/pubs/http-perf96/">Analysis of HTTP Performance</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1305/rfc1305.txt">Network Time Protocol (Version 3) Specification, Implementation and Analysis</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1951/rfc1951.txt">DEFLATE Compressed Data Format Specification version 1.3</a></cite></li>
<li><cite><a href="http://sunsite.unc.edu/mdma-release/http-prob.html">Analysis of HTTP Performance Problems,</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1950/rfc1950.txt">ZLIB Compressed Data Format Specification version 3.3</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2069/rfc2069.txt">An Extension to HTTP: Digest Access Authentication</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2068/rfc2068.txt">Hypertext Transfer Protocol -- HTTP/1.1</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2119/rfc2119.txt">Key words for use in RFCs to Indicate Requirement Levels</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc1806/rfc1806.txt">Communicating Presentation Information in Internet Messages: The Content-Disposition Header</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2145/rfc2145.txt">Use and Interpretation of HTTP Version Numbers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2076/rfc2076.txt">Common Internet Message Headers</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2279/rfc2279.txt">UTF-8, a transformation format of Unicode and ISO-10646</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2046/rfc2046.txt">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2277/rfc2277.txt">IETF Policy on Character Sets and Languages</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2396/rfc2396.txt">Uniform Resource Identifiers (URI): Generic Syntax and Semantics</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2617/rfc2617.txt">HTTP Authentication: Basic and Digest Access Authentication</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2110/rfc2110.txt">MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2026/rfc2026.txt">The Internet Standards Process -- Revision 3</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2324/rfc2324.txt">Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0)</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2049/rfc2049.txt">Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples</a></cite></li>
<li><cite><a href="http://rfc.askapache.com/rfc2183/rfc2183.txt">Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field</a></cite></li>
</ul><p><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html"></a><a href="http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html">3 Ways to Serve PDF Files using Htaccess Cookies, Headers, Rewrites</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Terminal Escape Code Zen</title>
		<link>http://www.askapache.com/linux/zen-terminal-escape-codes.html</link>
		<comments>http://www.askapache.com/linux/zen-terminal-escape-codes.html#comments</comments>
		<pubDate>Wed, 13 Apr 2011 04:00:27 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4113</guid>
		<description><![CDATA[<p><strong>An image and technicacl achievement so profound, it will touch yoour heart</strong>..        So 3D... it'll hurt you eyes!  LOL..  lol.. Man I am cracking up here.  haha  Ha definately the best intro ever, those really do look 3D for terminal though huh.. Sweet.  Here is the little function I wrote to output that grey marble.</p>
<p><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"><img src="http://uploads.askapache.com/2011/04/3db.png" alt="AskApache Conquers the 3rd Dimension in Bash" title="AskApache Conquers the 3rd Dimension in Bash" width="795" height="481" class="alignnone size-full wp-image-4886" /></a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"></a><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"><cite>AskApache.com</cite></a></p><h3>Lightning Strikes Twice!</h3>
<p><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"><img src="http://uploads.askapache.com/2011/04/3da.png" alt="AskApache Conquers the 3rd Dimension in Bash" title="AskApache Conquers the 3rd Dimension in Bash" width="892" height="375" class="alignnone size-full wp-image-4885" /></a></p>
<p>LOL.. </p>
<h2>3rd Dimension Broken with Bash!</h2>
<p><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"><img src="http://uploads.askapache.com/2011/04/3db.png" alt="AskApache Conquers the 3rd Dimension in Bash" title="AskApache Conquers the 3rd Dimension in Bash" width="795" height="481" class="alignnone size-full wp-image-4886" /></a></p>
<p><strong>So 3D... it'll hurt you eyes!</strong>  lol.. Man I am cracking up here.   Ha but seriously those really do look 3D for terminal though..  I am actually really impressed.   Sweet.  Here is the little function I wrote to output that grey marble.</p>

<p class="cnote">Just a word to the wise, start learning and going over some of these concepts, especially the code used in functions, I will be back in a followup that details actually using this stu.


<p>This function is one of my favorites because it is so fast and useful.  Like when designing a 256color prompt.</p>
<pre>
aa_256 ()
{
    local o x=`tput op` y=`printf %$((${COLUMNS}-6))s`;
    for i in {0..256};
    do
        o=00$i;
        echo -e ${o:${#o}-3:3} `tputm "setaf $i" "setab $i"`${y// /=}$x;
    done
}</pre>



<p>Ya this is actually not very helpful or useful, but there you have it.</p>
<pre>tputm ()
{
    local a;
    for a in "$@";
    do
        echo -en "${a}\n";
    done | tput -S
}</pre>



<p>Some people call this function the grey bringer of death.  Not really.</p>
<pre>a256 ()
{
    ( x=`tput op` y=`printf %$((${COLUMNS}-6))slocal `;
    for i in {242..232} 232 232;
    do
        echo -en "`tput setaf $i;tput setab $i`${y}${x}`tput op`";
    done )
}</pre>



<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=348099">Fix screen</a>











<h2>Helpful Ncurses Programs</h2>
<table class="bordered"><tbody><tr class="header"><th>Program Name</th><th>Description</th><th>Example Usage</th></tr>
<tr><td>infotocap</td><td>convert a terminfo description into a termcap description</td><td><code></code></td></tr>
<tr><td>tic</td><td>the terminfo entry-description compiler</td><td><code></code></td></tr>
<tr><td>toe</td><td>table of (terminfo) entries</td><td><code>toe -a|sort -d</code></td></tr>
<tr><td>infocmp</td><td>compare or print out terminfo descriptions</td><td><code>infocmp -a  -L -1 -T -x</code></td></tr>
<tr><td>capconvert</td><td>automated conversion from termcap to terminfo</td><td><code></code></td></tr>
<tr><td>stty</td><td>prints or changes terminal characteristics, such as baud rate.</td><td><code></code></td></tr>
<tr><td>clear</td><td>clears the terminal's screen</td><td><code></code></td></tr>
<tr><td>capconvert</td><td>automated conversion from termcap to terminfo</td><td><code></code></td></tr>
</tbody></table>


<h3>ALWAYS check out my functions!</h3>
<p>This function will print out the terminal, show it's colors, etc..  I have some really nice ones in this article that I use for tmux, screen, and that sort of thing.</p>
<pre>c ()
{
    tput clear;
    pm "$TERM: [colors:`tput colors`/`tput pairs`]";
    RC=`tput op` L1=$(L &#039;=&#039; $(( ${COLUMNS} - 25 )));
    for i in `seq ${1:-0} ${2:-16}`;
    do
        o="  $i";
        echo -e " ${o:${#o}-3:3} `tput setaf $i;tput setab $i`${L1}${RC}";
    done
}</pre>








<h2>Standard Capabilities</h2>
<h4>X.364 and iBCS2</h4>
<ul>
<li><code>\033c</code> - <var>RIS</var> - full reset</li>
<li><code>\0337</code> - <var>SC</var> - save cursor</li>
<li><code>\0338</code> - <var>RC</var> - restore cursor</li>
<li><code>\033[r</code> - <var>RSR</var> - not an X.364 mnemonic</li>
<li><code>\033[m</code> - <var>SGR0</var> - not an X.364 mnemonic</li>
<li><code>\033[2J</code> - <var>ED2</var> - clear page</li>
</ul>

<h4>Specified by ISO 2022</h4>
<ul>
<li><code>\033(0</code> - <var>ISO DEC G0</var> - enable DEC graphics for G0</li>
<li><code>\033(A</code> - <var>ISO UK G0</var> - enable UK chars for G0</li>
<li><code>\033(B</code> - <var>ISO US G0</var> - enable US chars for G0</li>
<li><code>\033)0</code> - <var>ISO DEC G1</var> - enable DEC graphics for G1</li>
<li><code>\033)A</code> - <var>ISO UK G1</var> - enable UK chars for G1</li>
<li><code>\033)B</code> - <var>ISO US G1</var> - enable US chars for G1</li>
</ul>


<h2>ISO 2022 charset switching:</h2>
<ul>
   <li><a href="http://www.iso.ch/cate/d22747.html">ISO/IEC 2022:1994</a> </li>
   <li>"Character code structure and extension techniques" </li>
   <li><a href="http://www.ecma.ch/stand/ECMA-035.HTM">ECMA-035</a> </li>
   <li>code structure
      <ul>
         <li>=00..=1F C0 set of <a href="iso6429.html">control characters</a> </li>
         <li>=20..=7F G0 set of 94 or 96 <a href="iso646.html">graphic characters</a> </li>
         <li>=80..=9F C1 set of control characters "C1 controls" </li>
         <li>=A0..=FF G1 set of 94 or 96 graphic characters </li>
         <li>... G2 and G3 </li>
      </ul>
   </li>
   <li><a href="http://www.iso.ch/infoe/agency/2375.htm">registration authority</a>
      <ul>
         <li><a href="http://www.iso.ch/cate/d7217.html">ISO/IEC 2375:1985</a> Procedure for registration of escape sequences </li>
         <li>"ECMA registry" </li>
         <li>ISO-IR registration number </li>
         <li><a href="ftp://dkuug.dk/i18n/iso2375reg.txt">ftp://dkuug.dk/i18n/iso2375reg.txt</a> </li>
         <li><a href="http://www.itscj.ipsj.or.jp/ISO-IR/practice/practice.html">Internaltional</a> <a href="http://www.itscj.ipsj.or.jp/ISO-IR/">register of coded character sets to be used with escape sequences</a> </li>
         <li><a href="http://www.dkuug.dk/jtc1/sc2/wg3/">ISO/IEC JTC1/SC2/WG3</a> </li>
      </ul>
   </li>
   <li>ISO-2022 terminals from Siemens </li>
   <li>recode iso-2022..<a href="http://web.archive.org/web/czyborra.com/utf/#UTF-8">utf-8</a> not yet
      implemented </li>
   <li><a href="cjk.html">CJK charsets</a>
      <ul>
         <li><a href="ftp://ftp.isi.edu/in-notes/rfc1458.txt">ISO-2022-JP</a> </li>
         <li><a href="ftp://ftp.isi.edu/in-notes/rfc1554.txt">ISO-2022-JP-2</a> </li>
         <li><a href="ftp://ftp.isi.edu/in-notes/rfc1557.txt">ISO-2022-KR</a> </li>
         <li><a href="ftp://ftp.isi.edu/in-notes/rfc1922.txt">ISO-2022-CN</a> </li>
         <li><a href="ftp://ftp.isi.edu/in-notes/rfc1922.txt">ISO-2022-CN-EXT</a> </li>
      </ul>
   </li>
</ul>


<h4>DEC private controls widely supported by emulators</h4>
<ul>
<li><code>\033=</code> - <var>DECPAM</var> - application keypad mode</li>
<li><code>\033&gt;</code> - <var>DECPNM</var> - normal keypad mode</li>
<li><code>\033&lt;</code> - <var>DECANSI</var> - enter ANSI mode</li>
<li><code>\033[!p</code> - <var>DECSTR</var> - soft reset</li>
<li><code>\033 F</code> - <var>S7C1T</var> - 7-bit controls</li>
</ul>


<h3>ECMA modes</h3>
<h4>ISO 2022</h4>
<ul>
<li><code>2</code> - <var>AM</var> - keyboard action mode</li>
<li><code>4</code> - <var>IRM</var> - insert/replace mode</li>
<li><code>12</code> - <var>SRM</var> - send/receive mode</li>
<li><code>20</code> - <var>LNM</var> - linefeed mode</li>
</ul>

<h3>DEC modes</h3>
<ul>
<li><code>1</code> - <var>CKM</var> - application cursor keys</li>
<li><code>2</code> - <var>ANM</var> - set VT52 mode</li>
<li><code>3</code> - <var>COLM</var> - 132-column mode</li>
<li><code>4</code> - <var>SCLM</var> - smooth scroll</li>
<li><code>5</code> - <var>SCNM</var> - reverse video mode</li>
<li><code>6</code> - <var>OM</var> - origin mode</li>
<li><code>7</code> - <var>AWM</var> - wraparound mode</li>
<li><code>8</code> - <var>ARM</var> - auto-repeat mode</li>
</ul>

<h3>ECMA attribute sequences</h3>
<ul>
<li><var>0</var> - <code>NORMAL</code> - normal</li>
<li><var>1</var> - <code>+BOLD</code> - bold on</li>
<li><var>2</var> - <code>+DIM</code> - dim on</li>
<li><var>3</var> - <code>+ITALIC</code> - italic on</li>
<li><var>4</var> - <code>+UNDERLINE</code> - underline on</li>
<li><var>5</var> - <code>+BLINK</code> - blink on</li>
<li><var>6</var> - <code>+FASTBLINK</code> - fastblink on</li>
<li><var>7</var> - <code>+REVERSE</code> - reverse on</li>
<li><var>8</var> - <code>+INVISIBLE</code> - invisible on</li>
<li><var>9</var> - <code>+DELETED</code> - deleted on</li>
<li><var>10</var> - <code>MAIN-FONT</code> - select primary font</li>
<li><var>11</var> - <code>ALT-FONT-1</code> - select alternate font 1</li>
<li><var>12</var> - <code>ALT-FONT-2</code> - select alternate font 2</li>
<li><var>13</var> - <code>ALT-FONT-3</code> - select alternate font 3</li>
<li><var>14</var> - <code>ALT-FONT-4</code> - select alternate font 4</li>
<li><var>15</var> - <code>ALT-FONT-5</code> - select alternate font 5</li>
<li><var>16</var> - <code>ALT-FONT-6</code> - select alternate font 6</li>
<li><var>17</var> - <code>ALT-FONT-7</code> - select alternate font 7</li>
<li><var>18</var> - <code>ALT-FONT-1</code> - select alternate font 1</li>
<li><var>19</var> - <code>ALT-FONT-1</code> - select alternate font 1</li>
<li><var>20</var> - <code>FRAKTUR</code> - Fraktur font</li>
<li><var>21</var> - <code>DOUBLEUNDER</code> - double underline</li>
<li><var>22</var> - <code>-DIM</code> - dim off</li>
<li><var>23</var> - <code>-ITALIC</code> - italic off</li>
<li><var>24</var> - <code>-UNDERLINE</code> - underline off</li>
<li><var>25</var> - <code>-BLINK</code> - blink off</li>
<li><var>26</var> - <code>-FASTBLINK</code> - fastblink off</li>
<li><var>27</var> - <code>-REVERSE</code> - reverse off</li>
<li><var>28</var> - <code>-INVISIBLE</code> - invisible off</li>
<li><var>29</var> - <code>-DELETED</code> - deleted off</li>
</ul>



<h3>Init strings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td><var>is1</var></td><td>init_1string</td></tr>
<tr><td><var>is2</var></td><td>init_2string</td></tr>
<tr><td><var>is3</var></td><td>init_3string</td></tr>
<tr><td><var>rs1</var></td><td>reset_1string</td></tr>
<tr><td><var>rs2</var></td><td>reset_2string</td></tr>
<tr><td><var>rs3</var></td><td>reset_3string</td></tr>
<tr><td><var>smcup</var></td><td>enter_ca_mode</td></tr>
<tr><td><var>rmcup</var></td><td>exit_ca_mode</td></tr>
</tbody></table>

<h3>Cap strings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>so</td><td>String of commands to enter standout mode.</td></tr>
<tr><td>se</td><td>String of commands to leave standout mode.</td></tr>
<tr><td>sg</td><td>Numeric capability, the width on the screen of the magic cookie.  This capability is absent in terminals that record appearance modes character by character.</td></tr>
<tr><td>ms</td><td>Flag whose presence means that it is safe to move the cursor while the appearance modes are not in the normal state.  If this flag is absent, programs should always reset the appearance modes to normal before moving the cursor.</td></tr>
<tr><td>xs</td><td>Flag whose presence means that the only way to reset appearance modes already on the screen is to clear to end of line.  On a per-character terminal, you must clear the area where the modes are set.  On a magic cookie terminal, you must clear an area containing the cookie. See the discussion above.</td></tr>
<tr><td>xt</td><td>Flag whose presence means that the cursor cannot be positioned right in front of a magic cookie, and that seis a command to delete the next magic cookie following the cursor.  See discussion above.</td></tr>
<tr><td>mb</td><td>String of commands to enter blinking mode.</td></tr>
<tr><td>md</td><td>String of commands to enter double-bright mode.</td></tr>
<tr><td>mh</td><td>String of commands to enter half-bright mode.</td></tr>
<tr><td>mk</td><td>String of commands to enter invisible mode.</td></tr>
<tr><td>mp</td><td>String of commands to enter protected mode.</td></tr>
<tr><td>mr</td><td>String of commands to enter reverse-video mode.</td></tr>
<tr><td>me</td><td>String of commands to turn off all appearance modes, including standout mode and underline mode.  On some terminals it also turns off alternate character set mode; on others, it may not.  This capability must be present if any of mb<small>...</small> mris present.</td></tr>
<tr><td>as</td><td>String of commands to turn on alternate character set mode.  This mode assigns some or all graphic characters an alternate picture on the screen.  There is no standard as to what the alternate pictures look like.</td></tr>
<tr><td>ae</td><td>String of commands to turn off alternate character set mode.</td></tr>
<tr><td>sa</td><td>String of commands to turn on an arbitrary combination of appearance modes.  It accepts 9 parameters, each of which controls a particular kind of appearance mode.  A parameter should be 1 to turn its appearance mode on, or zero to turn that mode off.  Most terminals do not support the sacapability, even among those that do have various appearance modes.  The nine parameters are, in order,
<ol>
<li><var>standout</var></li><li><var>underline</var> </li><li><var>reverse</var> </li><li><var>blink</var> </li><li><var>half-bright</var> </li><li><var>double-bright</var> </li><li><var>blank</var> </li><li><var>protect</var> </li><li><var>alt char set</var> </li>
</ol>
</td></tr>
</tbody></table>



<h2>Variable and Function Index</h2>
<p>For stty</p>
<ul>
<li><code>BC</code>: tgoto</li>
<li><code>ospeed</code>: Output Padding</li>
<li><code>PC</code>: Output Padding</li>
<li><code>tgetent</code>: Find</li>
<li><code>tgetflag</code>: Interrogate</li>
<li><code>tgetnum</code>: Interrogate</li>
<li><code>tgetstr</code>: Interrogate</li>
<li><code>tgoto</code>: tgoto</li>
<li><code>tparam</code>: tparam</li>
<li><code>tputs</code>: Output Padding</li>
<li><code>UP</code>: tgoto</li>
</ul>


<h2>Summary of Capability Names</h2>
<p>Here are all the terminal capability names in alphabetical order with a brief description of each.  For cross references to their definitions, see the index of capability names.</p>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>ae</td><td>String to turn off alternate character set mode.</td></tr>
<tr><td>al</td><td>String to insert a blank line before the cursor.</td></tr>
<tr><td>AL</td><td>String to insert <var>n</var> blank lines before the cursor.</td></tr>
<tr><td>am</td><td>Flag: output to last column wraps cursor to next line.</td></tr>
<tr><td>as</td><td>String to turn on alternate character set mode.like.</td></tr>
<tr><td>bc</td><td>Very obsolete alternative name for the lecapability.</td></tr>
<tr><td>bl</td><td>String to sound the bell.</td></tr>
<tr><td>bs</td><td>Obsolete flag: ASCII backspace may be used for leftward motion.</td></tr>
<tr><td>bt</td><td>String to move the cursor left to the previous hardware tab stop column.</td></tr>
<tr><td>bw</td><td>Flag: leat left margin wraps to end of previous line.</td></tr>
<tr><td>CC</td><td>String to change terminal's command character.</td></tr>
<tr><td>cd</td><td>String to clear the line the cursor is on, and following lines.</td></tr>
<tr><td>ce</td><td>String to clear from the cursor to the end of the line.</td></tr>
<tr><td>ch</td><td>String to position the cursor at column <var>c</var> in the same line.</td></tr>
<tr><td>cl</td><td>String to clear the entire screen and put cursor at upper left corner.</td></tr>
<tr><td>cm</td><td>String to position the cursor at line <var>l</var>, column <var>c</var>.</td></tr>
<tr><td>CM</td><td>String to position the cursor at line <var>l</var>, column <var>c</var>, relative to display memory.</td></tr>
<tr><td>co</td><td>Number: width of the screen.</td></tr>
<tr><td>cr</td><td>String to move cursor sideways to left margin.</td></tr>
<tr><td>cs</td><td>String to set the scroll region.</td></tr>
<tr><td>cS</td><td>Alternate form of string to set the scroll region.</td></tr>
<tr><td>ct</td><td>String to clear all tab stops.</td></tr>
<tr><td>cv</td><td>String to position the cursor at line <var>l</var> in the same column.</td></tr>
<tr><td>da</td><td>Flag: data scrolled off top of screen may be scrolled back.</td></tr>
<tr><td>db</td><td>Flag: data scrolled off bottom of screen may be scrolled back.</td></tr>
<tr><td>dB</td><td>Obsolete number: msec of padding needed for the backspace character.</td></tr>
<tr><td>dc</td><td>String to delete one character position at the cursor.</td></tr>
<tr><td>dC</td><td>Obsolete number: msec of padding needed for the carriage-return character.</td></tr>
<tr><td>DC</td><td>String to delete <var>n</var> characters starting at the cursor.</td></tr>
<tr><td>dF</td><td>Obsolete number: msec of padding needed for the formfeed character.</td></tr>
<tr><td>dl</td><td>String to delete the line the cursor is on.</td></tr>
<tr><td>DL</td><td>String to delete <var>n</var> lines starting with the cursor's line.</td></tr>
<tr><td>dm</td><td>String to enter delete mode.</td></tr>
<tr><td>dN</td><td>Obsolete number: msec of padding needed for the newline character.</td></tr>
<tr><td>do</td><td>String to move the cursor vertically down one line.</td></tr>
<tr><td>DO</td><td>String to move cursor vertically down <var>n</var> lines.</td></tr>
<tr><td>ds</td><td>String to disable the display of the status line.</td></tr>
<tr><td>dT</td><td>Obsolete number: msec of padding needed for the tab character.</td></tr>
<tr><td>ec</td><td>String of commands to clear <var>n</var> characters at cursor.</td></tr>
<tr><td>ed</td><td>String to exit delete mode.</td></tr>
<tr><td>ei</td><td>String to leave insert mode.</td></tr>
<tr><td>eo</td><td>Flag: output of a space can erase an overstrike.</td></tr>
<tr><td>es</td><td>Flag: other display commands work while writing the status line.</td></tr>
<tr><td>ff</td><td>String to advance to the next page, for a hardcopy terminal.</td></tr>
<tr><td>fs</td><td>String to move the cursor back from the status line to its previous position (outside the status line).</td></tr>
<tr><td>gn</td><td>Flag: this terminal type is generic, not real.</td></tr>
<tr><td>hc</td><td>Flag: hardcopy terminal.</td></tr>
<tr><td>hd</td><td>String to move the cursor down half a line.</td></tr>
<tr><td>ho</td><td>String to position cursor at upper left corner.</td></tr>
<tr><td>hs</td><td>Flag: the terminal has a status line.</td></tr>
<tr><td>hu</td><td>String to move the cursor up half a line.</td></tr>
<tr><td>hz</td><td>Flag: terminal cannot accept ~as output.</td></tr>
<tr><td>i1</td><td>String to initialize the terminal for each login session.</td></tr>
<tr><td>i3</td><td>String to initialize the terminal for each login session.</td></tr>
<tr><td>ic</td><td>String to insert one character position at the cursor.</td></tr>
<tr><td>IC</td><td>String to insert <var>n</var> character positions at the cursor.</td></tr>
<tr><td>if</td><td>String naming a file of commands to initialize the terminal.</td></tr>
<tr><td>im</td><td>String to enter insert mode.</td></tr>
<tr><td>in</td><td>Flag: outputting a space is different from moving over empty positions.</td></tr>
<tr><td>ip</td><td>String to output following an inserted character in insert mode.</td></tr>
<tr><td>is</td><td>String to initialize the terminal for each login session.</td></tr>
<tr><td>it</td><td>Number: initial spacing between hardware tab stop columns.</td></tr>
<tr><td>k0</td><td>String of input sent by function key 0 or 10.</td></tr>
<tr><td>k1 ... k9</td><td>Strings of input sent by function keys 1 through 9.</td></tr>
<tr><td>K1 ... K5</td><td>Strings sent by the five other keys in 3-by-3 array with arrows.</td></tr>
<tr><td>ka</td><td>String of input sent by the “clear all tabs” key.</td></tr>
<tr><td>kA</td><td>String of input sent by the “insert line” key.</td></tr>
<tr><td>kb</td><td>String of input sent by the “backspace” key.</td></tr>
<tr><td>kC</td><td>String of input sent by the “clear screen” key.</td></tr>
<tr><td>kd</td><td>String of input sent by typing the down-arrow key.</td></tr>
<tr><td>kD</td><td>String of input sent by the “delete character” key.</td></tr>
<tr><td>ke</td><td>String to make the function keys work locally.</td></tr>
<tr><td>kE</td><td>String of input sent by the “clear to end of line” key.</td></tr>
<tr><td>kF</td><td>String of input sent by the “scroll forward” key.</td></tr>
<tr><td>kh</td><td>String of input sent by typing the “home-position” key.</td></tr>
<tr><td>kH</td><td>String of input sent by the “home down” key.</td></tr>
<tr><td>kI</td><td>String of input sent by the “insert character” or “enter insert mode” key.</td></tr>
<tr><td>kl</td><td>String of input sent by typing the left-arrow key.</td></tr>
<tr><td>kL</td><td>String of input sent by the “delete line” key.</td></tr>
<tr><td>km</td><td>Flag: the terminal has a Meta key.</td></tr>
<tr><td>kM</td><td>String of input sent by the “exit insert mode” key.</td></tr>
<tr><td>kn</td><td>Numeric value, the number of numbered function keys.</td></tr>
<tr><td>kN</td><td>String of input sent by the “next page” key.</td></tr>
<tr><td>ko</td><td>Very obsolete string listing the terminal's named function keys.</td></tr>
<tr><td>kP</td><td>String of input sent by the “previous page” key.</td></tr>
<tr><td>kr</td><td>String of input sent by typing the right-arrow key.</td></tr>
<tr><td>kR</td><td>String of input sent by the “scroll reverse” key.</td></tr>
<tr><td>ks</td><td>String to make the function keys transmit.</td></tr>
<tr><td>kS</td><td>String of input sent by the “clear to end of screen” key.</td></tr>
<tr><td>kt</td><td>String of input sent by the “clear tab stop this column” key.</td></tr>
<tr><td>kT</td><td>String of input sent by the “set tab stop in this column” key.</td></tr>
<tr><td>ku</td><td>String of input sent by typing the up-arrow key.</td></tr>
<tr><td>l0</td><td>String on keyboard labelling function key 0 or 10.</td></tr>
<tr><td>l1 ... l9</td><td>Strings on keyboard labelling function keys 1 through 9.</td></tr>
<tr><td>le</td><td>String to move the cursor left one column.</td></tr>
<tr><td>LE</td><td>String to move cursor left <var>n</var> columns.</td></tr>
<tr><td>li</td><td>Number: height of the screen.</td></tr>
<tr><td>ll</td><td>String to position cursor at lower left corner.</td></tr>
<tr><td>lm</td><td>Number: lines of display memory.</td></tr>
<tr><td>LP</td><td>Flag: writing to last column of last line will not scroll.</td></tr>
<tr><td>mb</td><td>String to enter blinking mode.</td></tr>
<tr><td>md</td><td>String to enter double-bright mode.</td></tr>
<tr><td>me</td><td>String to turn off all appearance modes</td></tr>
<tr><td>mh</td><td>String to enter half-bright mode.</td></tr>
<tr><td>mi</td><td>Flag: cursor motion in insert mode is safe.</td></tr>
<tr><td>mk</td><td>String to enter invisible mode.</td></tr>
<tr><td>mm</td><td>String to enable the functioning of the Meta key.</td></tr>
<tr><td>mo</td><td>String to disable the functioning of the Meta key.</td></tr>
<tr><td>mp</td><td>String to enter protected mode.</td></tr>
<tr><td>mr</td><td>String to enter reverse-video mode.</td></tr>
<tr><td>ms</td><td>Flag: cursor motion in standout mode is safe.</td></tr>
<tr><td>nc</td><td>Obsolete flag: do not use ASCII carriage-return on this terminal.</td></tr>
<tr><td>nd</td><td>String to move the cursor right one column.</td></tr>
<tr><td>NF</td><td>Flag: do not use XON/XOFF flow control.</td></tr>
<tr><td>nl</td><td>Obsolete alternative name for the doand sfcapabilities.</td></tr>
<tr><td>ns</td><td>Flag: the terminal does not normally scroll for sequential output.</td></tr>
<tr><td>nw</td><td>String to move to start of next line, possibly clearing rest of old line.</td></tr>
<tr><td>os</td><td>Flag: terminal can overstrike.</td></tr>
<tr><td>pb</td><td>Number: the lowest baud rate at which padding is actually needed.</td></tr>
<tr><td>pc</td><td>String containing character for padding.</td></tr>
<tr><td>pf</td><td>String to terminate redirection of output to the printer.</td></tr>
<tr><td>po</td><td>String to redirect further output to the printer.</td></tr>
<tr><td>pO</td><td>String to redirect <var>n</var> characters ofoutput to the printer.</td></tr>
<tr><td>ps</td><td>String to print the screen on the attached printer.</td></tr>
<tr><td>rc</td><td>String to move to last saved cursor position.</td></tr>
<tr><td>RI</td><td>String to move cursor right <var>n</var> columns.</td></tr>
<tr><td>rp</td><td>String to output character <var>c</var> repeated <var>n</var> times.</td></tr>
<tr><td>rs</td><td>String to reset the terminal from any strange modes.</td></tr>
<tr><td>sa</td><td>String to turn on an arbitrary combination of appearance modes.</td></tr>
<tr><td>sc</td><td>String to save the current cursor position.</td></tr>
<tr><td>se</td><td>String to leave standout mode.</td></tr>
<tr><td>sf</td><td>String to scroll the screen one line up.</td></tr>
<tr><td>SF</td><td>String to scroll the screen <var>n</var> lines up.</td></tr>
<tr><td>sg</td><td>Number: width of magic standout cookie.  Absent if magic cookies are not used.</td></tr>
<tr><td>so</td><td>String to enter standout mode.</td></tr>
<tr><td>sr</td><td>String to scroll the screen one line down.</td></tr>
<tr><td>SR</td><td>String to scroll the screen <var>n</var> line down.</td></tr>
<tr><td>st</td><td>String to set tab stop at current cursor column on all lines. programs.</td></tr>
<tr><td>ta</td><td>String to move the cursor right to the next hardware tab stop column.</td></tr>
<tr><td>te</td><td>String to return terminal to settings for sequential output.</td></tr>
<tr><td>ti</td><td>String to initialize terminal for random cursor motion.</td></tr>
<tr><td>ts</td><td>String to move the terminal cursor into the status line.</td></tr>
<tr><td>uc</td><td>String to underline one character and move cursor right.</td></tr>
<tr><td>ue</td><td>String to turn off underline mode</td></tr>
<tr><td>ug</td><td>Number: width of underlining magic cookie.  Absent if underlining doesn't use magic cookies.</td></tr>
<tr><td>ul</td><td>Flag: underline by overstriking with an underscore.</td></tr>
<tr><td>up</td><td>String to move the cursor vertically up one line.</td></tr>
<tr><td>UP</td><td>String to move cursor vertically up <var>n</var> lines.</td></tr>
<tr><td>us</td><td>String to turn on underline mode</td></tr>
<tr><td>vb</td><td>String to make the screen flash.</td></tr>
<tr><td>ve</td><td>String to return the cursor to normal.</td></tr>
<tr><td>vi</td><td>String to make the cursor invisible.</td></tr>
<tr><td>vs</td><td>String to enhance the cursor.</td></tr>
<tr><td>wi</td><td>String to set the terminal output screen window.</td></tr>
<tr><td>ws</td><td>Number: the width of the status line.</td></tr>
<tr><td>xb</td><td>Flag: superbee terminal.</td></tr>
<tr><td>xn</td><td>Flag: cursor wraps in a strange way.</td></tr>
<tr><td>xs</td><td>Flag: clearing a line is the only way to clear the appearance modes of positions in that line (or, only way to remove magic cookies on that line).</td></tr>
<tr><td>xt</td><td>Flag: Teleray 1061; several strange characteristics.</td></tr>
</tbody></table>

<h2>Variable and Function Index</h2>
<ul>
<li><code>BC</code>: tgoto</li>
<li><code>ospeed</code>: Output Padding</li>
<li><code>PC</code>: Output Padding</li>
<li><code>tgetent</code>: Find</li>
<li><code>tgetflag</code>: Interrogate</li>
<li><code>tgetnum</code>: Interrogate</li>
<li><code>tgetstr</code>: Interrogate</li>
<li><code>tgoto</code>: tgoto</li>
<li><code>tparam</code>: tparam</li>
<li><code>tputs</code>: Output Padding</li>
<li><code>UP</code>: tgoto</li>
</ul>

<hr class="HR" />

<ul>
<li><code>ae</code>: Standout</li>
<li><code>AL</code>: Insdel Line</li>
<li><code>al</code>: Insdel Line</li>
<li><code>am</code>: Wrapping</li>
<li><code>as</code>: Standout</li>
<li><code>bc</code>: Cursor Motion</li>
<li><code>bl</code>: Bell</li>
<li><code>bs</code>: Cursor Motion</li>
<li><code>bt</code>: Cursor Motion</li>
<li><code>bw</code>: Cursor Motion</li>
<li><code>CC</code>: Basic</li>
<li><code>cd</code>: Clearing</li>
<li><code>ce</code>: Clearing</li>
<li><code>ch</code>: Cursor Motion</li>
<li><code>cl</code>: Clearing</li>
<li><code>CM</code>: Cursor Motion</li>
<li><code>cm</code>: Cursor Motion</li>
<li><code>co</code>: Screen Size</li>
<li><code>cr</code>: Cursor Motion</li>
<li><code>cS</code>: Scrolling</li>
<li><code>cs</code>: Scrolling</li>
<li><code>ct</code>: Initialization</li>
<li><code>cv</code>: Cursor Motion</li>
<li><code>da</code>: Scrolling</li>
<li><code>dB</code>: Pad Specs</li>
<li><code>db</code>: Scrolling</li>
<li><code>dC</code>: Pad Specs</li>
<li><code>DC</code>: Insdel Char</li>
<li><code>dc</code>: Insdel Char</li>
<li><code>dF</code>: Pad Specs</li>
<li><code>DL</code>: Insdel Line</li>
<li><code>dl</code>: Insdel Line</li>
<li><code>dm</code>: Insdel Char</li>
<li><code>dN</code>: Pad Specs</li>
<li><code>DO</code>: Cursor Motion</li>
<li><code>do</code>: Cursor Motion</li>
<li><code>ds</code>: Status Line</li>
<li><code>dT</code>: Pad Specs</li>
<li><code>ec</code>: Clearing</li>
<li><code>ed</code>: Insdel Char</li>
<li><code>ei</code>: Insdel Char</li>
<li><code>eo</code>: Basic</li>
<li><code>es</code>: Status Line</li>
<li><code>ff</code>: Cursor Motion</li>
<li><code>fs</code>: Status Line</li>
<li><code>gn</code>: Basic</li>
<li><code>hc</code>: Basic</li>
<li><code>hd</code>: Half-Line</li>
<li><code>ho</code>: Cursor Motion</li>
<li><code>hs</code>: Status Line</li>
<li><code>hu</code>: Half-Line</li>
<li><code>hz</code>: Basic</li>
<li><code>i1</code>: Initialization</li>
<li><code>i3</code>: Initialization</li>
<li><code>IC</code>: Insdel Char</li>
<li><code>ic</code>: Insdel Char</li>
<li><code>if</code>: Initialization</li>
<li><code>im</code>: Insdel Char</li>
<li><code>in</code>: Insdel Char</li>
<li><code>ip</code>: Insdel Char</li>
<li><code>is</code>: Initialization</li>
<li><code>it</code>: Initialization</li>
<li><code>K1...K5</code>: Keypad</li>
<li><code>k1...k9</code>: Keypad</li>
<li><code>kA...kT</code>: Keypad</li>
<li><code>ka...ku</code>: Keypad</li>
<li><code>km</code>: Meta Key</li>
<li><code>l0...l9</code>: Keypad</li>
<li><code>LE</code>: Cursor Motion</li>
<li><code>le</code>: Cursor Motion</li>
<li><code>li</code>: Screen Size</li>
<li><code>ll</code>: Cursor Motion</li>
<li><code>lm</code>: Scrolling</li>
<li><code>LP</code>: Wrapping</li>
<li><code>mb</code>: Standout</li>
<li><code>md</code>: Standout</li>
<li><code>me</code>: Standout</li>
<li><code>mh</code>: Standout</li>
<li><code>mi</code>: Insdel Char</li>
<li><code>mk</code>: Standout</li>
<li><code>mm</code>: Meta Key</li>
<li><code>mo</code>: Meta Key</li>
<li><code>mp</code>: Standout</li>
<li><code>mr</code>: Standout</li>
<li><code>ms</code>: Underlining</li>
<li><code>ms</code>: Standout</li>
<li><code>nc</code>: Cursor Motion</li>
<li><code>nd</code>: Cursor Motion</li>
<li><code>NF</code>: Initialization</li>
<li><code>nl</code>: Cursor Motion</li>
<li><code>ns</code>: Scrolling</li>
<li><code>nw</code>: Cursor Motion</li>
<li><code>os</code>: Basic</li>
<li><code>pb</code>: Pad Specs</li>
<li><code>pc</code>: Pad Specs</li>
<li><code>pf</code>: Printer</li>
<li><code>pO</code>: Printer</li>
<li><code>po</code>: Printer</li>
<li><code>ps</code>: Printer</li>
<li><code>rc</code>: Cursor Motion</li>
<li><code>RI</code>: Cursor Motion</li>
<li><code>rp</code>: Basic</li>
<li><code>rs</code>: Initialization</li>
<li><code>sa</code>: Standout</li>
<li><code>sc</code>: Cursor Motion</li>
<li><code>se</code>: Standout</li>
<li><code>SF</code>: Scrolling</li>
<li><code>sf</code>: Scrolling</li>
<li><code>sg</code>: Standout</li>
<li><code>so</code>: Standout</li>
<li><code>SR</code>: Scrolling</li>
<li><code>sr</code>: Scrolling</li>
<li><code>st</code>: Initialization</li>
<li><code>ta</code>: Cursor Motion</li>
<li><code>te</code>: Initialization</li>
<li><code>ti</code>: Initialization</li>
<li><code>ts</code>: Status Line</li>
<li><code>uc</code>: Underlining</li>
<li><code>ue</code>: Underlining</li>
<li><code>ug</code>: Underlining</li>
<li><code>ul</code>: Underlining</li>
<li><code>UP</code>: Cursor Motion</li>
<li><code>up</code>: Cursor Motion</li>
<li><code>us</code>: Underlining</li>
<li><code>vb</code>: Bell</li>
<li><code>ve</code>: Cursor Visibility</li>
<li><code>vi</code>: Cursor Visibility</li>
<li><code>vs</code>: Cursor Visibility</li>
<li><code>wi</code>: Windows</li>
<li><code>ws</code>: Status Line</li>
<li><code>xb</code>: Basic</li>
<li><code>xn</code>: Wrapping</li>
<li><code>xs</code>: Standout</li>
<li><code>xt</code>: Standout</li>
<li><code>xt</code>: Cursor Motion</li>
</ul>





<hr class="HR" />

<ul>
<li>Basic:        Basic characteristics.</li>
<li>Screen Size:   Screen size, and what happens when it changes.</li>
<li>Cursor Motion:   Various ways to move the cursor.</li>
<li>Wrapping:     What happens if you write a character in the last column.</li>
<li>Scrolling:    Pushing text up and down on the screen.</li>
<li>Windows:      Limiting the part of the window that output affects.</li>
<li>Clearing:     Erasing one or many lines.</li>
<li>Insdel Line:   Making new blank lines in mid-screen; deleting lines.</li>
<li>Insdel Char:   Inserting and deleting characters within a line.</li>
<li>Standout:     Highlighting some of the text.</li>
<li>Underlining:   Underlining some of the text.</li>
<li>Cursor Visibility:   Making the cursor more or less easy to spot.</li>
<li>Bell:         Attracts user's attention; not localized on the screen.</li>
<li>Keypad:  Recognizing when function keys or arrows are typed.</li>
<li>Meta Key:     META acts like an extra shift key.</li>
<li>Initialization:   Commands used to initialize or reset the terminal.</li>
<li>Pad Specs:    Info for the kernel on how much padding is needed.</li>
<li>Status Line:   A status line displays <code>background</code> information.</li>
<li>Half-Line:    Moving by half-lines, for superscripts and subscripts.</li>
<li>Printer:      Controlling auxiliary printers of display terminals.</li>
</ul>
<hr class="HR" />





<h2>Translated Term Capabilities</h2>
<pre></pre>
<p>This is helpful so you can understand what a term cap does, by looking at the long name.</p>
<table class="bordered"><tbody><tr class="header"><th>Tput Name</th><th>Terminfo Long Name</th></tr>
<tr><td>@7</td><td>key_end</td></tr><tr><td>AB</td><td>set_a_background</td></tr><tr><td>AF</td><td>set_a_foreground</td></tr><tr><td>AL</td><td>parm_insert_line</td></tr><tr><td>AX</td><td>AX</td></tr><tr><td>Co</td><td>max_colors</td></tr><tr><td>DC</td><td>parm_dch</td></tr><tr><td>DL</td><td>parm_delete_line</td></tr><tr><td>DO</td><td>parm_down_cursor</td></tr><tr><td>E0</td><td>E0</td></tr><tr><td>F1</td><td>key_f11</td></tr><tr><td>F2</td><td>key_f12</td></tr><tr><td>G0</td><td>G0</td></tr><tr><td>HC</td><td>5i</td></tr><tr><td>IC</td><td>parm_ich</td></tr><tr><td>Ic</td><td>initialize_color</td></tr><tr><td>Km</td><td>delete_line</td></tr><tr><td>LE</td><td>parm_left_cursor</td></tr><tr><td>NC</td><td>no_color_video</td></tr><tr><td>ND</td><td>MT</td></tr><tr><td>NP</td><td>NL</td></tr><tr><td>RI</td><td>parm_right_cursor</td></tr><tr><td>S0</td><td>S0</td></tr><tr><td>UP</td><td>parm_up_cursor</td></tr><tr><td>YA</td><td>NR</td></tr><tr><td>YC</td><td>YB</td></tr><tr><td>YE</td><td>YD</td></tr><tr><td>YG</td><td>YF</td></tr><tr><td>ac</td><td>acs_chars</td></tr><tr><td>ae</td><td>exit_alt_charset_mode</td></tr><tr><td>al</td><td>insert_line</td></tr><tr><td>am</td><td>auto_right_margin</td></tr><tr><td>as</td><td>enter_alt_charset_mode</td></tr><tr><td>back_color_erase</td><td>backspaces_with_bs</td></tr><tr><td>bl</td><td>bell</td></tr><tr><td>bs</td><td>eat_newline_glitch</td></tr><tr><td>bt</td><td>back_tab</td></tr><tr><td>bw</td><td>auto_left_margin</td></tr><tr><td>cb</td><td>clr_bol</td></tr><tr><td>cc</td><td>can_change</td></tr><tr><td>cd</td><td>clr_eos</td></tr><tr><td>ce</td><td>clr_eol</td></tr><tr><td>cl</td><td>clear_screen</td></tr><tr><td>cm</td><td>cursor_address</td></tr><tr><td>co</td><td>columns</td></tr><tr><td>col_addr_glitch</td><td>ceol_standout_glitch</td></tr><tr><td>cpi_changes_res</td><td>cr_cancels_micro_mode</td></tr><tr><td>cr</td><td>carriage_return</td></tr><tr><td>cs</td><td>change_scroll_region</td></tr><tr><td>ct</td><td>clear_all_tabs</td></tr><tr><td>cursor_up</td><td>scroll_reverse</td></tr><tr><td>da</td><td>crt_no_scrolling</td></tr><tr><td>db</td><td>dest_tabs_magic_smso</td></tr><tr><td>dc</td><td>delete_character</td></tr><tr><td>dl</td><td>key_mouse</td></tr><tr><td>do</td><td>cursor_down</td></tr><tr><td>eA</td><td>ena_acs</td></tr><tr><td>ei</td><td>exit_insert_mode</td></tr><tr><td>eo</td><td>erase_overstrike</td></tr><tr><td>es</td><td>generic_type</td></tr><tr><td>gn</td><td>gnu_has_meta_key</td></tr><tr><td>hard_copy</td><td>hard_cursor</td></tr><tr><td>has_meta_key</td><td>has_hardware_tabs</td></tr><tr><td>has_status_line</td><td>has_print_wheel</td></tr><tr><td>hl</td><td>hc</td></tr><tr><td>ho</td><td>cursor_home</td></tr><tr><td>hs</td><td>hue_lightness_saturation</td></tr><tr><td>im</td><td>enter_insert_mode</td></tr><tr><td>in</td><td>hz</td></tr><tr><td>insert_null_glitch</td><td>linefeed_is_newline</td></tr><tr><td>is</td><td>init_2string</td></tr><tr><td>it</td><td>init_tabs</td></tr><tr><td>k1</td><td>key_f1</td></tr><tr><td>k2</td><td>key_f2</td></tr><tr><td>k3</td><td>key_f3</td></tr><tr><td>k4</td><td>key_f4</td></tr><tr><td>k5</td><td>key_f5</td></tr><tr><td>k6</td><td>key_f6</td></tr><tr><td>k7</td><td>key_f7</td></tr><tr><td>k8</td><td>key_f8</td></tr><tr><td>k9</td><td>key_f9</td></tr><tr><td>k;</td><td>key_f10</td></tr><tr><td>kB</td><td>key_btab</td></tr><tr><td>kD</td><td>key_dc</td></tr><tr><td>kI</td><td>key_ic</td></tr><tr><td>kN</td><td>key_npage</td></tr><tr><td>kP</td><td>key_ppage</td></tr><tr><td>kb</td><td>cursor_left</td></tr><tr><td>kd</td><td>key_down</td></tr><tr><td>ke</td><td>keypad_local</td></tr><tr><td>kh</td><td>key_home</td></tr><tr><td>kl</td><td>key_left</td></tr><tr><td>kr</td><td>key_right</td></tr><tr><td>ks</td><td>keypad_xmit</td></tr><tr><td>ku</td><td>key_up</td></tr><tr><td>le</td><td>key_backspace</td></tr><tr><td>li</td><td>lines</td></tr><tr><td>mb</td><td>enter_blink_mode</td></tr><tr><td>md</td><td>enter_bold_mode</td></tr><tr><td>me</td><td>exit_attribute_mode</td></tr><tr><td>memory_above</td><td>lpi_changes_res</td></tr><tr><td>mi</td><td>km</td></tr><tr><td>move_insert_mode</td><td>move_standout_mode</td></tr><tr><td>mr</td><td>enter_reverse_mode</td></tr><tr><td>nc</td><td>memory_below</td></tr><tr><td>nd</td><td>cursor_right</td></tr><tr><td>needs_xon_xoff</td><td>no_correctly_working_cr</td></tr><tr><td>no_pad_char</td><td>no_esc_ctlc</td></tr><tr><td>non_rev_rmcup</td><td>non_dest_scroll_region</td></tr><tr><td>nw</td><td>newline</td></tr><tr><td>nx</td><td>ns</td></tr><tr><td>op</td><td>orig_pair</td></tr><tr><td>os</td><td>over_strike</td></tr><tr><td>pa</td><td>max_pairs</td></tr><tr><td>prtr_silent</td><td>return_does_clr_eol</td></tr><tr><td>pt</td><td>ms</td></tr><tr><td>r2</td><td>reset_2string</td></tr><tr><td>rc</td><td>restore_cursor</td></tr><tr><td>row_addr_glitch</td><td>semi_auto_right_margin</td></tr><tr><td>sa</td><td>set_attributes</td></tr><tr><td>sc</td><td>save_cursor</td></tr><tr><td>se</td><td>exit_standout_mode</td></tr><tr><td>sf</td><td>scroll_forward</td></tr><tr><td>so</td><td>enter_standout_mode</td></tr><tr><td>st</td><td>set_tab</td></tr><tr><td>ta</td><td>tab</td></tr><tr><td>te</td><td>exit_ca_mode</td></tr><tr><td>ti</td><td>enter_ca_mode</td></tr><tr><td>tilde_glitch</td><td>status_line_esc_ok</td></tr><tr><td>ue</td><td>exit_underline_mode</td></tr><tr><td>ul</td><td>transparent_underline</td></tr><tr><td>up</td><td>sr</td></tr><tr><td>us</td><td>enter_underline_mode</td></tr><tr><td>vb</td><td>flash_screen</td></tr><tr><td>ve</td><td>cursor_normal</td></tr><tr><td>vi</td><td>cursor_invisible</td></tr><tr><td>vs</td><td>cursor_visible</td></tr><tr><td>xn</td><td>ut</td></tr><tr><td>xo</td><td>xb</td></tr><tr><td>xr</td><td>xon_xoff</td></tr><tr><td>xt</td><td>xs</td></tr></tbody></table>


<h2>List of All Terminals</h2>
<p>You can view this list with the following command:</p>
<pre>$ toe -a|sort -d</pre>





<h2><a href="http://vt100.net/docs/vt100-ug/chapter3.html#S3.3.2">VT100 keypad Diagram</a></h2>
<p><a href="http://vt100.net/docs/vt100-ug/chapter3.html#S3.3.2">VT100 LINK</a></p>
<p>Here's a diagram of the VT100 keypad keys with their bindings.  The top line is the name of the key (some DEC keyboards have the keys labelled somewhat differently, like GOLD instead of PF1, but this is the most "official" name).  The second line is the escape sequence it generates in Application Keypad mode (where "$" means the ESC character).  The third line contains two items, first the mapping of the key in terminfo, and then in termcap.</p>
<pre>   _______________________________________
  |   PF1   |   PF2   |   PF3   |   PF4   |
  |   $OP   |   $OQ   |   $OR   |   $OS   |
  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
  |    7         8         9         -    |
  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
  |_kf9__k9_|_kf10_k;_|_kf0__k0_|_________|
  |    4    |    5    |    6    |    ,    |
  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
  |_kf5__k5_|_kf6__k6_|_kf7__k7_|_kf8__k8_|
  |    1    |    2    |    3    |         |
  |   $Oq   |   $Or   |   $Os   |  enter  |
  |_ka1__K1_|_kb2__K2_|_ka3__K3_|  $OM    |
  |         0         |   .     |         |
  |        $Op        |  $On    |         |
  |___kc1_______K4____|_kc3__K5_|_kent_@8_|</pre>

<p>A better adaptation to modern keyboards such as the PC's, which have a dozen function keys and the keypad 2,4,6,8 keys are labeled with arrows keys, is to use the 5-key arrangement to model the arrow keys as suggested in the terminfo guidelines:</p>
<pre>   _______________________________________
  |   PF1   |   PF2   |   PF3   |   PF4   |
  |   $OP   |   $OQ   |   $OR   |   $OS   |
  |_kf1__k1_|_kf2__k2_|_kf3__k3_|_kf4__k4_|
  |    7         8         9         -    |
  |   $Ow   |   $Ox   |   $Oy   |   $Om   |
  |_ka1__K1_|_________|_ka3__K3_|_________|
  |    4    |    5    |    6    |    ,    |
  |   $Ot   |   $Ou   |   $Ov   |   $Ol   |
  |_________|_kb2__K2_|_________|_________|
  |    1    |    2    |    3    |         |
  |   $Oq   |   $Or   |   $Os   |  enter  |
  |_kc1__K4_|_________|_kc3__K5_|  $OM    |
  |         0         |   .     |         |
  |        $Op        |  $On    |         |
  |___________________|_________|_kent_@8_|</pre>





<h2>SGR parameter values</h2>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td><var>0</var></td><td>default mode (attributes off)</td></tr>
<tr><td><var>1</var></td><td>bold</td></tr>
<tr><td><var>2</var></td><td>dim</td></tr>
<tr><td><var>3</var></td><td>italicized</td></tr>
<tr><td><var>4</var></td><td>underlined</td></tr>
<tr><td><var>5</var></td><td>slow blink</td></tr>
<tr><td><var>6</var></td><td>fast blink</td></tr>
<tr><td><var>7</var></td><td>reverse video</td></tr>
<tr><td><var>8</var></td><td>invisible</td></tr>
<tr><td><var>9</var></td><td>crossed-out (marked for deletion)</td></tr>
<tr><td><var>10</var></td><td>primary font [10 + n (n in 1..9) = nth alternative font]</td></tr>
<tr><td><var>20</var></td><td>Fraktur</td></tr>
<tr><td><var>21</var></td><td>double underline</td></tr>
<tr><td><var>22</var></td><td>turn off 2</td></tr>
<tr><td><var>23</var></td><td>turn off 3</td></tr>
<tr><td><var>24</var></td><td>turn off 4</td></tr>
<tr><td><var>25</var></td><td>turn off 5</td></tr>
<tr><td><var>26</var></td><td>proportional spacing</td></tr>
<tr><td><var>27</var></td><td>turn off 7</td></tr>
<tr><td><var>28</var></td><td>turn off 8</td></tr>
<tr><td><var>29</var></td><td>turn off 9</td></tr>
<tr><td><var>30</var></td><td>black fg</td></tr>
<tr><td><var>31</var></td><td>red fg</td></tr>
<tr><td><var>32</var></td><td>green fg</td></tr>
<tr><td><var>33</var></td><td>yellow fg</td></tr>
<tr><td><var>34</var></td><td>blue fg</td></tr>
<tr><td><var>35</var></td><td>magenta fg</td></tr>
<tr><td><var>36</var></td><td>cyan fg</td></tr>
<tr><td><var>37</var></td><td>white fg</td></tr>
<tr><td><var>38</var></td><td>set fg color as in CCIT T.416</td></tr>
<tr><td><var>39</var></td><td>set default fg color</td></tr>
<tr><td><var>40</var></td><td>black bg</td></tr>
<tr><td><var>41</var></td><td>red bg</td></tr>
<tr><td><var>42</var></td><td>green bg</td></tr>
<tr><td><var>43</var></td><td>yellow bg</td></tr>
<tr><td><var>44</var></td><td>blue bg</td></tr>
<tr><td><var>45</var></td><td>magenta bg</td></tr>
<tr><td><var>46</var></td><td>cyan bg</td></tr>
<tr><td><var>47</var></td><td>white bg</td></tr>
<tr><td><var>48</var></td><td>set bg color as in CCIT T.416</td></tr>
<tr><td><var>39</var></td><td>set default bg color</td></tr>
<tr><td><var>50</var></td><td>turn off 26</td></tr>
<tr><td><var>51</var></td><td>framed</td></tr>
<tr><td><var>52</var></td><td>encircled</td></tr>
<tr><td><var>53</var></td><td>overlined</td></tr>
<tr><td><var>54</var></td><td>turn off 51 &amp; 52</td></tr>
<tr><td><var>55</var></td><td>not overlined</td></tr>
<tr><td><var>56-59</var></td><td>reserved</td></tr>
<tr><td><var>61-65</var></td><td>variable highlights for ideograms.</td></tr>
</tbody></table>






<pre>Sequence     Sequence                             Parameter   or
Mnemonic     Name              Sequence           Value      Mode   terminfo
-----------------------------------------------------------------------------
APC  Applicatn Program Command \E _                -         Delim  -
BEL  Bell *                    ^G                  -         -      bel
BPH  Break Permitted Here *    \E B                -         *      -
BS   Backpace *                ^H                  -         EF     -
CAN  Cancel *                  ^X                  -         -      -   (A)
CBT  Cursor Backward Tab       \E [ Pn Z           1         eF     cbt
CCH  Cancel Previous Character \E T                -         -      -
CHA  Cursor Horizntal Absolute \E [ Pn G           1         eF     hpa (B)
CHT  Cursor Horizontal Tab     \E [ Pn I           1         eF     tab (C)
CMD  Coding Method Delimiter * \E
CNL  Cursor Next Line          \E [ Pn E           1         eF     nel (D)
CPL  Cursor Preceding Line     \E [ Pn F           1         eF     -
CPR  Cursor Position Report    \E [ Pn ; Pn R      1, 1      -      -   (E)
CSI  Control Sequence Intro    \E [                -         Intro  -
CTC  Cursor Tabulation Control \E [ Ps W           0         eF     -   (F)
CUB  Cursor Backward           \E [ Pn D           1         eF     cub
CUD  Cursor Down               \E [ Pn B           1         eF     cud
CUF  Cursor Forward            \E [ Pn C           1         eF     cuf
CUP  Cursor Position           \E [ Pn ; Pn H      1, 1      eF     cup (G)
CUU  Cursor Up                 \E [ Pn A           1         eF     cuu
CVT  Cursor Vertical Tab       \E [ Pn Y           -         eF     -   (H)
DA   Device Attributes         \E [ Pn c           0         -      -
DAQ  Define Area Qualification \E [ Ps o           0         -      -
DCH  Delete Character          \E [ Pn P           1         eF     dch
DCS  Device Control String     \E P                -         Delim  -
DL   Delete Line               \E [ Pn M           1         eF     dl
DLE  Data Link Escape *        ^P                  -         -      -
DMI  Disable Manual Input      \E \                -         Fs     -
DSR  Device Status Report      \E [ Ps n           0         -      -   (I)
DTA  Dimension Text Area *     \E [ Pn ; Pn SPC T  -         PC     -
EA   Erase in Area             \E [ Ps O           0         eF     -   (J)
ECH  Erase Character           \E [ Pn X           1         eF     ech
ED   Erase in Display          \E [ Ps J           0         eF     ed  (J)
EF   Erase in Field            \E [ Ps N           0         eF     -
EL   Erase in Line             \E [ Ps K           0         eF     el  (J)
EM   End of Medium *           ^Y                  -         -      -
EMI  Enable Manual Input       \E b                          Fs     -
ENQ  Enquire                   ^E                  -         -      -
EOT  End Of Transmission       ^D                  -         *      -
EPA  End of Protected Area     \E W                -         -      -   (K)
ESA  End of Selected Area      \E G                -         -      -
ESC  Escape                    ^[                  -         -      -
ETB  End Transmission Block    ^W                  -         -      -
ETX  End of Text               ^C                  -         -      -
FF   Form Feed                 ^L                  -         -      -
FNK  Function Key *            \E [ Pn SPC W       -         -      -
GCC  Graphic Char Combination* \E [ Pn ; Pn SPC B  -         -      -
FNT  Font Selection            \E [ Pn ; Pn SPC D  0, 0      FE     -
GSM  Graphic Size Modify       \E [ Pn ; Pn SPC B  100, 100  FE     -   (L)
GSS  Graphic Size Selection    \E [ Pn SPC C       none      FE     -
HPA  Horz Position Absolute    \E [ Pn `           1         FE     -   (B)
HPB  Char Position Backward    \E [ j              1         FE     -
HPR  Horz Position Relative    \E [ Pn a           1         FE     -   (M)
HT   Horizontal Tab *          ^I                  -         FE     -   (N)
HTJ  Horz Tab w/Justification  \E I                -         FE     -
HTS  Horizontal Tab Set        \E H                -         FE     hts
HVP  Horz &amp;amp; Vertical Position  \E [ Pn ; Pn f      1, 1      FE     -   (G)
ICH  Insert Character          \E [ Pn @           1         eF     ich
IDCS ID Device Control String  \E [ SPC O          -         *      -
IGS  ID Graphic Subrepertoire  \E [ SPC M          -         *      -
IL   Insert Line               \E [ Pn L           1         eF     il
IND  Index                     \E D                -         FE     -
INT  Interrupt                 \E a                -         Fs     -
JFY  Justify                   \E [ Ps SPC F       0         FE     -
IS1  Info Separator #1 *       ^_                  -         *      -
IS2  Info Separator #1 *       ^^                  -         *      -
IS3  Info Separator #1 *       ^]                  -         *      -
IS4  Info Separator #1 *       ^\                  -         *      -
LF   Line Feed                 ^J                  -         -      -
LS1R Locking Shift Right 1 *   \E ~                -         -      -
LS2  Locking Shift 2 *         \E n                -         -      -
LS2R Locking Shift Right 2 *   \E }                -         -      -
LS3  Locking Shift 3 *         \E o                -         -      -
LS3R Locking Shift Right 3 *   \E |                -         -      -
MC   Media Copy                \E [ Ps i           0         -      -   (S)
MW   Message Waiting           \E U                -         -      -
NAK  Negative Acknowledge *    ^U                  -         *      -
NBH  No Break Here *           \E C                -         -      -
NEL  Next Line                 \E E                -         FE     nel (D)
NP   Next Page                 \E [ Pn U           1         eF     -
NUL  Null *                    ^@                  -         -      -
OSC  Operating System Command  \E ]                -         Delim  -
PEC  Pres. Expand/Contract *   \E Pn SPC Z         0         -      -
PFS  Page Format Selection *   \E Pn SPC J         0         -      -
PLD  Partial Line Down         \E K                -         FE     -   (T)
PLU  Partial Line Up           \E L                -         FE     -   (U)
PM   Privacy Message           \E ^                -         Delim  -
PP   Preceding Page            \E [ Pn V           1         eF     -
PPA  Page Position Absolute *  \E [ Pn SPC P       1         FE     -
PPB  Page Position Backward *  \E [ Pn SPC R       1         FE     -
PPR  Page Position Forward *   \E [ Pn SPC Q       1         FE     -
PTX  Parallel Texts *          \E [ \              -         -      -
PU1  Private Use 1             \E Q                -         -      -
PU2  Private Use 2             \E R                -         -      -
QUAD Typographic Quadding      \E [ Ps SPC H       0         FE     -
REP  Repeat Char or Control    \E [ Pn b           1         -      rep
RI   Reverse Index             \E M                -         FE     -   (V)
RIS  Reset to Initial State    \E c                -         Fs     -
RM   Reset Mode *              \E [ Ps l           -         -      -   (W)
SACS Set Add. Char. Sep. *     \E [ Pn SPC /       0         -      -
SAPV Sel. Alt. Present. Var. * \E [ Ps SPC ]       0         -      -   (X)
SCI  Single-Char Introducer    \E Z                -         -      -
SCO  Sel. Char. Orientation *  \E [ Pn ; Pn SPC k  -         -      -
SCS  Set Char. Spacing *       \E [ Pn SPC g       -         -      -
SD   Scroll Down               \E [ Pn T           1         eF     rin
SDS  Start Directed String *   \E [ Pn ]           1         -      -
SEE  Select Editing Extent     \E [ Ps Q           0         -      -   (Y)
SEF  Sheet Eject &amp;amp; Feed *  \E [ Ps ; Ps SPC Y  0,0       -      -
SGR  Select Graphic Rendition  \E [ Ps m           0         FE     sgr (O)
SHS  Select Char. Spacing *    \E [ Ps SPC K       0         -      -
SI   Shift In                  ^O                  -         -      -   (P)
SIMD Sel. Imp. Move Direct. *  \E [ Ps ^           -         -      -
SL   Scroll Left               \E [ Pn SPC @       1         eF     -
SLH  Set Line Home *           \E [ Pn SPC U       -         -      -
SLL  Set Line Limit *          \E [ Pn SPC V       -         -      -
SLS  Set Line Spacing *        \E [ Pn SPC h       -         -      -
SM   Select Mode               \E [ Ps h           none      -      -   (W)
SO   Shift Out                 ^N                  -         -      -   (Q)
SOH  Start Of Heading *        ^A                  -         -      -
SOS  Start of String *         \E X                -         -      -
SPA  Start of Protected Area   \E V                -         -      -   (Z)
SPD  Select Pres. Direction *  \E [ Ps ; Ps SPC S  0,0       -      -
SPH  Set Page Home *           \E [ Ps SPC G       -         -      -
SPI  Spacing Increment         \E [ Pn ; Pn SPC G  none      FE     -
SPL  Set Page Limit *          \E [ Ps SPC j       -         -      -
SPQR Set Pr. Qual. &amp;amp; Rapid. *  \E [ Ps SPC X       0         -      -
SR   Scroll Right              \E [ Pn SPC A       1         eF     -
SRCS Set Reduced Char. Sep. *  \E [ Pn SPC f       0         -      -
SRS  Start Reversed String *   \E [ Ps [           0         -      -
SSA  Start of Selected Area    \E F                -         -      -
SSU  Select Size Unit *        \E [ Pn SPC I       0         -      -
SSW  Set Space Width *         \E [ Pn SPC [       none      -      -
SS2  Single Shift 2 (G2 set)   \E N                -         Intro  -
SS3  Single Shift 3 (G3 set)   \E O                -         Intro  -
ST   String Terminator         \E \                -         Delim  -
STAB Selective Tabulation *    \E [ Pn SPC ^       -         -      -
STS  Set Transmit State        \E S                -         -      -
STX  Start pf Text *           ^B                  -         -      -
SU   Scroll Up                 \E [ Pn S           1         eF     indn
SUB  Substitute *              ^Z                  -         -      -
SVS  Select Line Spacing *     \E [ Pn SPC \       1         -      -
SYN  Synchronous Idle *        ^F                  -         -      -
TAC  Tabul. Aligned Centered * \E [ Pn SPC b       -         -      -
TALE Tabul. Al. Leading Edge * \E [ Pn SPC a       -         -      -
TATE Tabul. Al. Trailing Edge* \E [ Pn SPC `       -         -      -
TBC  Tab Clear                 \E [ Ps g           0         FE     tbc
TCC  Tabul. Centered on Char * \E [ Pn SPC c       -         -      -
TSR  Tabulation Stop Remove  * \E [ Pn SPC d       -         FE     -
TSS  Thin Space Specification  \E [ Pn SC E        none      FE     -
VPA  Vert. Position Absolute   \E [ Pn d           1         FE     vpa
VPB  Line Position Backward *  \E [ Pn k           1         FE     -
VPR  Vert. Position Relative   \E [ Pn e           1         FE     -   (R)
VPR  Vert. Position Relative   \E [ Pn e           1         FE     -   (R)
VT   Vertical Tabulation *     ^K                  -         FE     -
VTS  Vertical Tabulation Set   \E J                -         FE     -</pre>









<h3>Basic Characteristics</h3>
<p>This section documents the capabilities that describe the basic and nature of the terminal, and also those that are relevant to the output of graphic characters.</p>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>os</td><td>Flag whose presence means that the terminal can overstrike.  This means that outputting a graphic character does not erase whatever was present in the same character position before.  The terminals that can overstrike include printing terminals, storage tubes (all obsolete nowadays), and many bit-map displays.</td></tr>
<tr><td>eo</td><td>Flag whose presence means that outputting a space erases a character position even if the terminal supports overstriking.  If this flag is not present and overstriking is supported, output of a space has no effect except to move the cursor.  (On terminals that do not support overstriking, you can always assume that outputting a space at a position erases whatever character was previously displayed there.)</td></tr>
<tr><td>gn</td><td>Flag whose presence means that this terminal type is a generic type which does not really describe any particular terminal.  Generic types are intended for use as the default type assigned when the user connects to the system, with the intention that the user should specify what type he really has.  One example of a generic type is the type <code>network</code>.  Since the generic type cannot say how to do anything interesting with the terminal, termcap-using programs will always find that the terminal is too weak to be supported if the user has failed to specify a real terminal type in place of the generic one.  The gnflag directs these programs to use a different error message: “You have not specified your real terminal type”, rather than “Your terminal is not powerful enough to be used”.</td></tr>
<tr><td>hc</td><td>Flag whose presence means this is a hardcopy terminal.</td></tr>
<tr><td>rp</td><td>String of commands to output a graphic character <var>c</var>, repeated <var>n</var> times.  The first parameter value is the ASCII code for the desired character, and the second parameter is the number of times to repeat the character.  Often this command requires padding proportional to the number of times the character is repeated.  This effect can be had by using parameter arithmetic with <code>&lt;samp&gt;%&lt;/samp&gt;</code>-sequences to compute the amount of padding, then generating the result as a number at the front of the string so that <code>tputs</code> will treat it as padding.</td></tr>
<tr><td>hz</td><td>Flag whose presence means that the ASCII character cannot be output on this terminal because it is used for display commands.  Programs handle this flag by checking all text to be output and replacing each ~with some other character(s).  If this is not done, the screen will be thoroughly garbled.  The old Hazeltine terminals that required such treatment are probably very rare today, so you might as well not bother to support this flag.</td></tr>
<tr><td>CC</td><td>String whose presence means the terminal has a settable command character.  The value of the string is the default command character (which is usually &lt;ESC&gt;).  All the strings of commands in the terminal description should be written to use the default command character.  If you are writing an application program that changes the command character, use the CCcapability to figure out how to translate all the display commands to work with the new command character.  Most programs have no reason to look at the CCcapability.</td></tr>
<tr><td>xb</td><td>Flag whose presence identifies Superbee terminals which are unable to transmit the characters &lt;ESC&gt; and <kbd>Control-C</kbd>.  Programs which support this flag are supposed to check the input for the code sequences sent by the &lt;F1&gt; and &lt;F2&gt; keys, and pretend that &lt;ESC&gt; or <kbd>Control-C</kbd> (respectively) had been read.  But this flag is obsolete, and not worth supporting.</td></tr>
</tbody></table>

<h2>7bit vs. 8bit</h2>
<p>These recommendations are optional.  IBCS2 allows the leading escape to # be either the 7-bit <code>\E[</code> or 8-bit <code>\0233</code> introducer, in accordance with # the ANSI X.364/ISO 6429/ECMA-48 standard.</p>
<blockquote><cite>1.6.1 Describing the Encoding</cite> <p>For example, the <code>cm</code> string for a standard ANSI terminal is written as <code>\E[%i%d;%dH</code>.  (<code>\E</code> stands for .)  <code>cm</code> by convention always requires two parameters, the vertical and horizontal goal positions, so this string specifies the encoding of two parameters.  Here <code>%i</code> increments the two values supplied, and each <code>%d</code> encodes one of the values in decimal.  If the cursor position values 20,58 are encoded with this string, the result is <code>\E[21;59H</code>.</p></blockquote>
<p>First, here are the <code>%</code>-sequences that generate output.  Except for <code>%%</code>, each of them encodes one parameter and advances the pointer to the following parameter.</p>
<ul>
<li><code>%%</code> Output a single <code>%</code>.  This is the only way to represent a literal <code>%</code> in a terminal command with parameters.  <code>%%</code> does not use up a parameter.</li>
<li><code>%d</code> As in <code>printf</code>, output the next parameter in decimal.</li>
<li><code>%2</code> Like <code>%02d</code> in <code>printf</code>: output the next parameter in decimal, and always use at least two digits.</li>
<li><code>%3</code> Like <code>%03d</code> in <code>printf</code>: output the next parameter in decimal, and always use at least three digits.  Note that <code>%4</code> and so on are _not_ defined.</li>
<li><code>%.</code> Output the next parameter as a single character whose ASCII code is the parameter value.  Like <code>%c</code> in <code>printf</code>.</li>
<li><code>%+CHAR</code> Add the next parameter to the character CHAR, and output the resulting character.  For example, <code>%+ </code> represents 0 as a space, 1 as <code>!</code>, etc.</li>
</ul>

<p>The following <code>%</code>-sequences specify alteration of the parameters (their values, or their order) rather than encoding a parameter for output.  They generate no output; they are used only for their side effects on the parameters.  Also, they do not advance the "next parameter" pointer except as explicitly stated.  Only <code>%i</code>, <code>%r</code> and <code>%&gt;</code> are defined in standard Unix termcap.  The others are GNU extensions.</p>
<ul>
<li><code>%i</code> Increment the next two parameters.  This is used for terminals that expect cursor positions in origin 1.  For example, <code>%i%d,%d</code> would output two parameters with <code>1</code> for 0, <code>2</code> for 1, etc.</li>
<li><code>%r</code> Interchange the next two parameters.  This is used for terminals whose cursor positioning command expects the horizontal position first.</li>
<li><code>%s</code> Skip the next parameter.  Do not output anything.</li>
<li><code>%b</code> Back up one parameter.  The last parameter used will become once again the next parameter to be output, and the next output command will use it.  Using <code>%b</code> more than once, you can back up any number of parameters, and you can refer to each parameter any number of times.</li>
<li><code>%&gt;C1C2</code> Conditionally increment the next parameter.  Here C1 and C2 are characters which stand for their ASCII codes as numbers.  If the next parameter is greater than the ASCII code of C1, the ASCII code of C2 is added to it.</li>
<li><code>%a OP TYPE POS</code> Perform arithmetic on the next parameter, do not use it up, and do not output anything.  Here OP specifies the arithmetic operation, while TYPE and POS together specify the other operand.</li>
</ul>


<p>Spaces are used above to separate the operands for clarity; the spaces don't appear in the data base, where this sequence is exactly five characters long.  The character OP says what kind of arithmetic operation to perform.  It can be any of these characters:</p>
<ul>
<li><var>=</var> - assign a value to the next parameter, ignoring its old value.   The new value comes from the other operand.</li>
<li><var>+</var> - add the other operand to the next parameter.</li>
<li><var>-</var> - subtract the other operand from the next parameter.</li>
<li><var>*</var> - multiply the next parameter by the other operand.</li>
<li><var>/</var> - divide the next parameter by the other operand.</li>
</ul>

<p>The "other operand" may be another parameter's value or a constant; the character TYPE says which.  It can be:</p>
<ul>
<li><var>p</var> - Use another parameter.  The character POS says which   parameter to use.  Subtract 64 from its ASCII code to get the   position of the desired parameter relative to this one.  Thus,   the character <code>A</code> as POS means the parameter after the next   one; the character <code>?</code> means the parameter before the next   one.</li>
<li><var>c</var> - Use a constant value.  The character POS specifies the value   of the constant.  The 0200 bit is cleared out, so that 0200   can be used to represent zero.</li>
</ul>

<p>The following <code>%</code>-sequences are special purpose hacks to compensate for the weird designs of obscure terminals.  They modify the next parameter or the next two parameters but do not generate output and do not use up any parameters.  <code>%m</code> is a GNU extension; the others are defined in standard Unix termcap.</p>
<ul>
<li><var>%n</var> - Exclusive-or the next parameter with 0140, and likewise the parameter after next.</li>
<li><var>%m</var> - Complement all the bits of the next parameter and the parameter after next.</li>
<li><var>%B</var> - Encode the next parameter in BCD.  It alters the value of the parameter by adding six times the quotient of the parameter by ten. Here is a C statement that shows how the new value is computed:  <code>PARM = (PARM / 10) * 16 + PARM % 10;</code></li>
<li><var>%D</var> - Transform the next parameter as needed by Delta Data terminals. This involves subtracting twice the remainder of the parameter by 16.  <code>PARM -= 2 * (PARM % 16);</code></li>
</ul>

<h2>Terminal Type Name Conventions</h2>
<p>Here is a list of standard suffixes and their conventional meanings:</p>
<ul>
<li><var>-w</var> - Short for "wide".  This is a mode that gives the terminal more columns than usual.  This is normally a user option.</li>
<li><var>-am</var> - "Automatic margins".  This is an alternate description for use when the terminal's margin-wrap switch is on; it contains the <code>am</code> flag.  The implication is that normally the switch is off and the usual description for the terminal says that the switch is off.</li>
<li><var>-nam</var> - "No automatic margins".  The opposite of <code>-am</code>, this names an alternative description which lacks the <code>am</code> flag.  This implies that the terminal is normally operated with the margin-wrap switch turned on, and the normal description of the terminal says so.</li>
<li><var>-na</var> - "No arrows".  This terminal description initializes the terminal to keep its arrow keys in local mode.  This is a user option.</li>
<li><var>-rv</var> - "Reverse video".  This terminal description causes text output for normal video to appear as reverse, and text output for reverse video to come out as normal.  Often this description differs from the usual one by interchanging the two strings which turn reverse video on and off.</li>
</ul>

<p>This is a user option; you can choose either the "reverse video" variant terminal type or the normal terminal type, and termcap will obey.</p>
<ul>
<li><var>-s</var> - "Status".  Says to enable use of a status line which ordinary output does not touch (*note Status Line::).</li>
</ul>

<p>Some terminals have a special line that is used only as a status line.  For these terminals, there is no need for an <code>-s</code> variant; the status line commands should be defined by default.  On other terminals, enabling a status line means removing one screen line from ordinary use and reducing the effective screen height.  For these terminals, the user can choose the <code>-s</code> variant type to request use of a status line.</p>
<ul>
<li><var>-NLINES</var> - Says to operate with NLINES lines on the screen, for terminals such as the Ambassador which provide this as an option.  Normally this is a user option; by choosing the terminal type, you control how many lines termcap will use.</li>
<li><var>-NPAGESp</var> - Says that the terminal has NPAGES pages worth of screen memory, for terminals where this is a hardware option.</li>
<li><var>-unk</var> - Says that description is not for direct use, but only for reference in <code>tc</code> capabilities.  Such a description is a kind of subroutine, because it describes the common characteristics of several variant descriptions that would use other suffixes in place of <code>-unk</code>.</li>
</ul>

<h2>MS-DOS ANSI.SYS</h2>
<p>Here is a description of the color and attribute controls supported in the ANSI.SYS driver under MS-DOS.  Most console drivers and ANSI terminal emulators for Intel boxes obey these.  They are a proper subset of the ECMA-48 escapes.</p>
<p>Bright black becomes gray, bright brown becomes yellow. These coincide with the prescriptions of the ISO 6429/ECMA-48 standard.  * If the 5 attribute is on and you set a background color (40-47) it is supposed to enable bright background.</p>
<pre>0        all attributes off
1        foreground bright
4        underscore on
5        blink on/background bright (not reliable with brown)
7        reverse-video
8        set blank (non-display)
10       set primary font
11       set first alternate font (on PCs, display ROM characters 1-31)
12       set second alternate font (on PCs, display IBM high-half chars)
3n       set foreground color       / 0=black, 1=red,     2=green, 3=brown,
4n       set background color       \ 4=blue,  5=magenta, 6=cyan,  7=white</pre>

<h2>STTY</h2>
<h3>Stty Control Settings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>parenb</td><td><code>parenb</code> Generate parity bit in output and expect parity bit in input.  May be negated.</td></tr>
<tr><td>parodd</td><td>Set odd parity (even if negated).  May be negated.</td></tr>
<tr><td>cs5, cs6, cs7, cs8</td><td>Set character size to 5, 6, 7, or 8 bits.</td></tr>
<tr><td>hup, hupcl</td><td>Send a hangup signal when the last process closes the tty.  May be negated.</td></tr>
<tr><td>cstopb</td><td>Use two stop bits per character (one if negated).  May be negated.</td></tr>
<tr><td>cread</td><td>Allow input to be received.  May be negated.</td></tr>
<tr><td>clocal</td><td>Disable modem control signals.  May be negated.</td></tr>
<tr><td>crtscts</td><td>Enable RTS/CTS flow control. Disables DTR/DSR flow control. Non-POSIX.  May be negated.</td></tr>
<tr><td>cdtrdsr</td><td>Enable DTR/DSR flow control. Disables RTS/CTS flow control. Non-POSIX.  May be negated.  No stty-readable form available.  It needs to be supported by device.  Usage on device without DTR/DSR support could lead to an error and failure of <code>stty</code>.</td></tr>
</tbody></table><h3>Stty Input settings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>ignbrk</td><td>Ignore break characters.  May be negated.</td></tr>
<tr><td>brkint</td><td>Make breaks cause an interrupt signal.  May be negated.</td></tr>
<tr><td>ignpar</td><td>Ignore characters with parity errors.  May be negated.</td></tr>
<tr><td>parmrk</td><td>Mark parity errors (with a 255-0-character sequence).  May be negated.</td></tr>
<tr><td>inpck</td><td>Enable input parity checking.  May be negated.</td></tr>
<tr><td>istrip</td><td>Clear high (8th) bit of input characters.  May be negated.</td></tr>
<tr><td>inlcr</td><td>Translate newline to carriage return.  May be negated.</td></tr>
<tr><td>igncr</td><td>Ignore carriage return.  May be negated.</td></tr>
<tr><td>icrnl</td><td>Translate carriage return to newline.  May be negated.</td></tr>
<tr><td>iutf8</td><td>Assume input characters are UTF-8 encoded.  May be negated.</td></tr>
<tr><td>ixon</td><td>Enable XON/XOFF flow control (that is, <code>CTRL-S</code>/<code>CTRL-Q</code>).  May be negated.</td></tr>
<tr><td>ixoff, tandem</td><td>Enable sending of <code>stop</code> character when the system input buffer is almost full, and <code>start</code> character when it becomes almost empty again.  May be negated.</td></tr>
<tr><td>iuclc</td><td>Translate uppercase characters to lowercase.  Non-POSIX.  May be negated.</td></tr>
<tr><td>ixany</td><td>Allow any character to restart output (only the start character if negated).  Non-POSIX.  May be negated.</td></tr>
<tr><td>imaxbel</td><td>Enable beeping and not flushing input buffer if a character arrives when the input buffer is full.  Non-POSIX.  May be negated.</td></tr>
</tbody></table>
<h3>Stty Output settings</h3>
<p>These arguments specify output-related operations.</p>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>opost</td><td>Postprocess output.  May be negated.</td></tr>
<tr><td>olcuc</td><td>Translate lowercase characters to uppercase.  Non-POSIX.  May be negated.</td></tr>
<tr><td>ocrnl</td><td>Translate carriage return to newline.  Non-POSIX.  May be negated.</td></tr>
<tr><td>onlcr</td><td>Translate newline to carriage return-newline.  Non-POSIX.  May be negated.</td></tr>
<tr><td>onocr</td><td>Do not print carriage returns in the first column.  Non-POSIX. May be negated.</td></tr>
<tr><td>onlret</td><td>Newline performs a carriage return.  Non-POSIX.  May be negated.</td></tr>
<tr><td>ofill</td><td>Use fill (padding) characters instead of timing for delays. Non-POSIX.  May be negated.</td></tr>
<tr><td>ofdel</td><td>Use delete characters for fill instead of null characters. Non-POSIX.  May be negated.</td></tr>
<tr><td>nl1, nl0</td><td>Newline delay style.  Non-POSIX.</td></tr>
<tr><td>cr3, cr2, cr1, cr0</td><td>Carriage return delay style.  Non-POSIX.</td></tr>
<tr><td>tab3, tab2, tab1, tab0</td><td>Horizontal tab delay style.  Non-POSIX.</td></tr>
<tr><td>bs1, bs0</td><td>Backspace delay style.  Non-POSIX.</td></tr>
<tr><td>vt1, vt0</td><td>Vertical tab delay style.  Non-POSIX.</td></tr>
<tr><td>ff1, ff0</td><td>Form feed delay style.  Non-POSIX.</td></tr>
</tbody></table>
<h3>Stty Local settings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>isig</td><td>Enable <code>interrupt</code>, <code>quit</code>, and <code>suspend</code> special characters.  May be negated.</td></tr>
<tr><td>icanon</td><td>Enable <code>erase</code>, <code>kill</code>, <code>werase</code>, and <code>rprnt</code> special characters. May be negated.</td></tr>
<tr><td>iexten</td><td>Enable non-POSIX special characters.  May be negated.</td></tr>
<tr><td>echo</td><td>Echo input characters.  May be negated.</td></tr>
<tr><td>echoe, crterase</td><td>Echo <code>erase</code> characters as backspace-space-backspace.  May be negated.</td></tr>
<tr><td>echok</td><td>Echo a newline after a <code>kill</code> character.  May be negated.</td></tr>
<tr><td>echonl</td><td>Echo newline even if not echoing other characters.  May be negated.</td></tr>
<tr><td>noflsh</td><td>Disable flushing after <code>interrupt</code> and <code>quit</code> special characters. May be negated.</td></tr>
<tr><td>xcase</td><td>Enable input and output of uppercase characters by preceding their lowercase equivalents with <code>\</code>, when <code>icanon</code> is set.  Non-POSIX. May be negated.</td></tr>
<tr><td>tostop</td><td>Stop background jobs that try to write to the terminal.  Non-POSIX. May be negated.</td></tr>
<tr><td>echoprt, prterase</td><td>Echo erased characters backward, between <code>\</code> and <code>/</code>.  Non-POSIX. May be negated.</td></tr>
<tr><td>echoctl, ctlecho</td><td>Echo control characters in hat notation (<code>^C</code>) instead of literally.  Non-POSIX.  May be negated.</td></tr>
<tr><td>echoke, crtkill</td><td>Echo the <code>kill</code> special character by erasing each character on the line as indicated by the <code>echoprt</code> and <code>echoe</code> settings, instead of by the <code>echoctl</code> and <code>echok</code> settings.  Non-POSIX.  May be negated.</td></tr>
</tbody></table>
<h3>Stty Combination settings</h3>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td>evenp, parity</td><td>Same as <code>parenb -parodd cs7</code>.  May be negated.  If negated, same as <code>-parenb cs8</code>.</td></tr>
<tr><td>oddp</td><td>Same as <code>parenb parodd cs7</code>.  May be negated.  If negated, same as <code>-parenb cs8</code>.</td></tr>
<tr><td>nl</td><td>Same as <code>-icrnl -onlcr</code>.  May be negated.  If negated, same as <code>icrnl -inlcr -igncr onlcr -ocrnl -onlret</code>.</td></tr>
<tr><td>ek</td><td>Reset the <code>erase</code> and <code>kill</code> special characters to their default values.</td></tr>
<tr><td>sane</td><td>Sets all special characters to their default values and: <pre>cread -ignbrk brkint -inlcr -igncr icrnl -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke</pre></td></tr>
<tr><td>cooked</td><td>Same as <code>brkint ignpar istrip icrnl ixon opost isig icanon</code>, plus sets the <code>eof</code> and <code>eol</code> characters to their default values if they are the same as the <code>min</code> and <code>time</code> characters.  May be negated.  If negated, same as <code>raw</code>.</td></tr>
<tr><td>raw</td><td>Same as: <pre>-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0</pre> May be negated.  If negated, same as <code>cooked</code>.</td></tr>
<tr><td>cbreak</td><td>Same as <code>-icanon</code>.  May be negated.  If negated, same as <code>icanon</code>.</td></tr>
<tr><td>pass8</td><td>Same as <code>-parenb -istrip cs8</code>.  May be negated.  If negated, same as <code>parenb istrip cs7</code>.</td></tr>
<tr><td>litout</td><td>Same as <code>-parenb -istrip -opost cs8</code>.  May be negated.  If negated, same as <code>parenb istrip opost cs7</code>.</td></tr>
<tr><td>decctlq</td><td>Same as <code>-ixany</code>.  Non-POSIX.  May be negated.</td></tr>
<tr><td>tabs</td><td>Same as <code>tab0</code>.  Non-POSIX.  May be negated.  If negated, same as <code>tab3</code>.</td></tr>
<tr><td>lcase, LCASE</td><td>Same as <code>xcase iuclc olcuc</code>.  Non-POSIX.  May be negated.</td></tr>
<tr><td>crt</td><td>Same as <code>echoe echoctl echoke</code>.</td></tr>
<tr><td>dec</td><td>Same as <code>echoe echoctl echoke -ixany intr ^C erase ^? kill C-u</code>.</td></tr>
</tbody></table>

<h3>Special characters</h3>
<p>The special characters' default values vary from system to system. They are set with the syntax <code>name value</code>, where the names are listed below and the value can be given either literally, in hat notation (<code>^C</code>), or as an integer which may start with <code>0x</code> to indicate hexadecimal, <code>0</code> to indicate octal, or any other digit to indicate decimal.</p>
<p>For GNU stty, giving a value of <code>^-</code> or <code>undef</code> disables that special character.  (This is incompatible with Ultrix <code>stty</code>, which uses  a value of <code>u</code> to disable a special character.  GNU <code>stty</code> treats a value <code>u</code> like any other, namely to set that special character to .)</p>
<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td><var>intr</var></td><td>Send an interrupt signal.</td></tr>
<tr><td><var>quit</var></td><td>Send a quit signal.</td></tr>
<tr><td><var>erase</var></td><td>Erase the last character typed.</td></tr>
<tr><td><var>kill</var></td><td>Erase the current line.</td></tr>
<tr><td><var>eof</var></td><td>Send an end of file (terminate the input).</td></tr>
<tr><td><var>eol</var></td><td>End the line.</td></tr>
<tr><td><var>eol2</var></td><td>Alternate character to end the line.  Non-POSIX.</td></tr>
<tr><td><var>swtch</var></td><td>Switch to a different shell layer.  Non-POSIX.</td></tr>
<tr><td><var>start</var></td><td>Restart the output after stopping it.</td></tr>
<tr><td><var>stop</var></td><td>Stop the output.</td></tr>
<tr><td><var>susp</var></td><td>Send a terminal stop signal.</td></tr>
<tr><td><var>dsusp</var></td><td>Send a terminal stop signal after flushing the input.  Non-POSIX.</td></tr>
<tr><td><var>rprnt</var></td><td>Redraw the current line.  Non-POSIX.</td></tr>
<tr><td><var>werase</var></td><td>Erase the last word typed.  Non-POSIX.</td></tr>
<tr><td><var>lnext</var></td><td>Enter the next character typed literally, even if it is a special character.  Non-POSIX.</td></tr>
</tbody></table>


<h3>Special settings</h3>
<ul>
<li><var>min N</var> - Set the minimum number of characters that will satisfy a read until the time value has expired, when <code>-icanon</code> is set.</li>
<li><var>time N</var> - Set the number of tenths of a second before reads time out if the minimum number of characters have not been read, when <code>-icanon</code> is set.</li>
<li><var>ispeed N</var> - Set the input speed to N.</li>
<li><var>ospeed N</var> - Set the output speed to N.</li>
<li><var>rows N</var> - Tell the tty kernel driver that the terminal has N rows. Non-POSIX.</li>
<li><var>cols N</var>, <var>columns N</var> - Tell the kernel that the terminal has N columns.  Non-POSIX.</li>
<li><var>size</var> - Print the number of rows and columns that the kernel thinks the terminal has.  (Systems that don't support rows and columns in the kernel typically use the environment variables <code>LINES</code> and <code>COLUMNS</code> instead; however, GNU <code>stty</code> does not know anything about them.)  Non-POSIX.</li>
<li><var>line N</var> - Use line discipline N.  Non-POSIX.</li>
<li><var>speed</var> - Print the terminal speed.</li>
<li><var>N</var> - Set the input and output speeds to N.  N can be one of: 0 50 75 110 134 134.5 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 <code>exta</code> <code>extb</code>.  <code>exta</code> is the same as 19200; <code>extb</code> is the same as 38400.  0 hangs up the line if <code>-clocal</code> is set.</li>
</ul>


<h2>Color Terminals</h2>
<pre>color256 ()
{
    local L=$(sed &#039;s/[0-9]//g; s/./#/g&#039; &lt;&lt;&lt;`seq -s+0 $(($COLUMNS - 10))`);
    for i in `seq 0 $(tput colors)`;
    do printf " %.3d `tput setab $i`${L}${R} %.3d `tput setab 0;tput setaf 7`\n" $i $i | tr &#039;#&#039; &#039; &#039;;
    done
}</pre>

<pre>for F in `find ~/.terminfo/ -type f | sed &#039;s/^.*\///&#039; | xargs -P0 -I&#039;TT&#039; sh -c &#039;echo "$(tput -T TT colors): TT"&#039;|sed &#039;/^-/d&#039;| grep ^16:|cut -d: -f2`; do
echo -e "\n\n";
pm $F; export TERM=$F; tput -T $F initc; color256; done</pre>

<pre>find ~/.terminfo/ -type f | sed &#039;s/^.*\///&#039; | xargs -I&#039;TT&#039; sh -c &#039;echo "$(tput -T TT colors): TT"&#039;|sed &#039;/^-/d&#039;</pre>

<h3>Terminals with 16 Colors</h3>
<ul>
<li><var>aixterm-16color</var></li>
<li><var>amiga-vnc</var></li>
<li><var>hp2397</var></li>
<li><var>hp2397a</var></li>
<li><var>hp+color</var></li>
<li><var>ibm+16color</var></li>
<li><var>konsole-16color</var></li>
<li><var>nsterm-16color</var></li>
<li><var>nsterm-7-c</var></li>
<li><var>nsterm-7-c-s</var></li>
<li><var>nsterm-acs-c</var></li>
<li><var>nsterm-acs-c-s</var></li>
<li><var>nsterm-c</var></li>
<li><var>nsterm+c</var></li>
<li><var>nsterm-c-7</var></li>
<li><var>nsterm-c-acs</var></li>
<li><var>nsterm-c-s</var></li>
<li><var>nsterm-c-s-7</var></li>
<li><var>nsterm-c-s-acs</var></li>
<li><var>rxvt-16color</var></li>
<li><var>screen-16color</var></li>
<li><var>screen-16color-bce</var></li>
<li><var>screen-16color-bce-s</var></li>
<li><var>screen-16color-s</var></li>
<li><var>xterm-16color</var></li>
</ul>

<h3>Terminals with 52 Colors</h3>
<ul>
<li><var>d430c-dg-ccc</var></li>
<li><var>d430c-unix-25-ccc</var></li>
<li><var>d430c-unix-ccc</var></li>
<li><var>d430c-unix-s-ccc</var></li>
<li><var>d430c-unix-sr-ccc</var></li>
<li><var>d430c-unix-w-ccc</var></li>
<li><var>d430-dg-ccc</var></li>
<li><var>d430-unix-25-ccc</var></li>
<li><var>d430-unix-ccc</var></li>
<li><var>d430-unix-s-ccc</var></li>
<li><var>d430-unix-sr-ccc</var></li>
<li><var>d430-unix-w-ccc</var></li>
<li><var>dg+ccc</var></li>
<li><var>dgunix+ccc</var></li>
</ul>

<h3>Terminals with 64 Colors</h3>
<ul>
<li><var>hpterm-color</var></li>
<li><var>wy370</var></li>
<li><var>wy370-101k</var></li>
<li><var>wy370-105k</var></li>
<li><var>wy370-EPC</var></li>
<li><var>wy370-nk</var></li>
<li><var>wy370-rv</var></li>
<li><var>wy370-vb</var></li>
<li><var>wy370-w</var></li>
<li><var>wy370-wvb</var></li>
<li><var>wyse370</var></li>
<li><var>Eterm-88color</var></li>
<li><var>rxvt-88color</var></li>
<li><var>xterm-88color</var></li>
<li><var>xterm+88color</var></li>
</ul>

<h3>Terminals with 256 colors</h3>
<ul>
<li><var>Eterm-256color</var></li>
<li><var>gnome-256color</var></li>
<li><var>konsole-256color</var></li>
<li><var>putty-256color</var></li>
<li><var>rxvt-256color</var></li>
<li><var>screen-256color</var></li>
<li><var>screen-256color-bce</var></li>
<li><var>screen-256color-bce-s</var></li>
<li><var>screen-256color-s</var></li>
<li><var>xterm-256color</var></li>
<li><var>xterm+256color</var></li>
</ul>


<h3>View All tput capabilities</h3>
<p><a href="http://blogs.msdn.com/adioltean/articles/271063.aspx">http://blogs.msdn.com/adioltean/articles/271063.aspx</a></p>
<pre>function tputs(){ infocmp -1|sed &#039;s/^[   ]*//; /=/!d; s/=.*//g; /[#\|]/d&#039;; }</pre>

<p>Some  common  terminfo  parameter sequences, their termcap equivalents, and some terminal types which commonly have such sequences, are:</p>
<pre>terminfo                    termcap   Representative Terminals
---------------------------------------------------------------
%p1%c                       %.        adm
%p1%d                       %d        hp, ANSI standard, vt100
%p1%+%c                 %+x       concept
%i                          %iq       ANSI standard, vt100
%p1%?%&gt;%t%p1%+%;    %&gt;xy      concept
%p2 is printed before %p1   %r        hp</pre>



<h2>Installing your Own Terminfo</h2>
<p><a href="http://nion.modprobe.de/mostlike.txt">MostLike</a>, or if that is offline I uploaded a copy: <a href="http://uploads.askapache.com/2010/03/mostlike.txt">mostlike - manpages with color looking like most</a></p>
<pre>rm -rvf ~/.terminfo
mkdir -pv ~/.terminfo
curl -o terminfo.master http://nion.modprobe.de/mostlike.txt; curl -Ss ftp://invisible-island.net/ncurses/terminfo.src.gz
export TERMINFO=~/.terminfo;
sudo tic -e screen-256color,screen-256color-s,screen-256color-bce,screen-256color-bce-s,xterm+256color,xterm,xterm-pcolor terminfo.src</pre>


<h2>256 Colors in Terminal</h2>
<h3>256 Colors (Background)</h3>
<pre>W=`tput setaf 7` RC="\E[0;0;0m" L=$(sed &#039;s/[0-9]//g; s/./ /g&#039; &lt;&lt;&lt;`seq -s+0 $(($COLUMNS/2))`);
&nbsp;
for i in `seq 0 256`;
do
  printf "${W}\n%.3d `tput setab $i`${L}${RC}" $i;
done</pre>



<h3>256 Colors (Foreground)</h3>
<pre>W=`tput setaf 7` WB=`tput setab 0` RC="\E[0;0;0m" L=$(sed &#039;s/[0-9]//g; s/./#/g&#039; &lt;&lt;&lt;`seq -s+0 $(($COLUMNS/2))`);
for i in `seq 0 256`;
do
  printf "${WB}\n%.3d `tput setaf $i`${L}${RC}" $i;
done</pre>



<h2>Terminal Capabilities - Infocmp</h2>
<pre>infocmp -1Lq|grep -v "$TERM\|#"|tr -d &#039;  &#039;</pre>

<h3>DEC/ANSI special sequences</h3>
<p>List of the DEC/ANSI special sequences recognized:</p>
<table class="bordered">
<tbody>
<tr class="header">
<th>Action</th>
<th>Meaning</th>
</tr>
<tr><td><code>%%</code></td>
        <td>The percent sign</td></tr>
<tr class="odd"><td><code>%t</code></td>
        <td>The time the request was received in Universal Coordinated Time
        since the epoch (Jan. 1, 1970) measured in microseconds. The value
        is preceded by <code>t=</code>.</td></tr>
<tr><td><code>%D</code></td>
        <td>The time from when the request was received to the time the
        headers are sent on the wire. This is a measure of the duration
        of the request. The value is preceded by <code>D=</code>.
        The value is measured in microseconds.</td></tr>
<tr class="odd"><td><code>%{VARNAME}e</code></td>
        <td>The contents of the <a href="../env.html">environment
        variable</a> <code>VARNAME</code>.</td></tr>
<tr><td><code>%{VARNAME}s</code></td>
        <td>The contents of the <a href="mod_ssl.html#envvars">SSL environment
        variable</a> <code>VARNAME</code>, if <code>&lt;a href="../mod/mod_ssl.html"&gt;mod_ssl&lt;/a&gt;</code> is enabled.</td></tr>

-----------------------------------------
<tr><td><code>RIS         </code></td><td>full reset</td></tr>
<tr><td><code>SC          </code></td><td>save cursor</td></tr>
<tr><td><code>RC          </code></td><td>restore cursor</td></tr>
<tr><td><code>LL          </code></td><td>home-down</td></tr>
<tr><td><code>RSR         </code></td><td>reset scroll region</td></tr>
-----------------------------------------
<tr><td><code>DECSTR      </code></td><td>soft reset (VT320)</td></tr>
<tr><td><code>S7C1T       </code></td><td>7-bit controls (VT220)</td></tr>
-----------------------------------------
<tr><td><code>ISO DEC G0  </code></td><td>enable DEC graphics for G0</td></tr>
<tr><td><code>ISO UK G0   </code></td><td>enable UK chars for G0</td></tr>
<tr><td><code>ISO US G0   </code></td><td>enable US chars for G0</td></tr>
<tr><td><code>ISO DEC G1  </code></td><td>enable DEC graphics for G1</td></tr>
<tr><td><code>ISO UK G1   </code></td><td>enable UK chars for G1</td></tr>
<tr><td><code>ISO US G1   </code></td><td>enable US chars for G1</td></tr>
-----------------------------------------
<tr><td><code>DECPAM      </code></td><td>application keypad mode</td></tr>
<tr><td><code>DECPNM      </code></td><td>normal keypad mode</td></tr>
<tr><td><code>DECANSI     </code></td><td>enter ANSI mode</td></tr>
-----------------------------------------
<tr><td><code>ECMA[+-]AM  </code></td><td>keyboard action mode</td></tr>
<tr><td><code>ECMA[+-]IRM </code></td><td>insert replace mode</td></tr>
<tr><td><code>ECMA[+-]SRM </code></td><td>send receive mode</td></tr>
<tr><td><code>ECMA[+-]LNM </code></td><td>linefeed mode</td></tr>
-----------------------------------------
<tr><td><code>DEC[+-]CKM  </code></td><td>application cursor keys</td></tr>
<tr><td><code>DEC[+-]ANM  </code></td><td>set VT52 mode</td></tr>
<tr><td><code>DEC[+-]COLM </code></td><td>132-column mode</td></tr>
<tr><td><code>DEC[+-]SCLM </code></td><td>smooth scroll</td></tr>
<tr><td><code>DEC[+-]SCNM </code></td><td>reverse video mode</td></tr>
<tr><td><code>DEC[+-]OM   </code></td><td>origin mode</td></tr>
<tr><td><code>DEC[+-]AWM  </code></td><td>wraparound mode</td></tr>
<tr><td><code>DEC[+-]ARM  </code></td><td>auto-repeat mode</td></tr>
</tbody>
</table>




<table class="bordered"><tbody><tr class="header"><th>Name</th><th>Description</th></tr>
<tr><td><a id="acs_chars">acs_chars</a></td><td><code>``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,</code></td></tr>
<tr><td><a id="back_tab">back_tab</a></td><td><code>\E[Z,</code></td></tr>
<tr><td><a id="bell">bell</a></td><td><code>^G,</code></td></tr>
<tr><td><a id="carriage_return">carriage_return</a></td><td><code>^M,</code></td></tr>
<tr><td><a id="change_scroll_region">change_scroll_region</a></td><td><code>\E[%i%p1%d;%p2%dr,</code></td></tr>
<tr><td><a id="clear_all_tabs">clear_all_tabs</a></td><td><code>\E[3g,</code></td></tr>
<tr><td><a id="clear_screen">clear_screen</a></td><td><code>\E[H\E[2J,</code></td></tr>
<tr><td><a id="clr_bol">clr_bol</a></td><td><code>\E[1K,</code></td></tr>
<tr><td><a id="clr_eol">clr_eol</a></td><td><code>\E[K,</code></td></tr>
<tr><td><a id="clr_eos">clr_eos</a></td><td><code>\E[J,</code></td></tr>
<tr><td><a id="column_address">column_address</a></td><td><code>\E[%i%p1%dG,</code></td></tr>
<tr><td><a id="cursor_address">cursor_address</a></td><td><code>\E[%i%p1%d;%p2%dH,</code></td></tr>
<tr><td><a id="cursor_down">cursor_down</a></td><td><code>^J,</code></td></tr>
<tr><td><a id="cursor_home">cursor_home</a></td><td><code>\E[H,</code></td></tr>
<tr><td><a id="cursor_invisible">cursor_invisible</a></td><td><code>\E[?25l,</code></td></tr>
<tr><td><a id="cursor_left">cursor_left</a></td><td><code>^H,</code></td></tr>
<tr><td><a id="cursor_normal">cursor_normal</a></td><td><code>\E[?12l\E[?25h,</code></td></tr>
<tr><td><a id="cursor_right">cursor_right</a></td><td><code>\E[C,</code></td></tr>
<tr><td><a id="cursor_up">cursor_up</a></td><td><code>\E[A,</code></td></tr>
<tr><td><a id="cursor_visible">cursor_visible</a></td><td><code>\E[?12;25h,</code></td></tr>
<tr><td><a id="delete_character">delete_character</a></td><td><code>\E[P,</code></td></tr>
<tr><td><a id="delete_line">delete_line</a></td><td><code>\E[M,</code></td></tr>
<tr><td><a id="enter_alt_charset_mode">enter_alt_charset_mode</a></td><td><code>\E(0,</code></td></tr>
<tr><td><a id="enter_am_mode">enter_am_mode</a></td><td><code>\E[?7h,</code></td></tr>
<tr><td><a id="enter_blink_mode">enter_blink_mode</a></td><td><code>\E[5m,</code></td></tr>
<tr><td><a id="enter_bold_mode">enter_bold_mode</a></td><td><code>\E[1m,</code></td></tr>
<tr><td><a id="enter_ca_mode">enter_ca_mode</a></td><td><code>\E[?1049h,</code></td></tr>
<tr><td><a id="enter_insert_mode">enter_insert_mode</a></td><td><code>\E[4h,</code></td></tr>
<tr><td><a id="enter_reverse_mode">enter_reverse_mode</a></td><td><code>\E[7m,</code></td></tr>
<tr><td><a id="enter_secure_mode">enter_secure_mode</a></td><td><code>\E[8m,</code></td></tr>
<tr><td><a id="enter_standout_mode">enter_standout_mode</a></td><td><code>\E[7m,</code></td></tr>
<tr><td><a id="enter_underline_mode">enter_underline_mode</a></td><td><code>\E[4m,</code></td></tr>
<tr><td><a id="erase_chars">erase_chars</a></td><td><code>\E[%p1%dX,</code></td></tr>
<tr><td><a id="exit_alt_charset_mode">exit_alt_charset_mode</a></td><td><code>\E(B,</code></td></tr>
<tr><td><a id="exit_am_mode">exit_am_mode</a></td><td><code>\E[?7l,</code></td></tr>
<tr><td><a id="exit_attribute_mode">exit_attribute_mode</a></td><td><code>\E(B\E[m,</code></td></tr>
<tr><td><a id="exit_ca_mode">exit_ca_mode</a></td><td><code>\E[?1049l,</code></td></tr>
<tr><td><a id="exit_insert_mode">exit_insert_mode</a></td><td><code>\E[4l,</code></td></tr>
<tr><td><a id="exit_standout_mode">exit_standout_mode</a></td><td><code>\E[27m,</code></td></tr>
<tr><td><a id="exit_underline_mode">exit_underline_mode</a></td><td><code>\E[24m,</code></td></tr>
<tr><td><a id="flash_screen">flash_screen</a></td><td><code>\E[?5h$&lt;100/&gt;\E[?5l,</code></td></tr>
<tr><td><a id="init_2string">init_2string</a></td><td><code>\E[\041p\E[?3;4l\E[4l\E&gt;,</code></td></tr>
<tr><td><a id="initialize_color">initialize_color</a></td><td><code>\E]4;%p1%d;rgb\072%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\,</code></td></tr>
<tr><td><a id="insert_line">insert_line</a></td><td><code>\E[L,</code></td></tr>
<tr><td><a id="key_b2">key_b2</a></td><td><code>\EOE,</code></td></tr>
<tr><td><a id="key_backspace">key_backspace</a></td><td><code>\177,</code></td></tr>
<tr><td><a id="key_btab">key_btab</a></td><td><code>\E[Z,</code></td></tr>
<tr><td><a id="key_dc">key_dc</a></td><td><code>\E[3~,</code></td></tr>
<tr><td><a id="key_down">key_down</a></td><td><code>\EOB,</code></td></tr>
<tr><td><a id="key_end">key_end</a></td><td><code>\EOF,</code></td></tr>
<tr><td><a id="key_enter">key_enter</a></td><td><code>\EOM,</code></td></tr>
<tr><td><a id="key_f1">key_f1</a></td><td><code>\EOP,</code></td></tr>
<tr><td><a id="key_f10">key_f10</a></td><td><code>\E[21~,</code></td></tr>
<tr><td><a id="key_f11">key_f11</a></td><td><code>\E[23~,</code></td></tr>
<tr><td><a id="key_f12">key_f12</a></td><td><code>\E[24~,</code></td></tr>
<tr><td><a id="key_f13">key_f13</a></td><td><code>\EO2P,</code></td></tr>
<tr><td><a id="key_f14">key_f14</a></td><td><code>\EO2Q,</code></td></tr>
<tr><td><a id="key_f15">key_f15</a></td><td><code>\EO2R,</code></td></tr>
<tr><td><a id="key_f16">key_f16</a></td><td><code>\EO2S,</code></td></tr>
<tr><td><a id="key_f17">key_f17</a></td><td><code>\E[15;2~,</code></td></tr>
<tr><td><a id="key_f18">key_f18</a></td><td><code>\E[17;2~,</code></td></tr>
<tr><td><a id="key_f19">key_f19</a></td><td><code>\E[18;2~,</code></td></tr>
<tr><td><a id="key_f2">key_f2</a></td><td><code>\EOQ,</code></td></tr>
<tr><td><a id="key_f20">key_f20</a></td><td><code>\E[19;2~,</code></td></tr>
<tr><td><a id="key_f21">key_f21</a></td><td><code>\E[20;2~,</code></td></tr>
<tr><td><a id="key_f22">key_f22</a></td><td><code>\E[21;2~,</code></td></tr>
<tr><td><a id="key_f23">key_f23</a></td><td><code>\E[23;2~,</code></td></tr>
<tr><td><a id="key_f24">key_f24</a></td><td><code>\E[24;2~,</code></td></tr>
<tr><td><a id="key_f25">key_f25</a></td><td><code>\EO5P,</code></td></tr>
<tr><td><a id="key_f26">key_f26</a></td><td><code>\EO5Q,</code></td></tr>
<tr><td><a id="key_f27">key_f27</a></td><td><code>\EO5R,</code></td></tr>
<tr><td><a id="key_f28">key_f28</a></td><td><code>\EO5S,</code></td></tr>
<tr><td><a id="key_f29">key_f29</a></td><td><code>\E[15;5~,</code></td></tr>
<tr><td><a id="key_f3">key_f3</a></td><td><code>\EOR,</code></td></tr>
<tr><td><a id="key_f30">key_f30</a></td><td><code>\E[17;5~,</code></td></tr>
<tr><td><a id="key_f31">key_f31</a></td><td><code>\E[18;5~,</code></td></tr>
<tr><td><a id="key_f32">key_f32</a></td><td><code>\E[19;5~,</code></td></tr>
<tr><td><a id="key_f33">key_f33</a></td><td><code>\E[20;5~,</code></td></tr>
<tr><td><a id="key_f34">key_f34</a></td><td><code>\E[21;5~,</code></td></tr>
<tr><td><a id="key_f35">key_f35</a></td><td><code>\E[23;5~,</code></td></tr>
<tr><td><a id="key_f36">key_f36</a></td><td><code>\E[24;5~,</code></td></tr>
<tr><td><a id="key_f37">key_f37</a></td><td><code>\EO6P,</code></td></tr>
<tr><td><a id="key_f38">key_f38</a></td><td><code>\EO6Q,</code></td></tr>
<tr><td><a id="key_f39">key_f39</a></td><td><code>\EO6R,</code></td></tr>
<tr><td><a id="key_f4">key_f4</a></td><td><code>\EOS,</code></td></tr>
<tr><td><a id="key_f40">key_f40</a></td><td><code>\EO6S,</code></td></tr>
<tr><td><a id="key_f41">key_f41</a></td><td><code>\E[15;6~,</code></td></tr>
<tr><td><a id="key_f42">key_f42</a></td><td><code>\E[17;6~,</code></td></tr>
<tr><td><a id="key_f43">key_f43</a></td><td><code>\E[18;6~,</code></td></tr>
<tr><td><a id="key_f44">key_f44</a></td><td><code>\E[19;6~,</code></td></tr>
<tr><td><a id="key_f45">key_f45</a></td><td><code>\E[20;6~,</code></td></tr>
<tr><td><a id="key_f46">key_f46</a></td><td><code>\E[21;6~,</code></td></tr>
<tr><td><a id="key_f47">key_f47</a></td><td><code>\E[23;6~,</code></td></tr>
<tr><td><a id="key_f48">key_f48</a></td><td><code>\E[24;6~,</code></td></tr>
<tr><td><a id="key_f49">key_f49</a></td><td><code>\EO3P,</code></td></tr>
<tr><td><a id="key_f5">key_f5</a></td><td><code>\E[15~,</code></td></tr>
<tr><td><a id="key_f50">key_f50</a></td><td><code>\EO3Q,</code></td></tr>
<tr><td><a id="key_f51">key_f51</a></td><td><code>\EO3R,</code></td></tr>
<tr><td><a id="key_f52">key_f52</a></td><td><code>\EO3S,</code></td></tr>
<tr><td><a id="key_f53">key_f53</a></td><td><code>\E[15;3~,</code></td></tr>
<tr><td><a id="key_f54">key_f54</a></td><td><code>\E[17;3~,</code></td></tr>
<tr><td><a id="key_f55">key_f55</a></td><td><code>\E[18;3~,</code></td></tr>
<tr><td><a id="key_f56">key_f56</a></td><td><code>\E[19;3~,</code></td></tr>
<tr><td><a id="key_f57">key_f57</a></td><td><code>\E[20;3~,</code></td></tr>
<tr><td><a id="key_f58">key_f58</a></td><td><code>\E[21;3~,</code></td></tr>
<tr><td><a id="key_f59">key_f59</a></td><td><code>\E[23;3~,</code></td></tr>
<tr><td><a id="key_f6">key_f6</a></td><td><code>\E[17~,</code></td></tr>
<tr><td><a id="key_f60">key_f60</a></td><td><code>\E[24;3~,</code></td></tr>
<tr><td><a id="key_f61">key_f61</a></td><td><code>\EO4P,</code></td></tr>
<tr><td><a id="key_f62">key_f62</a></td><td><code>\EO4Q,</code></td></tr>
<tr><td><a id="key_f63">key_f63</a></td><td><code>\EO4R,</code></td></tr>
<tr><td><a id="key_f7">key_f7</a></td><td><code>\E[18~,</code></td></tr>
<tr><td><a id="key_f8">key_f8</a></td><td><code>\E[19~,</code></td></tr>
<tr><td><a id="key_f9">key_f9</a></td><td><code>\E[20~,</code></td></tr>
<tr><td><a id="key_home">key_home</a></td><td><code>\EOH,</code></td></tr>
<tr><td><a id="key_ic">key_ic</a></td><td><code>\E[2~,</code></td></tr>
<tr><td><a id="key_left">key_left</a></td><td><code>\EOD,</code></td></tr>
<tr><td><a id="key_mouse">key_mouse</a></td><td><code>\E[M,</code></td></tr>
<tr><td><a id="key_npage">key_npage</a></td><td><code>\E[6~,</code></td></tr>
<tr><td><a id="key_ppage">key_ppage</a></td><td><code>\E[5~,</code></td></tr>
<tr><td><a id="key_right">key_right</a></td><td><code>\EOC,</code></td></tr>
<tr><td><a id="key_sdc">key_sdc</a></td><td><code>\E[3;2~,</code></td></tr>
<tr><td><a id="key_send">key_send</a></td><td><code>\E[1;2F,</code></td></tr>
<tr><td><a id="key_sf">key_sf</a></td><td><code>\E[1;2B,</code></td></tr>
<tr><td><a id="key_shome">key_shome</a></td><td><code>\E[1;2H,</code></td></tr>
<tr><td><a id="key_sic">key_sic</a></td><td><code>\E[2;2~,</code></td></tr>
<tr><td><a id="key_sleft">key_sleft</a></td><td><code>\E[1;2D,</code></td></tr>
<tr><td><a id="key_snext">key_snext</a></td><td><code>\E[6;2~,</code></td></tr>
<tr><td><a id="key_sprevious">key_sprevious</a></td><td><code>\E[5;2~,</code></td></tr>
<tr><td><a id="key_sr">key_sr</a></td><td><code>\E[1;2A,</code></td></tr>
<tr><td><a id="key_sright">key_sright</a></td><td><code>\E[1;2C,</code></td></tr>
<tr><td><a id="key_up">key_up</a></td><td><code>\EOA,</code></td></tr>
<tr><td><a id="keypad_local">keypad_local</a></td><td><code>\E[?1l\E&gt;,</code></td></tr>
<tr><td><a id="keypad_xmit">\E[?1h\E</a></td><td><code>,</code></td></tr>
<tr><td><a id="memory_lock">memory_lock</a></td><td><code>\El,</code></td></tr>
<tr><td><a id="memory_unlock">memory_unlock</a></td><td><code>\Em,</code></td></tr>
<tr><td><a id="orig_pair">orig_pair</a></td><td><code>\E[39;49m,</code></td></tr>
<tr><td><a id="parm_dch">parm_dch</a></td><td><code>\E[%p1%dP,</code></td></tr>
<tr><td><a id="parm_delete_line">parm_delete_line</a></td><td><code>\E[%p1%dM,</code></td></tr>
<tr><td><a id="parm_down_cursor">parm_down_cursor</a></td><td><code>\E[%p1%dB,</code></td></tr>
<tr><td><a id="parm_ich">parm_ich</a></td><td><code>\E[%p1%d@,</code></td></tr>
<tr><td><a id="parm_index">parm_index</a></td><td><code>\E[%p1%dS,</code></td></tr>
<tr><td><a id="parm_insert_line">parm_insert_line</a></td><td><code>\E[%p1%dL,</code></td></tr>
<tr><td><a id="parm_left_cursor">parm_left_cursor</a></td><td><code>\E[%p1%dD,</code></td></tr>
<tr><td><a id="parm_right_cursor">parm_right_cursor</a></td><td><code>\E[%p1%dC,</code></td></tr>
<tr><td><a id="parm_rindex">parm_rindex</a></td><td><code>\E[%p1%dT,</code></td></tr>
<tr><td><a id="parm_up_cursor">parm_up_cursor</a></td><td><code>\E[%p1%dA,</code></td></tr>
<tr><td><a id="print_screen">print_screen</a></td><td><code>\E[i,</code></td></tr>
<tr><td><a id="prtr_off">prtr_off</a></td><td><code>\E[4i,</code></td></tr>
<tr><td><a id="prtr_on">prtr_on</a></td><td><code>\E[5i,</code></td></tr>
<tr><td><a id="reset_1string">reset_1string</a></td><td><code>\Ec,</code></td></tr>
<tr><td><a id="reset_2string">reset_2string</a></td><td><code>\E[\041p\E[?3;4l\E[4l\E&gt;,</code></td></tr>
<tr><td><a id="restore_cursor">restore_cursor</a></td><td><code>\E8,</code></td></tr>
<tr><td><a id="row_address">row_address</a></td><td><code>\E[%i%p1%dd,</code></td></tr>
<tr><td><a id="save_cursor">save_cursor</a></td><td><code>\E7,</code></td></tr>
<tr><td><a id="scroll_forward">scroll_forward</a></td><td><code>^J,</code></td></tr>
<tr><td><a id="scroll_reverse">scroll_reverse</a></td><td><code>\EM,</code></td></tr>
<tr><td><a id="set_a_background">set_a_background</a></td><td><code>\E[%?%p1%{8}%</code></td></tr>
</tbody></table>




<h2>Term Sorted</h2>
<pre>./MKtermsort.sh |sed &#039;s/.*\/\*  \(.*\)  \*\//\1/g&#039;|sort -u|grep ^[a-zA-Z]|sortwc|grep -v ^static|sort -d|tr " " &#039;,&#039;|sed &#039;s/\([^,]\{1,\}\),/&lt;var&gt;\1&lt;\/var&gt;,/g&#039;</pre>
<p><var>AB</var>,<var>ac</var>,<var>acs_btee</var>,<var>acsc</var>,<var>acs_chars</var>,<var>acs_hline</var>,<var>acs_llcorner</var>,<var>acs_lrcorner</var>,<var>acs_ltee</var>,<var>acs_plus</var>,<var>acs_rtee</var>,<var>acs_ttee</var>,<var>acs_ulcorner</var>,<var>acs_urcorner</var>,<var>acs_vline</var>,<var>ae</var>,<var>AF</var>,<var>al</var>,<var>AL</var>,<var>alt_scancode_esc</var>,<var>am</var>,<var>apstr</var>,<var>arrow_key_map</var>,<var>as</var>,<var>auto_left_margin</var>,<var>auto_right_margin</var>,<var>back_color_erase</var>,<var>backspace_delay</var>,<var>backspace_if_not_bs</var>,<var>backspaces_with_bs</var>,<var>back_tab</var>,<var>batt1</var>,<var>batt2</var>,<var>bc</var>,<var>bce</var>,<var>bel</var>,<var>bell</var>,<var>bicr</var>,<var>binel</var>,<var>birep</var>,<var>bit_image_carriage_return</var>,<var>bit_image_entwining</var>,<var>bit_image_newline</var>,<var>bit_image_repeat</var>,<var>bit_image_type</var>,<var>bitwin</var>,<var>bitype</var>,<var>bl</var>,<var>blink</var>,<var>bold</var>,<var>box1</var>,<var>box2</var>,<var>box_chars_1</var>,<var>bs</var>,<var>bt</var>,<var>BT</var>,<var>btml</var>,<var>btns</var>,<var>buffer_capacity</var>,<var>bufsz</var>,<var>buttons</var>,<var>bw</var>,<var>bx</var>,<var>can_change</var>,<var>carriage_return</var>,<var>carriage_return_delay</var>,<var>cb</var>,<var>cbt</var>,<var>cc</var>,<var>CC</var>,<var>ccc</var>,<var>cd</var>,<var>ce</var>,<var>ceol_standout_glitch</var>,<var>ch</var>,<var>change_char_pitch</var>,<var>change_line_pitch</var>,<var>change_res_horz</var>,<var>change_res_vert</var>,<var>change_scroll_region</var>,<var>char_padding</var>,<var>char_set_names</var>,<var>chr</var>,<var>chts</var>,<var>ci</var>,<var>civis</var>,<var>cl</var>,<var>clear</var>,<var>clear_all_tabs</var>,<var>clear_margins</var>,<var>clear_screen</var>,<var>clr_bol</var>,<var>clr_eol</var>,<var>clr_eos</var>,<var>cm</var>,<var>CM</var>,<var>cmdch</var>,<var>cnorm</var>,<var>co</var>,<var>Co</var>,<var>code_set_init</var>,<var>col_addr_glitch</var>,<var>colb0</var>,<var>colb1</var>,<var>colb2</var>,<var>colb3</var>,<var>colb4</var>,<var>colb5</var>,<var>colb6</var>,<var>colb7</var>,<var>colf0</var>,<var>colf1</var>,<var>colf2</var>,<var>colf3</var>,<var>colf4</var>,<var>colf5</var>,<var>colf6</var>,<var>colf7</var>,<var>color_names</var>,<var>colornm</var>,<var>colors</var>,<var>cols</var>,<var>column_address</var>,<var>columns</var>,<var>command_character</var>,<var>cpi</var>,<var>cpi_changes_res</var>,<var>cpix</var>,<var>cps</var>,<var>cr</var>,<var>cr_cancels_micro_mode</var>,<var>create_window</var>,<var>crt_no_scrolling</var>,<var>crxm</var>,<var>cs</var>,<var>csin</var>,<var>csnm</var>,<var>csr</var>,<var>ct</var>,<var>cub</var>,<var>cub1</var>,<var>cud</var>,<var>cud1</var>,<var>cuf</var>,<var>cuf1</var>,<var>cup</var>,<var>cursor_address</var>,<var>cursor_down</var>,<var>cursor_home</var>,<var>cursor_invisible</var>,<var>cursor_left</var>,<var>cursor_mem_address</var>,<var>cursor_normal</var>,<var>cursor_right</var>,<var>cursor_to_ll</var>,<var>cursor_up</var>,<var>cursor_visible</var>,<var>cuu</var>,<var>cuu1</var>,<var>cv</var>,<var>cvr</var>,<var>cvvis</var>,<var>CW</var>,<var>cwin</var>,<var>da</var>,<var>daisy</var>,<var>db</var>,<var>dB</var>,<var>dc</var>,<var>dC</var>,<var>DC</var>,<var>dch</var>,<var>dch1</var>,<var>dclk</var>,<var>defbi</var>,<var>defc</var>,<var>define_bit_image_region</var>,<var>define_char</var>,<var>delete_character</var>,<var>delete_line</var>,<var>dest_tabs_magic_smso</var>,<var>device_type</var>,<var>devt</var>,<var>DI</var>,<var>dial</var>,<var>dial_phone</var>,<var>dim</var>,<var>dispc</var>,<var>display_clock</var>,<var>display_pc_char</var>,<var>dis_status_line</var>,<var>DK</var>,<var>dl</var>,<var>DL</var>,<var>dl1</var>,<var>dm</var>,<var>dN</var>,<var>do</var>,<var>DO</var>,<var>docr</var>,<var>dot_horz_spacing</var>,<var>dot_vert_spacing</var>,<var>down_half_line</var>,<var>ds</var>,<var>dsl</var>,<var>dT</var>,<var>dv</var>,<var>eA</var>,<var>eat_newline_glitch</var>,<var>ec</var>,<var>ech</var>,<var>ed</var>,<var>ehhlm</var>,<var>ei</var>,<var>el</var>,<var>el1</var>,<var>elhlm</var>,<var>elohlm</var>,<var>ena_acs</var>,<var>enacs</var>,<var>endbi</var>,<var>end_bit_image_region</var>,<var>enter_alt_charset_mode</var>,<var>enter_am_mode</var>,<var>enter_blink_mode</var>,<var>enter_bold_mode</var>,<var>enter_ca_mode</var>,<var>enter_delete_mode</var>,<var>enter_dim_mode</var>,<var>enter_doublewide_mode</var>,<var>enter_draft_quality</var>,<var>enter_horizontal_hl_mode</var>,<var>enter_insert_mode</var>,<var>enter_italics_mode</var>,<var>enter_left_hl_mode</var>,<var>enter_leftward_mode</var>,<var>enter_low_hl_mode</var>,<var>enter_micro_mode</var>,<var>enter_near_letter_quality</var>,<var>enter_normal_quality</var>,<var>enter_pc_charset_mode</var>,<var>enter_protected_mode</var>,<var>enter_reverse_mode</var>,<var>enter_right_hl_mode</var>,<var>enter_scancode_mode</var>,<var>enter_secure_mode</var>,<var>enter_shadow_mode</var>,<var>enter_standout_mode</var>,<var>enter_subscript_mode</var>,<var>enter_superscript_mode</var>,<var>enter_top_hl_mode</var>,<var>enter_underline_mode</var>,<var>enter_upward_mode</var>,<var>enter_vertical_hl_mode</var>,<var>enter_xon_mode</var>,<var>eo</var>,<var>erase_chars</var>,<var>erase_overstrike</var>,<var>erhlm</var>,<var>es</var>,<var>eslok</var>,<var>ethlm</var>,<var>evhlm</var>,<var>exit_alt_charset_mode</var>,<var>exit_am_mode</var>,<var>exit_attribute_mode</var>,<var>exit_ca_mode</var>,<var>exit_delete_mode</var>,<var>exit_doublewide_mode</var>,<var>exit_insert_mode</var>,<var>exit_italics_mode</var>,<var>exit_leftward_mode</var>,<var>exit_micro_mode</var>,<var>exit_pc_charset_mode</var>,<var>exit_scancode_mode</var>,<var>exit_shadow_mode</var>,<var>exit_standout_mode</var>,<var>exit_subscript_mode</var>,<var>exit_superscript_mode</var>,<var>exit_underline_mode</var>,<var>exit_upward_mode</var>,<var>exit_xon_mode</var>,<var>F1</var>,<var>F2</var>,<var>F3</var>,<var>F4</var>,<var>F5</var>,<var>F6</var>,<var>F7</var>,<var>F8</var>,<var>F9</var>,<var>Fa</var>,<var>FA</var>,<var>Fb</var>,<var>FB</var>,<var>Fc</var>,<var>FC</var>,<var>Fd</var>,<var>FD</var>,<var>Fe</var>,<var>FE</var>,<var>ff</var>,<var>Ff</var>,<var>FF</var>,<var>Fg</var>,<var>FG</var>,<var>fh</var>,<var>Fh</var>,<var>FH</var>,<var>Fi</var>,<var>FI</var>,<var>fixed_pause</var>,<var>Fj</var>,<var>FJ</var>,<var>Fk</var>,<var>FK</var>,<var>Fl</var>,<var>FL</var>,<var>flash</var>,<var>flash_hook</var>,<var>flash_screen</var>,<var>fln</var>,<var>Fm</var>,<var>FM</var>,<var>Fn</var>,<var>FN</var>,<var>Fo</var>,<var>FO</var>,<var>font0</var>,<var>font1</var>,<var>font2</var>,<var>font3</var>,<var>font4</var>,<var>font5</var>,<var>font6</var>,<var>font7</var>,<var>form_feed</var>,<var>Fp</var>,<var>FP</var>,<var>Fq</var>,<var>FQ</var>,<var>Fr</var>,<var>FR</var>,<var>from_status_line</var>,<var>fs</var>,<var>FS</var>,<var>fsl</var>,<var>FT</var>,<var>FU</var>,<var>FV</var>,<var>FW</var>,<var>FX</var>,<var>FY</var>,<var>FZ</var>,<var>G1</var>,<var>G2</var>,<var>G3</var>,<var>G4</var>,<var>GC</var>,<var>GD</var>,<var>generic_type</var>,<var>getm</var>,<var>get_mouse</var>,<var>GH</var>,<var>GL</var>,<var>Gm</var>,<var>gn</var>,<var>gnu_has_meta_key</var>,<var>goto_window</var>,<var>GR</var>,<var>GU</var>,<var>GV</var>,<var>hangup</var>,<var>hard_copy</var>,<var>hard_cursor</var>,<var>has_hardware_tabs</var>,<var>has_meta_key</var>,<var>has_print_wheel</var>,<var>has_status_line</var>,<var>hc</var>,<var>HC</var>,<var>hd</var>,<var>hl</var>,<var>hls</var>,<var>ho</var>,<var>home</var>,<var>hook</var>,<var>horizontal_tab_delay</var>,<var>hpa</var>,<var>hs</var>,<var>ht</var>,<var>hts</var>,<var>hu</var>,<var>HU</var>,<var>hue_lightness_saturation</var>,<var>hup</var>,<var>hz</var>,<var>i1</var>,<var>i2</var>,<var>i3</var>,<var>ic</var>,<var>Ic</var>,<var>IC</var>,<var>ich</var>,<var>ich1</var>,<var>if</var>,<var>il</var>,<var>il1</var>,<var>im</var>,<var>in</var>,<var>ind</var>,<var>indn</var>,<var>init_1string</var>,<var>init_2string</var>,<var>init_3string</var>,<var>initc</var>,<var>init_file</var>,<var>initialize_color</var>,<var>initial
ize_pair</var>,<var>initp</var>,<var>init_prog</var>,<var>init_tabs</var>,<var>insert_character</var>,<var>insert_line</var>,<var>insert_null_glitch</var>,<var>insert_padding</var>,<var>invis</var>,<var>ip</var>,<var>iP</var>,<var>Ip</var>,<var>iprog</var>,<var>is</var>,<var>is1</var>,<var>is2</var>,<var>is3</var>,<var>it</var>,<var>k;</var>,<var>k0</var>,<var>k1</var>,<var>K1</var>,<var>k2</var>,<var>K2</var>,<var>k3</var>,<var>K3</var>,<var>k4</var>,<var>K4</var>,<var>k5</var>,<var>K5</var>,<var>k6</var>,<var>k7</var>,<var>k8</var>,<var>k9</var>,<var>ka</var>,<var>kA</var>,<var>ka1</var>,<var>ka3</var>,<var>kact</var>,<var>kb</var>,<var>kB</var>,<var>kb2</var>,<var>kbeg</var>,<var>kBEG</var>,<var>kbs</var>,<var>kbtab</var>,<var>kC</var>,<var>kc1</var>,<var>kc3</var>,<var>kcan</var>,<var>kCAN</var>,<var>kcbt</var>,<var>kclo</var>,<var>kclr</var>,<var>kcmd</var>,<var>kCMD</var>,<var>kcpn</var>,<var>kcpy</var>,<var>kCPY</var>,<var>kcrt</var>,<var>kCRT</var>,<var>kctab</var>,<var>kcub1</var>,<var>kcud1</var>,<var>kcuf1</var>,<var>kcuu1</var>,<var>kd</var>,<var>kD</var>,<var>kDC</var>,<var>kdch1</var>,<var>kDL</var>,<var>kdl1</var>,<var>kdo</var>,<var>ke</var>,<var>kE</var>,<var>ked</var>,<var>kel</var>,<var>kend</var>,<var>kEND</var>,<var>kent</var>,<var>kEOL</var>,<var>kext</var>,<var>kEXT</var>,<var>key_a1</var>,<var>key_a3</var>,<var>key_b2</var>,<var>key_backspace</var>,<var>key_beg</var>,<var>key_btab</var>,<var>key_c1</var>,<var>key_c3</var>,<var>key_cancel</var>,<var>key_catab</var>,<var>key_clear</var>,<var>key_close</var>,<var>key_command</var>,<var>key_copy</var>,<var>key_create</var>,<var>key_ctab</var>,<var>key_dc</var>,<var>key_dl</var>,<var>key_down</var>,<var>key_eic</var>,<var>key_end</var>,<var>key_enter</var>,<var>key_eol</var>,<var>key_eos</var>,<var>key_exit</var>,<var>key_f0</var>,<var>key_f1</var>,<var>key_f10</var>,<var>key_f11</var>,<var>key_f12</var>,<var>key_f13</var>,<var>key_f14</var>,<var>key_f15</var>,<var>key_f16</var>,<var>key_f17</var>,<var>key_f18</var>,<var>key_f19</var>,<var>key_f2</var>,<var>key_f20</var>,<var>key_f21</var>,<var>key_f22</var>,<var>key_f23</var>,<var>key_f24</var>,<var>key_f25</var>,<var>key_f26</var>,<var>key_f27</var>,<var>key_f28</var>,<var>key_f29</var>,<var>key_f3</var>,<var>key_f30</var>,<var>key_f31</var>,<var>key_f32</var>,<var>key_f33</var>,<var>key_f34</var>,<var>key_f35</var>,<var>key_f36</var>,<var>key_f37</var>,<var>key_f38</var>,<var>key_f39</var>,<var>key_f4</var>,<var>key_f40</var>,<var>key_f41</var>,<var>key_f42</var>,<var>key_f43</var>,<var>key_f44</var>,<var>key_f45</var>,<var>key_f46</var>,<var>key_f47</var>,<var>key_f48</var>,<var>key_f49</var>,<var>key_f5</var>,<var>key_f50</var>,<var>key_f51</var>,<var>key_f52</var>,<var>key_f53</var>,<var>key_f54</var>,<var>key_f55</var>,<var>key_f56</var>,<var>key_f57</var>,<var>key_f58</var>,<var>key_f59</var>,<var>key_f6</var>,<var>key_f60</var>,<var>key_f61</var>,<var>key_f62</var>,<var>key_f63</var>,<var>key_f7</var>,<var>key_f8</var>,<var>key_f9</var>,<var>key_find</var>,<var>key_help</var>,<var>key_home</var>,<var>key_ic</var>,<var>key_il</var>,<var>key_left</var>,<var>key_ll</var>,<var>key_mark</var>,<var>key_message</var>,<var>key_mouse</var>,<var>key_move</var>,<var>key_next</var>,<var>key_npage</var>,<var>key_open</var>,<var>key_options</var>,<var>keypad_local</var>,<var>keypad_xmit</var>,<var>key_ppage</var>,<var>key_previous</var>,<var>key_print</var>,<var>key_redo</var>,<var>key_reference</var>,<var>key_refresh</var>,<var>key_replace</var>,<var>key_restart</var>,<var>key_resume</var>,<var>key_right</var>,<var>key_save</var>,<var>key_sbeg</var>,<var>key_scancel</var>,<var>key_scommand</var>,<var>key_scopy</var>,<var>key_screate</var>,<var>key_sdc</var>,<var>key_sdl</var>,<var>key_select</var>,<var>key_send</var>,<var>key_seol</var>,<var>key_sexit</var>,<var>key_sf</var>,<var>key_sfind</var>,<var>key_shelp</var>,<var>key_shome</var>,<var>key_sic</var>,<var>key_sleft</var>,<var>key_smessage</var>,<var>key_smove</var>,<var>key_snext</var>,<var>key_soptions</var>,<var>key_sprevious</var>,<var>key_sprint</var>,<var>key_sr</var>,<var>key_sredo</var>,<var>key_sreplace</var>,<var>key_sright</var>,<var>key_srsume</var>,<var>key_ssave</var>,<var>key_ssuspend</var>,<var>key_stab</var>,<var>key_sundo</var>,<var>key_suspend</var>,<var>key_undo</var>,<var>key_up</var>,<var>kF</var>,<var>kf0</var>,<var>kf1</var>,<var>kf10</var>,<var>kf11</var>,<var>kf12</var>,<var>kf13</var>,<var>kf14</var>,<var>kf15</var>,<var>kf16</var>,<var>kf17</var>,<var>kf18</var>,<var>kf19</var>,<var>kf2</var>,<var>kf20</var>,<var>kf21</var>,<var>kf22</var>,<var>kf23</var>,<var>kf24</var>,<var>kf25</var>,<var>kf26</var>,<var>kf27</var>,<var>kf28</var>,<var>kf29</var>,<var>kf3</var>,<var>kf30</var>,<var>kf31</var>,<var>kf32</var>,<var>kf33</var>,<var>kf34</var>,<var>kf35</var>,<var>kf36</var>,<var>kf37</var>,<var>kf38</var>,<var>kf39</var>,<var>kf4</var>,<var>kf40</var>,<var>kf41</var>,<var>kf42</var>,<var>kf43</var>,<var>kf44</var>,<var>kf45</var>,<var>kf46</var>,<var>kf47</var>,<var>kf48</var>,<var>kf49</var>,<var>kf5</var>,<var>kf50</var>,<var>kf51</var>,<var>kf52</var>,<var>kf53</var>,<var>kf54</var>,<var>kf55</var>,<var>kf56</var>,<var>kf57</var>,<var>kf58</var>,<var>kf59</var>,<var>kf6</var>,<var>kf60</var>,<var>kf61</var>,<var>kf62</var>,<var>kf63</var>,<var>kf7</var>,<var>kf8</var>,<var>kf9</var>,<var>kfnd</var>,<var>kFND</var>,<var>kh</var>,<var>kH</var>,<var>khlp</var>,<var>kHLP</var>,<var>kHOM</var>,<var>khome</var>,<var>khts</var>,<var>kI</var>,<var>kIC</var>,<var>kich1</var>,<var>kil1</var>,<var>kind</var>,<var>kl</var>,<var>kL</var>,<var>kLFT</var>,<var>kll</var>,<var>km</var>,<var>kM</var>,<var>Km</var>,<var>kmous</var>,<var>kmov</var>,<var>kMOV</var>,<var>kmpf1</var>,<var>kmpf2</var>,<var>kmpf3</var>,<var>kmpf4</var>,<var>kmpf5</var>,<var>kmpf6</var>,<var>kmpf7</var>,<var>kmpf8</var>,<var>kmpf9</var>,<var>kmpt1</var>,<var>kmpt2</var>,<var>kmpt3</var>,<var>kmpt4</var>,<var>kmpt5</var>,<var>kmpt6</var>,<var>kmpt7</var>,<var>kmpt8</var>,<var>kmpt9</var>,<var>kmrk</var>,<var>kmsg</var>,<var>kMSG</var>,<var>kn</var>,<var>kN</var>,<var>knl</var>,<var>knp</var>,<var>knpn</var>,<var>knxt</var>,<var>kNXT</var>,<var>ko</var>,<var>kopn</var>,<var>kopt</var>,<var>kOPT</var>,<var>kP</var>,<var>kpp</var>,<var>kppn</var>,<var>kprt</var>,<var>kPRT</var>,<var>kprv</var>,<var>kPRV</var>,<var>kquit</var>,<var>kr</var>,<var>kR</var>,<var>krdo</var>,<var>kRDO</var>,<var>kref</var>,<var>kres</var>,<var>kRES</var>,<var>krfr</var>,<var>kri</var>,<var>kRIT</var>,<var>krmir</var>,<var>krpl</var>,<var>kRPL</var>,<var>krst</var>,<var>ks</var>,<var>kS</var>,<var>ksav</var>,<var>kSAV</var>,<var>kscl</var>,<var>kscr</var>,<var>ksel</var>,<var>ksf1</var>,<var>ksf10</var>,<var>ksf2</var>,<var>ksf3</var>,<var>ksf4</var>,<var>ksf5</var>,<var>ksf6</var>,<var>ksf7</var>,<var>ksf8</var>,<var>ksf9</var>,<var>kslt</var>,<var>kspd</var>,<var>kSPD</var>,<var>kt</var>,<var>kT</var>,<var>ktab</var>,<var>ktbc</var>,<var>ku</var>,<var>kund</var>,<var>kUND</var>,<var>l0</var>,<var>l1</var>,<var>l2</var>,<var>l3</var>,<var>l4</var>,<var>l5</var>,<var>l6</var>,<var>l7</var>,<var>l8</var>,<var>l9</var>,<var>la</var>,<var>label_format</var>,<var>label_height</var>,<var>label_off</var>,<var>label_on</var>,<var>label_width</var>,<var>lab_f0</var>,<var>lab_f1</var>,<var>lab_f10</var>,<var>lab_f2</var>,<var>lab_f3</var>,<var>lab_f4</var>,<var>lab_f5</var>,<var>lab_f6</var>,<var>lab_f7</var>,<var>lab_f8</var>,<var>lab_f9</var>,<var>le</var>,<var>LE</var>,<var>Lf</var>,<var>LF</var>,<var>lf0</var>,<var>lf1</var>,<var>lf10</var>,<var>lf2</var>,<var>lf3</var>,<var>lf4</var>,<var>lf5</var>,<var>lf6</var>,<var>lf7</var>,<var>lf8</var>,<var>lf9</var>,<var>lh</var>,<var>li</var>,<var>linefeed_if_not_lf</var>,<var>linefeed_is_newline</var>,<var>lines</var>,<var>lines_of_memory</var>,<var>ll</var>,<var>lm</var>,<var>LO</var>,<var>lpi</var>,<var>lpi_changes_res</var>,<var>lpix</var>,<var>lvert</var>,<var>lw</var>,<var>ma</var>,<var>maddr</var>,<var>magic_cookie_glitch</var>,<var>magic_cookie_glitch_ul</var>,<var>max_attributes</var>,<var>max_colors</var>,<var>maximum_windows</var>,<var>max_micro_address</va
r>,<var>max_micro_jump</var>,<var>max_pairs</var>,<var>mb</var>,<var>MC</var>,<var>mc0</var>,<var>mc4</var>,<var>mc5</var>,<var>mc5i</var>,<var>mc5p</var>,<var>mcs</var>,<var>mcub</var>,<var>mcub1</var>,<var>mcud</var>,<var>mcud1</var>,<var>mcuf</var>,<var>mcuf1</var>,<var>mcuu</var>,<var>mcuu1</var>,<var>md</var>,<var>me</var>,<var>meml</var>,<var>memory_above</var>,<var>memory_below</var>,<var>memory_lock</var>,<var>memory_unlock</var>,<var>memu</var>,<var>meta_off</var>,<var>meta_on</var>,<var>mgc</var>,<var>mh</var>,<var>mhpa</var>,<var>mi</var>,<var>Mi</var>,<var>micro_col_size</var>,<var>micro_column_address</var>,<var>micro_down</var>,<var>micro_left</var>,<var>micro_line_size</var>,<var>micro_right</var>,<var>micro_row_address</var>,<var>micro_up</var>,<var>minfo</var>,<var>mir</var>,<var>mjump</var>,<var>mk</var>,<var>ml</var>,<var>ML</var>,<var>mls</var>,<var>mm</var>,<var>mo</var>,<var>mouse_info</var>,<var>move_insert_mode</var>,<var>move_standout_mode</var>,<var>mp</var>,<var>mr</var>,<var>MR</var>,<var>mrcup</var>,<var>ms</var>,<var>msgr</var>,<var>MT</var>,<var>mu</var>,<var>mvpa</var>,<var>MW</var>,<var>nc</var>,<var>NC</var>,<var>ncv</var>,<var>nd</var>,<var>ND</var>,<var>ndscr</var>,<var>needs_xon_xoff</var>,<var>nel</var>,<var>newline</var>,<var>new_line_delay</var>,<var>nl</var>,<var>Nl</var>,<var>NL</var>,<var>nlab</var>,<var>no_color_video</var>,<var>no_correctly_working_cr</var>,<var>no_esc_ctlc</var>,<var>non_dest_scroll_region</var>,<var>non_rev_rmcup</var>,<var>no_pad_char</var>,<var>NP</var>,<var>npc</var>,<var>npins</var>,<var>NR</var>,<var>nrrmc</var>,<var>ns</var>,<var>number_of_function_keys</var>,<var>number_of_pins</var>,<var>num_labels</var>,<var>nw</var>,<var>nx</var>,<var>nxon</var>,<var>oc</var>,<var>op</var>,<var>orc</var>,<var>order_of_pins</var>,<var>orhi</var>,<var>orig_colors</var>,<var>orig_pair</var>,<var>orl</var>,<var>orvi</var>,<var>os</var>,<var>OTbc</var>,<var>OTbs</var>,<var>OTdB</var>,<var>OTdC</var>,<var>OTdN</var>,<var>OTdT</var>,<var>OTG1</var>,<var>OTG2</var>,<var>OTG3</var>,<var>OTG4</var>,<var>OTGC</var>,<var>OTGD</var>,<var>OTGH</var>,<var>OTGL</var>,<var>OTGR</var>,<var>OTGU</var>,<var>OTGV</var>,<var>other_non_function_keys</var>,<var>OTi2</var>,<var>OTkn</var>,<var>OTko</var>,<var>OTma</var>,<var>OTMT</var>,<var>OTnc</var>,<var>OTnl</var>,<var>OTNL</var>,<var>OTns</var>,<var>OTpt</var>,<var>OTrs</var>,<var>OTug</var>,<var>OTxr</var>,<var>output_res_char</var>,<var>output_res_horz_inch</var>,<var>output_res_line</var>,<var>output_res_vert_inch</var>,<var>over_strike</var>,<var>pa</var>,<var>PA</var>,<var>pad</var>,<var>pad_char</var>,<var>padding_baud_rate</var>,<var>pairs</var>,<var>parm_dch</var>,<var>parm_delete_line</var>,<var>parm_down_cursor</var>,<var>parm_down_micro</var>,<var>parm_ich</var>,<var>parm_index</var>,<var>parm_insert_line</var>,<var>parm_left_cursor</var>,<var>parm_left_micro</var>,<var>parm_right_cursor</var>,<var>parm_right_micro</var>,<var>parm_rindex</var>,<var>parm_up_cursor</var>,<var>parm_up_micro</var>,<var>pause</var>,<var>pb</var>,<var>pc</var>,<var>pc_term_options</var>,<var>pctrm</var>,<var>pf</var>,<var>pfkey</var>,<var>pfloc</var>,<var>pfx</var>,<var>pfxl</var>,<var>pk</var>,<var>pkey_key</var>,<var>pkey_local</var>,<var>pkey_plab</var>,<var>pkey_xmit</var>,<var>pl</var>,<var>plab_norm</var>,<var>pln</var>,<var>pn</var>,<var>po</var>,<var>pO</var>,<var>porder</var>,<var>print_rate</var>,<var>print_screen</var>,<var>prot</var>,<var>prtr_non</var>,<var>prtr_off</var>,<var>prtr_on</var>,<var>prtr_silent</var>,<var>ps</var>,<var>pt</var>,<var>PU</var>,<var>pulse</var>,<var>px</var>,<var>QD</var>,<var>qdial</var>,<var>quick_dial</var>,<var>r1</var>,<var>r2</var>,<var>r3</var>,<var>RA</var>,<var>rbim</var>,<var>rc</var>,<var>RC</var>,<var>rcsd</var>,<var>remove_clock</var>,<var>rep</var>,<var>repeat_char</var>,<var>req_for_input</var>,<var>req_mouse_pos</var>,<var>reqmp</var>,<var>reset_1string</var>,<var>reset_2string</var>,<var>reset_3string</var>,<var>reset_file</var>,<var>restore_cursor</var>,<var>return_does_clr_eol</var>,<var>rev</var>,<var>rf</var>,<var>RF</var>,<var>rfi</var>,<var>ri</var>,<var>RI</var>,<var>rin</var>,<var>ritm</var>,<var>rlm</var>,<var>rmacs</var>,<var>rmam</var>,<var>rmclk</var>,<var>rmcup</var>,<var>rmdc</var>,<var>rmicm</var>,<var>rmir</var>,<var>rmkx</var>,<var>rmln</var>,<var>rmm</var>,<var>rmp</var>,<var>rmpch</var>,<var>rmsc</var>,<var>rmso</var>,<var>rmul</var>,<var>rmxon</var>,<var>row_address</var>,<var>row_addr_glitch</var>,<var>rp</var>,<var>rP</var>,<var>RQ</var>,<var>rs</var>,<var>rs1</var>,<var>rs2</var>,<var>rs3</var>,<var>rshm</var>,<var>rsubm</var>,<var>rsupm</var>,<var>rum</var>,<var>rvert</var>,<var>rwidm</var>,<var>RX</var>,<var>s0</var>,<var>s0ds</var>,<var>s1</var>,<var>S1</var>,<var>s1ds</var>,<var>s2</var>,<var>S2</var>,<var>s2ds</var>,<var>s3</var>,<var>S3</var>,<var>s3ds</var>,<var>S4</var>,<var>S5</var>,<var>S6</var>,<var>S7</var>,<var>S8</var>,<var>sa</var>,<var>sA</var>,<var>SA</var>,<var>sam</var>,<var>save_cursor</var>,<var>Sb</var>,<var>sbim</var>,<var>sc</var>,<var>SC</var>,<var>scancode_escape</var>,<var>scesa</var>,<var>scesc</var>,<var>sclk</var>,<var>scp</var>,<var>scroll_forward</var>,<var>scroll_reverse</var>,<var>scs</var>,<var>scsd</var>,<var>sdrfq</var>,<var>se</var>,<var>select_char_set</var>,<var>semi_auto_right_margin</var>,<var>set0_des_seq</var>,<var>set1_des_seq</var>,<var>set2_des_seq</var>,<var>set3_des_seq</var>,<var>set_a_attributes</var>,<var>setab</var>,<var>set_a_background</var>,<var>setaf</var>,<var>set_a_foreground</var>,<var>set_attributes</var>,<var>setb</var>,<var>set_background</var>,<var>set_bottom_margin</var>,<var>set_bottom_margin_parm</var>,<var>set_clock</var>,<var>setcolor</var>,<var>set_color_band</var>,<var>set_color_pair</var>,<var>setf</var>,<var>set_foreground</var>,<var>set_left_margin</var>,<var>set_left_margin_parm</var>,<var>set_lr_margin</var>,<var>set_page_length</var>,<var>set_pglen_inch</var>,<var>set_right_margin</var>,<var>set_right_margin_parm</var>,<var>set_tab</var>,<var>set_tb_margin</var>,<var>set_top_margin</var>,<var>set_top_margin_parm</var>,<var>set_window</var>,<var>sf</var>,<var>Sf</var>,<var>SF</var>,<var>sg</var>,<var>sgr</var>,<var>sgr0</var>,<var>sgr1</var>,<var>sitm</var>,<var>sL</var>,<var>slength</var>,<var>slines</var>,<var>slm</var>,<var>smacs</var>,<var>smam</var>,<var>smcup</var>,<var>smdc</var>,<var>smgb</var>,<var>smgbp</var>,<var>smgl</var>,<var>smglp</var>,<var>smglr</var>,<var>smgr</var>,<var>smgrp</var>,<var>smgt</var>,<var>smgtb</var>,<var>smgtp</var>,<var>smicm</var>,<var>smir</var>,<var>smkx</var>,<var>smln</var>,<var>smm</var>,<var>smpch</var>,<var>smsc</var>,<var>smso</var>,<var>smul</var>,<var>smxon</var>,<var>snlq</var>,<var>snrmq</var>,<var>so</var>,<var>sp</var>,<var>spinh</var>,<var>spinv</var>,<var>sr</var>,<var>SR</var>,<var>sshm</var>,<var>ssubm</var>,<var>ssupm</var>,<var>st</var>,<var>start_bit_image</var>,<var>start_char_set_def</var>,<var>status_line_esc_ok</var>,<var>stop_bit_image</var>,<var>stop_char_set_def</var>,<var>subcs</var>,<var>subscript_characters</var>,<var>sum</var>,<var>supcs</var>,<var>superscript_characters</var>,<var>swidm</var>,<var>SX</var>,<var>ta</var>,<var>tab</var>,<var>tbc</var>,<var>te</var>,<var>termcap_init2</var>,<var>termcap_reset</var>,<var>these_cause_cr</var>,<var>ti</var>,<var>tilde_glitch</var>,<var>TO</var>,<var>tone</var>,<var>topl</var>,<var>to_status_line</var>,<var>transparent_underline</var>,<var>ts</var>,<var>tsl</var>,<var>u0</var>,<var>u1</var>,<var>u2</var>,<var>u3</var>,<var>u4</var>,<var>u5</var>,<var>u6</var>,<var>u7</var>,<var>u8</var>,<var>u9</var>,<var>uc</var>,<var>ue</var>,<var>ug</var>,<var>ul</var>,<var>underline_char</var>,<var>up</var>,<var>UP</var>,<var>up_half_line</var>,<var>us</var>,<var>user0</var>,<var>user1</var>,<var>user2</var>,<var>user3</var>,<var>user4</var>,<var>user5</var>,<var>user6</var>,<var>user7</var>,<var>user8</var>,<var>user9</var>,<var>ut</var>,<var>vb</var>,<var>ve</var>,<var>vi</var>,<var>virtual_terminal</var>,<var>vpa</var>,<var>vs</var>,<var>vt</var>,<var>WA</var>,<var>wait</var>,<var>wait_tone</var>,<var>WG</va
r>,<var>wi</var>,<var>widcs</var>,<var>wide_char_size</var>,<var>width_status_line</var>,<var>wind</var>,<var>wingo</var>,<var>wnum</var>,<var>ws</var>,<var>wsl</var>,<var>xb</var>,<var>xenl</var>,<var>XF</var>,<var>Xh</var>,<var>xhp</var>,<var>xhpa</var>,<var>xl</var>,<var>Xl</var>,<var>xmc</var>,<var>xn</var>,<var>XN</var>,<var>xo</var>,<var>Xo</var>,<var>xoffc</var>,<var>xoff_character</var>,<var>xon</var>,<var>xonc</var>,<var>xon_character</var>,<var>xon_xoff</var>,<var>xr</var>,<var>Xr</var>,<var>xs</var>,<var>xsb</var>,<var>xt</var>,<var>Xt</var>,<var>Xv</var>,<var>xvpa</var>,<var>Xy</var>,<var>Ya</var>,<var>YA</var>,<var>Yb</var>,<var>YB</var>,<var>Yc</var>,<var>YC</var>,<var>Yd</var>,<var>YD</var>,<var>Ye</var>,<var>YE</var>,<var>Yf</var>,<var>YF</var>,<var>Yg</var>,<var>YG</var>,<var>Yh</var>,<var>Yi</var>,<var>Yj</var>,<var>Yk</var>,<var>Yl</var>,<var>Ym</var>,<var>Yn</var>,<var>Yo</var>,<var>Yp</var>,<var>Yv</var>,<var>Yw</var>,<var>Yx</var>,<var>Yy</var>,<var>Yz</var>,<var>YZ</var>,<var>Za</var>,<var>ZA</var>,<var>Zb</var>,<var>ZB</var>,<var>Zc</var>,<var>ZC</var>,<var>Zd</var>,<var>ZD</var>,<var>Ze</var>,<var>ZE</var>,<var>zerom</var>,<var>zero_motion</var>,<var>Zf</var>,<var>ZF</var>,<var>Zg</var>,<var>ZG</var>,<var>Zh</var>,<var>ZH</var>,<var>Zi</var>,<var>ZI</var>,<var>Zj</var>,<var>ZJ</var>,<var>Zk</var>,<var>ZK</var>,<var>Zl</var>,<var>ZL</var>,<var>Zm</var>,<var>ZM</var>,<var>Zn</var>,<var>ZN</var>,<var>Zo</var>,<var>ZO</var>,<var>Zp</var>,<var>ZP</var>,<var>Zq</var>,<var>ZQ</var>,<var>Zr</var>,<var>ZR</var>,<var>Zs</var>,<var>ZS</var>,<var>Zt</var>,<var>ZT</var>,<var>Zu</var>,<var>ZU</var>,<var>Zv</var>,<var>ZV</var>,<var>Zw</var>,<var>ZW</var>,<var>Zx</var>,<var>ZX</var>,<var>Zy</var>,<var>ZY</var>,<var>Zz</var>,<var>ZZ</var></p>


<h2>TERMINAL TYPE DESCRIPTIONS SOURCE FILE</h2>
<pre>ANSI, UNIX CONSOLE, AND SPECIAL TYPES
Specials
ANSI.SYS/ISO 6429/ECMA-48 Capabilities
ANSI/ECMA-48 terminals and terminal emulators
DOS ANSI.SYS variants
ANSI console types
BeOS
Linux consoles
Mach
OSF Unix
QNX
NetBSD consoles
FreeBSD console entries
386BSD and BSD/OS Consoles
DEC VT52
DEC VT100 and compatibles
VT100 emulations
X terminal emulators
MGR
UNIX VIRTUAL TERMINALS, VIRTUAL CONSOLES, AND TELNET CLIENTS
Pilot Pro Palm-Top
COMMERCIAL WORKSTATION CONSOLES
Alpha consoles
Sun consoles
Iris consoles
NeWS consoles
NeXT consoles
Sony NEWS workstations
Common Desktop Environment
Non-Unix Consoles
COMMON TERMINAL TYPES
Altos
Hewlett-Packard (hp)
Honeywell-Bull
Lear-Siegler (adm)
Prime
Qume (qvt)
Televideo (tvi)
Visual (vi)
Wyse (wy)
Kermit terminal emulations
NON-ANSI TERMINAL EMULATIONS
Avatar
RBcomm
LCD DISPLAYS
Matrix Orbital
OLDER TERMINAL TYPES
AT&amp;amp;T (att, tty)
Ampex (Dialogue)
Ann Arbor (aa)
Applied Digital Data Systems (adds)
C. Itoh Electronics
Control Data (cdc)
Getronics
Human Designed Systems (Concept)
Contel Business Systems.
Data General (dg)
Datamedia (dm)
Falco</pre>






<p>Just something sorta cool for you to check out</p>
<pre>{
 local t=`tputm &#039;clear&#039; &#039;setaf 75&#039;` l a b f=/tmp/ps IFS=&#039; &#039;;
exec 6&lt;&gt;$f;ps L|tr -s &#039; &#039; &amp;&gt;$f;
while read -u6 l;do a=${l/% */} b=${l/* /};
figlet -rtw $((${COLUMNS} /2 )) -f big "$l";
tput sgr0;
command ps wwo pid:6,user:8,vsize:8,comm:20,$a:50 k -$a -A;cont;
done;
};</pre><p><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html"></a><a href="http://www.askapache.com/linux/zen-terminal-escape-codes.html">Terminal Escape Code Zen</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/linux/zen-terminal-escape-codes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_Rewrite Variables Cheatsheet</title>
		<link>http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html</link>
		<comments>http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 15:05:23 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1280</guid>
		<description><![CDATA[<p><a class="IFL hs hs21" href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html" title="mod_rewrite cheatsheet for .htaccess rewrites"></a>We've figured out what <a href="http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html">mod_rewrite variables</a> look like, a cheatsheet of the actual value. <br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html"></a><a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html"><cite>AskApache.com</cite></a></p><p><a class="IFL hs hs21" href="http://uploads.askapache.com/2008/09/warningiconimg.jpg" title="mod_rewrite cheatsheet for .htaccess rewrites"></a>We've figured out what <a href="http://www.askapache.com/htaccess/crazy-advanced-mod_rewrite-tutorial.html">mod_rewrite variables</a> look like so we can create rewriterules and condition patterns based on the actual value.  This cheatsheet is where we'll lay them all out for quick reference.  This cheatsheet changed my life, way more than 301 redirect htaccess.<br class="C" /></p>

<h2>mod_rewrite Variable Value Cheat-Sheet</h2>
<p>Jump to: <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#API_VERSION">API_VERSION</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#AUTH_TYPE">AUTH_TYPE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#CONTENT_LENGTH">CONTENT_LENGTH</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#CONTENT_TYPE">CONTENT_TYPE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#DOCUMENT_ROOT">DOCUMENT_ROOT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#GATEWAY_INTERFACE">GATEWAY_INTERFACE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTPS">HTTPS</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_ACCEPT">HTTP_ACCEPT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_ACCEPT_CHARSET">HTTP_ACCEPT_CHARSET</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_ACCEPT_ENCODING">HTTP_ACCEPT_ENCODING</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_ACCEPT_LANGUAGE">HTTP_ACCEPT_LANGUAGE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_CACHE_CONTROL">HTTP_CACHE_CONTROL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_CONNECTION">HTTP_CONNECTION</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_COOKIE">HTTP_COOKIE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_FORWARDED">HTTP_FORWARDED</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_HOST">HTTP_HOST</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_KEEP_ALIVE">HTTP_KEEP_ALIVE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_PROXY_CONNECTION">HTTP_PROXY_CONNECTION</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_REFERER">HTTP_REFERER</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#HTTP_USER_AGENT">HTTP_USER_AGENT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#IS_SUBREQ">IS_SUBREQ</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#ORIG_PATH_INFO">ORIG_PATH_INFO</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#ORIG_PATH_TRANSLATED">ORIG_PATH_TRANSLATED</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#ORIG_SCRIPT_FILENAME">ORIG_SCRIPT_FILENAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#ORIG_SCRIPT_NAME">ORIG_SCRIPT_NAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#PATH">PATH</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#PATH_INFO">PATH_INFO</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#PHP_SELF">PHP_SELF</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#QUERY_STRING">QUERY_STRING</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REDIRECT_QUERY_STRING">REDIRECT_QUERY_STRING</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REDIRECT_REMOTE_USER">REDIRECT_REMOTE_USER</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REDIRECT_STATUS">REDIRECT_STATUS</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REDIRECT_URL">REDIRECT_URL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REMOTE_ADDR">REMOTE_ADDR</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REMOTE_HOST">REMOTE_HOST</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REMOTE_IDENT">REMOTE_IDENT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REMOTE_PORT">REMOTE_PORT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REMOTE_USER">REMOTE_USER</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REQUEST_FILENAME">REQUEST_FILENAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REQUEST_METHOD">REQUEST_METHOD</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REQUEST_TIME">REQUEST_TIME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#REQUEST_URI">REQUEST_URI</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_FILENAME">SCRIPT_FILENAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_GROUP">SCRIPT_GROUP</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_NAME">SCRIPT_NAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_URI">SCRIPT_URI</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_URL">SCRIPT_URL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SCRIPT_USER">SCRIPT_USER</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_ADDR">SERVER_ADDR</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_ADMIN">SERVER_ADMIN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_NAME">SERVER_NAME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_PORT">SERVER_PORT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_PROTOCOL">SERVER_PROTOCOL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_SIGNATURE">SERVER_SIGNATURE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SERVER_SOFTWARE">SERVER_SOFTWARE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_CIPHER">SSL_CIPHER</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_CIPHER_ALGKEYSIZE">SSL_CIPHER_ALGKEYSIZE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_CIPHER_EXPORT">SSL_CIPHER_EXPORT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_CIPHER_USEKEYSIZE">SSL_CIPHER_USEKEYSIZE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_CLIENT_VERIFY">SSL_CLIENT_VERIFY</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_PROTOCOL">SSL_PROTOCOL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_A_KEY">SSL_SERVER_A_KEY</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_A_SIG">SSL_SERVER_A_SIG</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_CERT">SSL_SERVER_CERT</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN">SSL_SERVER_I_DN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_C">SSL_SERVER_I_DN_C</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_CN">SSL_SERVER_I_DN_CN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_L">SSL_SERVER_I_DN_L</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_O">SSL_SERVER_I_DN_O</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_OU">SSL_SERVER_I_DN_OU</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_I_DN_ST">SSL_SERVER_I_DN_ST</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_M_SERIAL">SSL_SERVER_M_SERIAL</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_M_VERSION">SSL_SERVER_M_VERSION</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_S_DN">SSL_SERVER_S_DN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_S_DN_CN">SSL_SERVER_S_DN_CN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_S_DN_O">SSL_SERVER_S_DN_O</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_S_DN_OU">SSL_SERVER_S_DN_OU</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_V_END">SSL_SERVER_V_END</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SERVER_V_START">SSL_SERVER_V_START</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_SESSION_ID">SSL_SESSION_ID</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_VERSION_INTERFACE">SSL_VERSION_INTERFACE</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#SSL_VERSION_LIBRARY">SSL_VERSION_LIBRARY</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#THE_REQUEST">THE_REQUEST</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME">TIME</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_DAY">TIME_DAY</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_HOUR">TIME_HOUR</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_MIN">TIME_MIN</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_MON">TIME_MON</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_SEC">TIME_SEC</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_WDAY">TIME_WDAY</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TIME_YEAR">TIME_YEAR</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#TZ">TZ</a>, <a href="/htaccess/mod_rewrite-variables-cheatsheet.html#UNIQUE_ID">UNIQUE_ID</a></p>
<dl class="dl1">
<dt><a id="API_VERSION"></a><br />API_VERSION</a>: <code>20020903:12</code></dt>
<dd><pre>RewriteCond %{API_VERSION} ^(.*)$
RewriteRule .* http://www.askapache.com?API_VERSION=%1 [R=307,L]
</pre></dd>
<dt><a id="AUTH_TYPE"></a><br />AUTH_TYPE</a>: <code>Digest</code></dt>
<dd><pre>RewriteRule .* - [E=IN_AUTH_TYPE:%{AUTH_TYPE}]
RequestHeader set AUTH_TYPE "%{IN_AUTH_TYPE}e"</pre></dd>
<dt><a id="CACHE_CONTROL"></a><br />CACHE_CONTROL</a>: <code>max-age=0</code></dt>
<dd><pre>RewriteCond %{ENV:CACHE_CONTROL} no-cache [NC]
RewriteRule . %{REQUEST_URI}?nocache [L]</pre></dd>
<dt><a id="CONNECTION"></a><br />CONNECTION</a>: <code>keep-alive</code></dt><dd></dd>
<dt><a id="CONTENT_LENGTH"></a><br />CONTENT_LENGTH</a>: <code>(null)</code></dt>
<dd><pre>RewriteCond %{REQUEST_METHOD} =POST
RewriteCond %{HTTP:Content-Length}%{CONTENT_LENGTH} ^$
RewriteRule .* - [F,NS,L]</pre></dd>
<dt><a id="CONTENT_TYPE"></a><br />CONTENT_TYPE</a>: <code>(null)</code></dt><dd></dd>
<dt><a id="DOCUMENT_ROOT"></a><br />DOCUMENT_ROOT</a>: <code>/home/webroot/askapache.com</code></dt>
<dd><pre>RewriteCond %{DOCUMENT_ROOT}/cache%{REQUEST_URI}/index.html -f
RewriteRule . /cache%{REQUEST_URI}/index.html</pre></dd>
<dt><a id="HOST"></a><br />HOST</a>: <code>www.askapache.com</code></dt>
<dd><pre>RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule . http://www.askapache.com%{REQUEST_URI} [R=301,L]</pre></dd>
<dt><a id="HTTP"></a><br />HTTP</a>:</dt>
<dd><pre>RewriteCond %{HTTP:Accept-Encoding} gzip [NC]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI}.gz -f
RewriteRule . %{REQUEST_URI}.gz [L]</pre></dd>
<dt><a id="HTTPS"></a><br />HTTPS</a>: <code>off</code></dt>
<dd><pre>RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]</pre></dd>
<dt><a id="HTTP_ACCEPT"></a><br />HTTP_ACCEPT</a>: <code>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</code></dt><dd></dd>
<dt><a id="HTTP_COOKIE"></a><br />HTTP_COOKIE</a>: <code>__qca=1176541205adf28-5553185; ASKAPACHEID=fdadfa4f33e62a878468; __utmc=1df3893</code></dt>
<dd><pre>RewriteCond %{HTTP_COOKIE} ^.*autostart=on.*$
RewriteRule ^(.*)\.swf$ /$1\?autostart=true [NE,L]</pre></dd>
<dt><a id="HTTP_HOST"></a><br />HTTP_HOST</a>: <code>www.askapache.com</code></dt><dd></dd>
<dt><a id="HTTP_REFERER"></a><br />HTTP_REFERER</a>: <code>http://www.askapache.com/pro/mod_rewrite/catch.php?k=i</code></dt>
<dd><pre>RewriteCond %{HTTP_REFERER} badhost [NC]
RewriteRule . - [F]</pre></dd>
<dt><a id="HTTP_USER_AGENT"></a><br />HTTP_USER_AGENT</a>: <code>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Firefox/3.0.1</code></dt>
<dd><pre>RewriteCond %{HTTP_USER_AGENT} ^.*(Android|2.0\ MMP|240x320|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|hiptop|IEMobile|iPhone).*$ [NC]
RewriteRule ^(.+)$ /mobile/$1 [L]</pre></dd>
<dt><a id="IS_SUBREQ"></a><br />IS_SUBREQ</a>: <code>false</code></dt><dd></dd>
<dt><a id="KEEP_ALIVE"></a><br />KEEP_ALIVE</a>: <code>300</code></dt><dd></dd>
<dt><a id="PATH"></a><br />PATH</a>: <code>/bin:/usr/bin:/sbin:/usr/sbin</code></dt><dd></dd>
<dt><a id="QUERY_STRING"></a><br />QUERY_STRING</a>: <code>k=i</code></dt>
<dd><pre>RewriteCond %{QUERY_STRING} showtime [NC]
RewriteCond T:%{TIME}_TY:%{TIME_YEAR}_TMO:%{TIME_MON}_TWD:%{TIME_WDAY}_TD:%{TIME_DAY}_TH:%{TIME_HOUR}_TMI:%{TIME_MIN}_TS:%{TIME_SEC} ^(.*)$
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}?time=%1 [R,L]</pre></dd>
<dt><a id="REMOTE_ADDR"></a><br />REMOTE_ADDR</a>: <code>22.162.134.211</code></dt>
<dd><pre>RewriteCond %{REMOTE_ADDR} !^22\.162\.134\.211$
RewriteRule . http://www.askapache.com/maintenance-in-progress.html [R=307,L]</pre></dd>
<dt><a id="REMOTE_HOST"></a><br />REMOTE_HOST</a>: <code>22.162.134.211</code></dt><dd></dd>
<dt><a id="REMOTE_PORT"></a><br />REMOTE_PORT</a>: <code>4220</code></dt><dd></dd>
<dt><a id="REMOTE_USER"></a><br />REMOTE_USER</a>: <code>askapache</code></dt>
<dd><pre>RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]</pre></dd>
<dt><a id="REQUEST_FILENAME"></a><br />REQUEST_FILENAME</a>: <code>/home/webroot/askapache.com/pro/mod_rewrite/index.php</code></dt><dd></dd>
<dt><a id="REQUEST_METHOD"></a><br />REQUEST_METHOD</a>: <code>GET</code></dt>
<dd><pre>RewriteCond %{REQUEST_METHOD} !^(POST|GET|HEAD|PROPFIND|OPTIONS)$
RewriteRule .* - [F,L]</pre></dd>
<dt><a id="REQUEST_PROTOCOL"></a><br />REQUEST_PROTOCOL</a>: <code>HTTP/1.1</code></dt>
<dd><pre>RewriteCond %{REQUEST_PROTOCOL} !^HTTP/(0\.9|1\.[01])$
RewriteRule . [F,L]</pre></dd>
<dt><a id="REQUEST_URI"></a><br />REQUEST_URI</a>: <code>/pro/mod_rewrite/index.php</code></dt>
<dd><pre>RewriteCond %{REQUEST_URI} ^(robots\.txt|favicon\|ico)$ [NC]
RewriteRule . - [S=1]
RewriteCond %{HTTP_HOST} ^www
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]</pre></dd>
<dt><a id="SCRIPT_FILENAME"></a><br />SCRIPT_FILENAME</a>: <code>/home/webroot/askapache.com/pro/mod_rewrite/index.php</code></dt><dd></dd>
<dt><a id="SCRIPT_GROUP"></a><br />SCRIPT_GROUP</a>: <code>daemong</code></dt><dd></dd>
<dt><a id="SCRIPT_URI"></a><br />SCRIPT_URI</a>: <code>http://www.askapache.com/pro/mod_rewrite/index.php</code></dt><dd></dd>
<dt><a id="SCRIPT_URL"></a><br />SCRIPT_URL</a>: <code>/pro/mod_rewrite/index.php</code></dt><dd></dd>
<dt><a id="SCRIPT_USER"></a><br />SCRIPT_USER</a>: <code>askapache</code></dt><dd></dd>
<dt><a id="SERVER_ADDR"></a><br />SERVER_ADDR</a>: <code>208.113.134.190</code></dt><dd></dd>
<dt><a id="SERVER_ADMIN"></a><br />SERVER_ADMIN</a>: <code>webmaster@askapache.com</code></dt><dd></dd>
<dt><a id="SERVER_NAME"></a><br />SERVER_NAME</a>: <code>www.askapache.com</code></dt><dd></dd>
<dt><a id="SERVER_PORT"></a><br />SERVER_PORT</a>: <code>80</code></dt><dd></dd>
<dt><a id="SERVER_PROTOCOL"></a><br />SERVER_PROTOCOL</a>: <code>HTTP/1.1</code></dt><dd></dd>
<dt><a id="SERVER_SOFTWARE"></a><br />SERVER_SOFTWARE</a>: <code>Apache/2.0.61 (Unix) PHP/5.5 OpenSSL/0.9.7e</code></dt><dd></dd>
<dt><a id="SSL_CIPHER"></a><br />SSL_CIPHER</a>: <code>DHE-RSA-AES256-SHA</code></dt><dd></dd>
<dt><a id="SSL_CIPHER_ALGKEYSIZE"></a><br />SSL_CIPHER_ALGKEYSIZE</a>: <code>256</code></dt><dd></dd>
<dt><a id="SSL_CIPHER_EXPORT"></a><br />SSL_CIPHER_EXPORT</a>: <code>false</code></dt><dd></dd>
<dt><a id="SSL_CIPHER_USEKEYSIZE"></a><br />SSL_CIPHER_USEKEYSIZE</a>: <code>256</code></dt><dd></dd>
<dt><a id="SSL_CLIENT_VERIFY"></a><br />SSL_CLIENT_VERIFY</a>: <code>NONE</code></dt><dd></dd>
<dt><a id="SSL_PROTOCOL"></a><br />SSL_PROTOCOL</a>: <code>TLSv1</code></dt><dd></dd>
<dt><a id="SSL_SERVER_A_KEY"></a><br />SSL_SERVER_A_KEY</a>: <code>rsaEncryption</code></dt><dd></dd>
<dt><a id="SSL_SERVER_A_SIG"></a><br />SSL_SERVER_A_SIG</a>: <code>sha1WithRSAEncryption</code></dt><dd></dd>
<dt><a id="SSL_SERVER_CERT"></a><br />SSL_SERVER_CERT</a>: <code>-----BEGIN CERTIFICATE----- ... MIIFkTC ... -----END CERTIFICATE-----</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN"></a><br />SSL_SERVER_I_DN</a>: <code>/C=US/ST=Arizona/L=Scottsdale/O=Starfield Technologies, Inc./OU=http://certificates.starfieldtech.com/repository/CN=Starfield Secure Certification Authority/serialNumber=10688435</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_C"></a><br />SSL_SERVER_I_DN_C</a>: <code>US</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_CN"></a><br />SSL_SERVER_I_DN_CN</a>: <code>Starfield Secure Certification Authority</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_L"></a><br />SSL_SERVER_I_DN_L</a>: <code>Scottsdale</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_O"></a><br />SSL_SERVER_I_DN_O</a>: <code>Starfield Technologies, Inc.</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_OU"></a><br />SSL_SERVER_I_DN_OU</a>: <code>http://certificates.starfieldtech.com/repository</code></dt><dd></dd>
<dt><a id="SSL_SERVER_I_DN_ST"></a><br />SSL_SERVER_I_DN_ST</a>: <code>Arizona</code></dt><dd></dd>
<dt><a id="SSL_SERVER_M_SERIAL"></a><br />SSL_SERVER_M_SERIAL</a>: <code>042840B88A2352</code></dt><dd></dd>
<dt><a id="SSL_SERVER_M_VERSION"></a><br />SSL_SERVER_M_VERSION</a>: <code>3</code></dt><dd></dd>
<dt><a id="SSL_SERVER_S_DN"></a><br />SSL_SERVER_S_DN</a>: <code>/O=www.askapache.com/OU=Domain Control Validated/CN=www.askapache.com</code></dt><dd></dd>
<dt><a id="SSL_SERVER_S_DN_CN"></a><br />SSL_SERVER_S_DN_CN</a>: <code>www.askapache.com</code></dt><dd></dd>
<dt><a id="SSL_SERVER_S_DN_O"></a><br />SSL_SERVER_S_DN_O</a>: <code>www.askapache.com</code></dt><dd></dd>
<dt><a id="SSL_SERVER_S_DN_OU"></a><br />SSL_SERVER_S_DN_OU</a>: <code>Domain Control Validated</code></dt><dd></dd>
<dt><a id="SSL_SERVER_V_END"></a><br />SSL_SERVER_V_END</a>: <code>Jul 14 16:53:43 2012 GMT</code></dt><dd></dd>
<dt><a id="SSL_SERVER_V_START"></a><br />SSL_SERVER_V_START</a>: <code>Jul 14 20:25:17 2010 GMT</code></dt><dd></dd>
<dt><a id="SSL_SESSION_ID"></a><br />SSL_SESSION_ID</a>: <code>4184083DD1C74547553018174950D88987BD7ED03CE54EBB6638539C34814376</code></dt><dd></dd>
<dt><a id="SSL_VERSION_INTERFACE"></a><br />SSL_VERSION_INTERFACE</a>: <code>mod_ssl/2.2.16</code></dt><dd></dd>
<dt><a id="SSL_VERSION_LIBRARY"></a><br />SSL_VERSION_LIBRARY</a>: <code>OpenSSL/0.9.8e-fips-rhel5</code></dt><dd></dd>
<dt><a id="THE_REQUEST"></a><br />THE_REQUEST</a>: <code>GET /pro/mod_rewrite/index.php?k=i HTTP/1.1</code></dt>
<dd><pre>RewriteCond %{THE_REQUEST} ^(GET|POST)\ /.*\?(s|search)=(.+)\ HTTP/ [NC]
RewriteRule .* http://www.askapache.com/search/%3/? [R=302,L,NE]</pre></dd>
<dt><a id="TIME"></a><br />TIME</a>: <code>20080915152142</code></dt>
<dd><pre>RewriteCond %{QUERY_STRING} showtime [NC]
RewriteCond T:%{TIME}_TY:%{TIME_YEAR}_TMO:%{TIME_MON}_TWD:%{TIME_WDAY}_TD:%{TIME_DAY}_TH:%{TIME_HOUR}_TMI:%{TIME_MIN}_TS:%{TIME_SEC} ^(.*)$
RewriteRule .* http://%{HTTP_HOST}%{REQUEST_URI}?time=%1 [R,L]</pre></dd>
<dt><a id="TIME_DAY"></a><br />TIME_DAY</a>: <code>15</code></dt><dd></dd>
<dt><a id="TIME_HOUR"></a><br />TIME_HOUR</a>: <code>15</code></dt><dd></dd>
<dt><a id="TIME_MIN"></a><br />TIME_MIN</a>: <code>21</code></dt><dd></dd>
<dt><a id="TIME_MON"></a><br />TIME_MON</a>: <code>09</code></dt><dd></dd>
<dt><a id="TIME_SEC"></a><br />TIME_SEC</a>: <code>42</code></dt><dd></dd>
<dt><a id="TIME_WDAY"></a><br />TIME_WDAY</a>: <code>1</code></dt><dd></dd>
<dt><a id="TIME_YEAR"></a><br />TIME_YEAR</a>: <code>2008</code></dt><dd></dd>
<dt><a id="UNIQUE_ID"></a><br />UNIQUE_ID</a>: <code>qOr5tEBvcm8AAE-VoiUAAAAQ</code></dt><dd></dd>
</dl>

<p>This article is meant to prepare us for the advanced mod_rewrite examples that are soon to be published.  The upcoming article is going to be examples using <a href="http://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html">mod_rewrite</a> to achieve some crazy stuff...  Here the focus is on identifying mod_rewrite variables and defining the limits of the module by checking the <a href='http://www.askapache.com/servers/mod_rewrite.c.html'>mod_rewrite source code</a>.<br class="C" /></p>


<p class="cnote">For a broader mod_rewrite cheat sheet, check this <a href="http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/">printable</a> cheat sheet.</p>


<h2>Directives in Mod_Rewrite</h2>
<dl>
<dt>RewriteEngine</dt>
<dd><pre>RewriteEngine on|off</pre> On or Off to enable or disable (default) the whole rewriting engine</dd>
<dt>RewriteOptions</dt>
<dd><pre>RewriteOptions Options</pre> List of option strings to set</dd>

<dt>RewriteBase</dt>
<dd><pre>RewriteBase URL-path</pre> the base URL of the per-directory context
<dt>RewriteCond</dt>
<dd><pre>RewriteCond TestString CondPattern</pre> an input string and a to be applied regexp-pattern
<dt>RewriteRule</dt>
<dd><pre>RewriteRule Pattern Substitution [flags]</pre> an URL-applied regexp-pattern and a substitution URL
<dt>RewriteMap</dt>
<dd><pre>RewriteMap MapName MapType:MapSource</pre> a mapname and a filename
<dt>RewriteLock</dt>
<dd><pre>RewriteLock file-path</pre> the filename of a lockfile used for inter-process synchronization
<dt>RewriteLog</dt>
<dd><pre>RewriteLog file-path</pre> the filename of the rewriting logfile
<dt>RewriteLogLevel</dt>
<dd><pre>RewriteLogLevel Level</pre> the level of the rewriting logfile verbosity (0=none, 1=std, .., 9=max)
</dl>



<h2>RewriteRule Flags</h2>
<dl>
<dt><abbr title="Chain">C</abbr></dt>
<dd>Using the [Chain], or [C] flag, allows you to indicate that several rules should be chained together as a single logical transation. This is usually used when a transformation is sufficiently complicated to warrant breaking into several smaller steps.</dd>
<dt><abbr title="Cookie">CO</abbr></dt>
<dd><pre>cookie|CO=Name:Value:Domain[:Lifetime[:Path]]</pre><br />
This sets a cookie on the client's browser. The cookie's name is specified by NAME and the value is VAL. The domain field is the domain of the cookie, such as '.apache.org',the optional lifetime is the lifetime of the cookie in minutes, and the optional path is the path of the cookie.</dd>
<dt><abbr title="Env">E</abbr></dt>
<dd><pre>&#039;env|E=VAR:VAL&#039; (set environment variable)</pre><br />
RewriteRule (root|cmd)\.exe - [E=worm:nimda]
</dd>
<dt><abbr title="Forbidden">F</abbr></dt>
<dd><pre>&#039;forbidden|F&#039; (force URL to be forbidden)</pre><br /></dd>
<dt><abbr title="Gone">G</abbr></dt>
<dd><pre>&#039;gone|G&#039; (force URL to be gone)</pre><br /></dd>
<dt><abbr title="Handler">H</abbr></dt>
<dd><pre>&#039;handler|H=Content-handler&#039; (force Content handler)</pre><br /></dd>
<dt><abbr title="Last">L</abbr></dt>
<dd><pre>&#039;last|L&#039; (last rule)</pre><br /></dd>
<dt><abbr title="Next">N</abbr></dt>
<dd><pre>&#039;next|N&#039; (next round)</pre><br /></dd>
<dt><abbr title="No Case">NC</abbr></dt>
<dd><pre>&#039;nocase|NC&#039; (no case)</pre><br /></dd>
<dt><abbr title="No Escape">NE</abbr></dt>
<dd><pre>&#039;noescape|NE&#039; (no URI escaping of output)</pre><br /></dd>
<dt><abbr title="No Subrequest">NS</abbr></dt>
<dd><pre>&#039;nosubreq|NS&#039; (not for internal sub-requests)</pre><br /></dd>
<dt><abbr title="Proxy">P</abbr></dt>
<dd><pre>&#039;proxy|P&#039; (force proxy)</pre><br /></dd>
<dt><abbr title="pass through">PT</abbr></dt>
<dd><pre>&#039;passthrough|PT&#039; (pass through to next handler)</pre><br /></dd>
<dt><abbr title="Query String Append">QSA</abbr></dt>
<dd><pre>&#039;qsappend|QSA&#039; (query string append)</pre><br /></dd>
<dt><abbr title="Redirect">R</abbr></dt>
<dd><pre>&#039;redirect|R  [=code]&#039; (force redirect)</pre><br /></dd>
<dt><abbr title="Skip">S</abbr></dt>
<dd><pre>&#039;skip|S=num&#039; (skip next rule(s))</pre><br />

This flag forces the rewriting engine to skip the next num rules in sequence, if the current rule matches. Use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes skip=N, where N is the number of rules in the else-clause. (This is not the same as the 'chain|C' flag!)</dd>
<dt><abbr title="Type">T</abbr></dt>
<dd><pre>&#039;type|T=MIME-type&#039; (force MIME type)</pre><br />
Force the MIME-type of the target file to be MIME-type. This can be used to set up the content-type based on some conditions. For example, the following snippet allows .php files to be displayed by mod_php if they are called with the .phps extension:
</dd>
</dl>


<h2>Rules and Conditions Processing Order</h2>
<ol>
<li>The Pattern of the RewriteRule (^/.*$) is checked first.</li>
<li>If the pattern matches, then the RewriteCond's are checked.</li>
<li>If the RewriteConditions also match, the RewriteRule is applied.</li>
</ol>



<h2>RewriteRule Special Variables</h2>
<ol>
<li><strong>ENV_</strong></li>
<li><strong>SSL_</strong></li>
<li><strong>HTTP_</strong></li>
<li><strong>LA-U_</strong></li>
<li><strong>LA-F_</strong></li>
</ol>


<h2>RewriteCond Tests</h2>
<ul>
<li><strong>f</strong> - FILE_EXISTS</li>
<li><strong>s</strong> - FILE_SIZE</li>
<li><strong>l</strong> - FILE_LINK</li>
<li><strong>d</strong> - FILE_DIR</li>
<li><strong>x</strong> - FILE_XBIT</li>
<li><strong>U</strong> - LU_URL</li>
<li><strong>F</strong> - LU_FILE</li>
<li><strong>&gt;</strong> - STR_GT</li>
<li><strong>&lt;</strong> - STR_LT</li>
<li><strong>=</strong> - STR_EQ</li>
</ul>



<h2>Special Rewrite Redirects</h2>
<ol>
<li>"permanent" - HTTP_MOVED_PERMANENTLY</li>
<li>"temp" - HTTP_MOVED_TEMPORARILY</li>
<li>"seeother" - HTTP_SEE_OTHER</li>
<li>digit</li>
</ol>


<h2>Recognized by Mod_Rewrite</h2>
<ol>
<li>ajp://</li>
<li>balancer://</li>
<li>ftp://</li>
<li>gopher://</li>
<li>http://</li>
<li>https://</li>
<li>ldap://</li>
<li>mailto:</li>
<li>news:</li>
<li>nntp://</li>
</ol>



<h2>Mod_Rewrite Variables, from Source</h2>
<ul>
<li>TIME - <code>%04d%02d%02d%02d%02d%02d</code></li>
<li>HTTPS - <code>flag ? "on" : "off"</code></li>
<li>TIME_DAY</li>
<li>TIME_SEC</li>
<li>TIME_MIN</li>
<li>TIME_HOUR</li>
<li>TIME_MON</li>
<li>TIME_WDAY</li>
<li>TIME_YEAR</li>
<li>IS_SUBREQ - <code> (main ? "true" : "false");</code></li>
<li>PATH_INFO - <code> path_info;</code></li>
<li>AUTH_TYPE - <code> ap_auth_type;</code></li>
<li>HTTP_HOST - <code> lookup_header("Host", ctx);</code></li>
<li>SERVER_NAME - <code> ap_get_server_name(r);</code></li>
<li>REMOTE_ADDR - <code> connection-&gt;remote_ip;</code></li>
<li>SERVER_ADDR - <code> connection-&gt;local_ip;</code></li>
<li>HTTP_ACCEPT - <code> lookup_header("Accept", ctx);</code></li>
<li>THE_REQUEST - <code> the_request;</code></li>
<li>API_VERSION - <code> "%d:%d",MODULE_MAGIC_NUMBER_MAJOR,MODULE_MAGIC_NUMBER_MINOR);</code></li>
<li>HTTP_COOKIE - <code> lookup_header("Cookie", ctx);</code></li>
<li>SERVER_PORT - <code> ap_get_server_port(r);</code></li>
<li>REMOTE_HOST</li>
<li>REMOTE_NAME, NULL);</code></li>
<li>REMOTE_PORT - <code> r-&gt;connection-&gt;remote_addr-&gt;port</code></li>
<li>REMOTE_USER - <code> user;</code></li>
<li>SCRIPT_USER - <code> "&lt;unknown&gt;";</code></li>
<li>APR_FINFO_USER</li>
<li>REQUEST_URI - <code> uri;</code></li>
<li>SCRIPT_GROUP - <code> "&lt;unknown&gt;";</code></li>
<li>REMOTE_IDENT - <code> ap_get_remote_logname(r);</code></li>
<li>HTTP_REFERER - <code> lookup_header("Referer", ctx);</code></li>
<li>QUERY_STRING - <code> args;</code></li>
<li>SERVER_ADMIN - <code> server-&gt;server_admin;</code></li>
<li>DOCUMENT_ROOT - <code> ap_document_root(r);</code></li>
<li>HTTP_FORWARDED - <code>lookup_header("Forwarded", ctx);</code></li>
<li>REQUEST_METHOD - <code>method;</code></li>
<li>HTTP_USER_AGENT - <code>lookup_header("User-Agent", ctx);</code></li>
<li>SCRIPT_FILENAME - <code> same as request_filename </code></li>
<li>REQUEST_FILENAME - <code> same as script_filename </code></li>
<li>SERVER_PROTOCOL - <code>protocol</code></li>
<li>SERVER_SOFTWARE - <code>ap_get_server_banner();</code></li>
<li>HTTP_PROXY_CONNECTION - <code>lookup_header("Proxy-Connection", ctx);</code></li>
</ul>


<h2>REGEX Rewrite Guides</h2>
<ul>
<li><a href="http://www.rankinglabs.com/Mod_Rewrite">Mod_Rewrite: Flags, Rules, Conditions, Tutorial and Variables</a></li>
<li><a href="http://etext.lib.virginia.edu/services/helpsheets/unix/regex.html" title="Stephen Ramsay - Electronic Text Center - University of Virginia ">Using Regular Expressions</a></li>
<li><a href="http://check-these.info/mod_rewrite-basic.html">RewriteRule (mod_rewrite) guide</a></li>
</ul>


<h2>Mod_Rewrite Terms and Definitions</h2>
<dl>
<dt>pattern</dt><dd>the RegExp pattern string</dd>
<dt>regexp<dt><dd>the RegExp pattern compilation</dd>
<dt>flags</dt>
<dd>Flags which control the substitution</dd>
<dt>forced_mimetype</dt>
<dd>forced MIME type of substitution</dd>
<dt>forced_handler</dt>
<dd>forced content handler of subst.</dd>
<dt>forced_responsecode</dt>
<dd>forced HTTP response status</dd>
<dt>env</dt>
<dd>added environment variables</dd>
<dt>cookie</dt>
<dd>added cookies</dd>
<dt>skip</dt>
<dd>number of next rules to skip</dd>
<dt>state</dt>
<dd>the RewriteEngine state</dd>
<dt>options</dt>
<dd>the RewriteOption state</dd>
<dt>rewritelogfile</dt>
<dd>the RewriteLog filename</dd>
<dt>rewritelogfp</dt>
<dd>the RewriteLog open filepointer</dd>
<dt>rewritelog:  level</dt>
<dd>the RewriteLog level of verbosity</dd>
<dt>rewritemaps</dt>
<dd>the RewriteMap entries</dd>
<dt>rewriteconds</dt>
<dd>the RewriteCond entries (temp.)</dd>
<dt>rewriterules</dt>
<dd>the RewriteRule entries</dd>
<dt>directory</dt>
<dd>the directory where it applies</dd>
<dt>baseurl</dt>
<dd>the base-URL  where it applies</dd>
</dl>


<h2>Mod_Rewrite Errors</h2>
<ul style="font-size:10px;">
<li><code>Options FollowSymLinks or SymLinksIfOwnerMatch is off  which implies that RewriteRule directive is forbidden:  %s</code></li>
<li><code>RewriteCond: bad argument line </code></li>
<li><code>RewriteCond: NoCase option for non-regex pattern %s  is not supported and will be ignored.</code></li>
<li><code>RewriteCond: cannot compile regular  expression </code></li>
<li><code>RewriteRule: invalid HTTP  response code %s for  flag R</code></li>
<li><code>RewriteRule: unknown flag </code></li>
<li><code>RewriteRule: cannot compile regular expression </code></li>
<li><code>RewriteOptions: MaxRedirects option has been  removed in favor of the global  LimitInternalRecursion directive and will be  ignored.</code></li>
<li><code>RewriteOptions: unknown option </code></li>
<li><code>RewriteMap: bad path to txt map: </code></li>
<li><code>RewriteMap: bad path to rnd map: </code></li>
<li><code>RewriteMap: bad map:</code></li>
<li><code>RewriteMap: bad path to dbm map: </code></li>
<li><code>RewriteMap: dbm type </code></li>
<li><code>RewriteMap: bad path to prg map: </code></li>
<li><code>RewriteMap: internal map not found:</code></li>
<li><code>RewriteMap: bad path to txt map: </code></li>
<li><code>RewriteMap: file for map not found:</code></li>
<li><code>Invalid RewriteLock path</code></li>
<li><code>RewriteBase: only valid in per-directory config files</code></li>
<li><code>RewriteBase: empty URL not allowed</code></li>
<li><code>RewriteBase: argument is not a valid URL</code></li>
<li><code>RewriteCond: bad flag delimiters</code></li>
<li><code>RewriteCond: unknown flag</code></li>
<li><code>RewriteLog and RewriteLogLevel are not supported by this build of mod_rewrite because it was compiled using the -DREWRITELOG_DISABLED compiler option. You have to recompile mod_rewrite WITHOUT this option in order to use the rewrite log.</code></li>
<li><code>mod_rewrite: Invalid RewriteLog  path %s</code></li>
<li><code>mod_rewrite: could not open reliable pipe  to RewriteLog filter %s</code></li>
<li><code>mod_rewrite: Invalid RewriteLog  path %s</code></li>
<li><code>mod_rewrite: could not open RewriteLog  file %s</code></li>
<li><code>mod_rewrite: Running external rewrite maps  without defining a RewriteLock is DANGEROUS!</code></li>
<li><code>mod_rewrite: could not start RewriteMap  program %s</code></li>
<li><code>mod_rewrite: cant access text RewriteMap file %s</code></li>
<li><code>mod_rewrite: cant access DBM RewriteMap file %s</code></li>
<li><code>mod_rewrite: Parent could not create RewriteLock  file %s</code></li>
<li><code>mod_rewrite: Parent could not set permissions  on RewriteLock check User and Group directives</code></li>
<li><code>mod_rewrite: could not create rewrite_log_lock</code></li>
<li><code>mod_rewrite: Could not set permissions on  rewrite_log_lock check User and Group directives</code></li>
<li><code>mod_rewrite: could not init rewrite_mapr_lock_acquire  in child</code></li>
<li><code>mod_rewrite: could not init rewrite log lock in child</code></li>
<li><code>mod_rewrite: could not init map cache in child</code></li>
<li><code>split uri=%s -&gt; uri=%s, args=%s</code></li>
<li><code>reduce %s -&gt; %s</code></li>
<li><code>strip matching prefix: %s -&gt; %s</code></li>
<li><code>add subst prefix: %s -&gt; %s</code></li>
<li><code>cant open RewriteMap file, see error log</code></li>
<li><code>cache lookup FAILED, forcing new map lookup</code></li>
<li><code>map lookup FAILED: map=%s[txt] key=%s</code></li>
<li><code>map lookup OK: map=%s[txt] key=%s -&gt; val=%s</code></li>
<li><code>cache lookup OK: map=%s[txt] key=%s -&gt; val=%s</code></li>
<li><code>randomly chosen the subvalue `%s</code></li>
<li><code>cant open DBM RewriteMap file, see error log</code></li>
<li><code>cache lookup FAILED, forcing new map lookup</code></li>
<li><code>map lookup FAILED: map=%s[dbm] key=%s</code></li>
<li><code>map lookup OK: map=%s[dbm] key=%s -&gt;  val=%s</code></li>
<li><code>cache lookup OK: map=%s[dbm] key=%s -&gt; val=%s</code></li>
<li><code>map lookup FAILED: map=%s key=%s</code></li>
<li><code>map lookup OK: map=%s key=%s -&gt; val=%s</code></li>
<li><code>map lookup FAILED: map=%s key=%s</code></li>
<li><code>map lookup OK: map=%s key=%s -&gt; val=%s</code></li>
<li><code>lookahead: path=%s var=%s  -&gt; val=%s</code></li>
<li><code>lookahead: path=%s var=%s  -&gt; val=%s</code></li>
<li><code>RESULT=%s</code></li>
<li><code>escaping backreference %s to %s</code></li>
<li><code>setting env variable %s to %s</code></li>
<li><code>setting cookie %s, cookie</code></li>
<li><code>skipping already set cookie %s</code></li>
<li><code>RewriteCond URI (-U) check:  path=%s -&gt; status=%d</code></li>
<li><code>RewriteCond file (-F) check: path=%s  -&gt; file=%s status=%d</code></li>
<li><code>RewriteCond: input=%s pattern=%s%s%s%s  =&gt; %s</code></li>
<li><code>remember %s to have MIME-type  %s</code></li>
<li><code>remember %s to have  Content-handler %s</code></li>
<li><code>add path info postfix: %s -&gt; %s%s</code></li>
<li><code>strip per-dir prefix: %s -&gt; %s</code></li>
<li><code>applying pattern %s to uri %s</code></li>
<li><code>rewrite %s -&gt; %s, ctx-&gt;uri</code></li>
<li><code>forcing responsecode %d for %s</code></li>
<li><code>add per-dir prefix: %s -&gt; %s%s</code></li>
<li><code>forcing proxy-throughput with %s</code></li>
<li><code>explicitly forcing redirect with %s</code></li>
<li><code>implicitly forcing redirect (rc=%d)  with %s</code></li>
<li><code>forcing %s to get passed through  to next API URI-to-filename handler</code></li>
<li><code>init rewrite engine with requested uri %s</code></li>
<li><code>go-ahead with proxy request  %s [OK]</code></li>
<li><code>dconf-&gt;directory,trying to replace prefix %s with %s</code></li>
<li><code>escaping %s for redirect</code></li>
<li><code>redirect to %s [REDIRECT/%d]</code></li>
<li><code>initial URL equal rewritten  URL: %s [IGNORING REWRITE]</code></li>
<li><code>dconf-&gt;directory, trying to replace prefix  %s with %s</code></li>
<li><code>strip document_root  prefix: %s -&gt; %s</code></li>
<li><code>internal redirect with %s  [INTERNAL REDIRECT]</code></li>
<li><code>pass through %s</code></li>
<li><code>force filename %s to have MIME-type %s</code></li>
<li><code>force filename %s to have the  Content-handler %s,</code></li>
<li><code>init rewrite engine with requested uri %s</code></li>
<li><code>init rewrite engine with passed filename  %s. Original uri = %s</code></li>
<li><code>uri already rewritten. Status %s, Uri %s,   %s</code></li>
<li><code>attempt to make remote request from mod_rewrite  without proxy enabled: %s</code></li>
<li><code>go-ahead with proxy request %s [OK]</code></li>
<li><code>escaping %s for redirect</code></li>
<li><code>redirect to %s [REDIRECT/%d]</code></li>
<li><code>local path result: %s</code></li>
<li><code>prefixing with document_root of %s  FAILED</code></li>
<li><code>prefixed with document_root to %s</code></li>
<li><code>go-ahead with %s [OK]</code></li>
<li><code>pass through %s</code></li>
</ul>



<h2>URL Rewriting Module</h2>
<blockquote cite="http://apache.askapache.com/httpd/httpd-2.2.8/modules/mappers/mod_rewrite.c">
<p>This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly.</p>
<p>It supports an unlimited number of additional rule conditions (which can operate on a lot of variables, even on HTTP headers) for granular matching and even external database lookups (either via plain text tables, DBM hash files or even external processes) for advanced URL substitution.</p>
<p>It operates on the full URLs (including the PATH_INFO part) both in per-server context (httpd.conf) and per-dir context (.htaccess) and even  can generate QUERY_STRING parts on result.  The rewriting result finally can lead to internal subprocessing, external request redirection or even to internal proxy throughput.</p>
<p>This module was originally written in April 1996 and gifted exclusively to the The Apache Software Foundation in July 1997 by</p>
<address class="vcard">
<a class="fn url" href="http://engelschall.com/" title="Ralf S. Engelschall">Ralf S. Engelschall</a>
<a class="fn email" href="http://engelschall.com/contact.php">rse [at] engenschall.com</a>
</address>
</blockquote>
<p><a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html"></a><a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">Mod_Rewrite Variables Cheatsheet</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP Session File Hacks</title>
		<link>http://www.askapache.com/php/php-session-hack.html</link>
		<comments>http://www.askapache.com/php/php-session-hack.html#comments</comments>
		<pubDate>Fri, 25 Jun 2010 00:00:09 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1019</guid>
		<description><![CDATA[<p><strong>What they say about kung-fu is true</strong>..</p>
<p>It can be attained by anyone through <em>hard work over time</em>.   You can become as good as the amount of work you put in.   Here's a short look at a basic technique that I use.  Simply reverse engineering the source code and taking notes along the way...</p>
<pre>static void php_session_send_cookie(TSRMLS_D)
  if (SG(headers_sent)) {
          if (output_start_filename) {
                  php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
                          output_start_filename, output_start_lineno);
          } else {
                  php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
          }
          return;
  }
&#160;
  /* URL encode session_name and id because they might be user supplied */
  e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL);</pre>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/php/php-session-hack.html"></a><a href="http://www.askapache.com/php/php-session-hack.html"><cite>AskApache.com</cite></a></p><p>If you want to learn best tricks and tips, there's only one way to do it... at least only one way that I know of.  Here are some notes I created while learning about the intricacies of php sessions, it's all in the code.</p>


<pre>[Session]
; Handler used to store/retrieve data.
session.save_handler = files</pre>

<p>Argument passed to save_handler.  In the case of files, this is the path where data files are stored. As of PHP 4.0.1, you can define the path as:</p>
<pre>session.save_path = "N;/path"</pre>

<p> where N is an integer.  Instead of storing all the session files in
 /path, what this will do is use subdirectories N-levels deep, and
 store the session data in those directories.  This is useful if you
 or your OS have problems with lots of files in one directory, and is
 a more efficient layout for servers that handle lots of sessions.</p>

<pre>;
; NOTE 1: PHP will not create this directory structure automatically.
;         You can use the script in the ext/session dir for that purpose.
; NOTE 2: See the section on garbage collection below if you choose to
;         use subdirectories for session storage
;
; The file storage module creates files using mode 600 by default.
; You can change that by using
;
;     session.save_path = "N;MODE;/path"
;
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process&#039;s umask.
;session.save_path = "/tmp"</pre>




<h3>session.c</h3>
<pre>/* {{{ PHP_INI
 */
PHP_INI_BEGIN()
        STD_PHP_INI_BOOLEAN("session.bug_compat_42",    "1",         PHP_INI_ALL, OnUpdateBool,   bug_compat,         php_ps_globals,    ps_globals)
        STD_PHP_INI_BOOLEAN("session.bug_compat_warn",  "1",         PHP_INI_ALL, OnUpdateBool,   bug_compat_warn,    php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.save_path",          "",          PHP_INI_ALL, OnUpdateSaveDir,save_path,          php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.name",               "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name,       php_ps_globals,    ps_globals)
        PHP_INI_ENTRY("session.save_handler",           "files",     PHP_INI_ALL, OnUpdateSaveHandler)
        STD_PHP_INI_BOOLEAN("session.auto_start",       "0",         PHP_INI_ALL, OnUpdateBool,   auto_start,         php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_probability",     "1",         PHP_INI_ALL, OnUpdateLong,    gc_probability,     php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_divisor",         "100",       PHP_INI_ALL, OnUpdateLong,    gc_divisor,        php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.gc_maxlifetime",     "1440",      PHP_INI_ALL, OnUpdateLong,    gc_maxlifetime,     php_ps_globals,    ps_globals)
        PHP_INI_ENTRY("session.serialize_handler",      "php",       PHP_INI_ALL, OnUpdateSerializer)
        STD_PHP_INI_ENTRY("session.cookie_lifetime",    "0",         PHP_INI_ALL, OnUpdateLong,    cookie_lifetime,    php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.cookie_path",        "/",         PHP_INI_ALL, OnUpdateString, cookie_path,        php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.cookie_domain",      "",          PHP_INI_ALL, OnUpdateString, cookie_domain,      php_ps_globals,    ps_globals)
        STD_PHP_INI_BOOLEAN("session.cookie_secure",    "",          PHP_INI_ALL, OnUpdateBool,   cookie_secure,      php_ps_globals,    ps_globals)
        STD_PHP_INI_BOOLEAN("session.cookie_httponly",  "",          PHP_INI_ALL, OnUpdateBool,   cookie_httponly,    php_ps_globals,    ps_globals)
        STD_PHP_INI_BOOLEAN("session.use_cookies",      "1",         PHP_INI_ALL, OnUpdateBool,   use_cookies,        php_ps_globals,    ps_globals)
        STD_PHP_INI_BOOLEAN("session.use_only_cookies", "0",         PHP_INI_ALL, OnUpdateBool,   use_only_cookies,   php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.referer_check",      "",          PHP_INI_ALL, OnUpdateString, extern_referer_chk, php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.entropy_file",       "",          PHP_INI_ALL, OnUpdateString, entropy_file,       php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.entropy_length",     "0",         PHP_INI_ALL, OnUpdateLong,    entropy_length,     php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.cache_limiter",      "nocache",   PHP_INI_ALL, OnUpdateString, cache_limiter,      php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.cache_expire",       "180",       PHP_INI_ALL, OnUpdateLong,    cache_expire,       php_ps_globals,    ps_globals)
        PHP_INI_ENTRY("session.use_trans_sid",          "0",         PHP_INI_ALL, OnUpdateTransSid)
        STD_PHP_INI_ENTRY("session.hash_function",      "0",         PHP_INI_ALL, OnUpdateLong,    hash_func,          php_ps_globals,    ps_globals)
        STD_PHP_INI_ENTRY("session.hash_bits_per_character",      "4",         PHP_INI_ALL, OnUpdateLong,    hash_bits_per_character,          php_ps_globals,    ps_globals)
&nbsp;
        /* Commented out until future discussion */
        /* PHP_INI_ENTRY("session.encode_sources", "globals,track", PHP_INI_ALL, NULL) */
PHP_INI_END()
/* }}} */</pre>



<h3>Session Errors</h3>
<pre>The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and &#039;-,&#039;
fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)
open(%s, O_RDWR) failed: %s (%d)
ps_files_cleanup_dir: opendir(%s) failed: %s (%d)
read failed: %s (%d)
read returned less bytes than requested
write failed: %s (%d)
write wrote less bytes than requested
mm_malloc failed, avail %d, err %s
cannot allocate new data segment
Skipping numeric key %ld.
A session is active. You cannot change the session module&#039;s ini settings at this time.
Cannot find save handler %s
Cannot find serialization handler %s
Unknown session.serialize_handler. Failed to encode session object.
Cannot encode non-existent session.
Unknown session.serialize_handler. Failed to decode session object.
Failed to decode session object. Session has been destroyed.
Invalid session hash function
The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now
No storage module chosen - failed to initialize session.
Failed to initialize storage module: %s (path: %s)
The session bug compatibility code will not
Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.
Failed to write session data (%s). Please
Cannot send session cache limiter - headers already sent (output started at %s:%d)
Cannot send session cache limiter - headers already sent
Cannot send session cookie - headers already sent by (output started at %s:%d)
Cannot send session cookie - headers already sent
Cannot find save handler %s
Cannot find unknown save handler
purged %d expired session objects
Trying to destroy uninitialized session
Session object destruction failed
Cannot find named PHP session module (%s)
Argument %d is not a valid callback
Cannot regenerate session id - headers already sent
Session object destruction failed</pre>







<pre>PS_GC_FUNC(files)
{
        PS_FILES_DATA;
&nbsp;
        /* we don&#039;t perform any cleanup, if dirdepth is larger than 0.
           we return SUCCESS, since all cleanup should be handled by
           an external entity (i.e. find -ctime x | xargs rm) */
&nbsp;
        if (data-&gt;dirdepth == 0) {
                *nrdels = ps_files_cleanup_dir(data-&gt;basedir, maxlifetime TSRMLS_CC);
        }
&nbsp;
        return SUCCESS;
}</pre>

<h3>mod_files.c</h3>
<pre>/* If you change the logic here, please also update the error message in
 * ps_files_open() appropriately */
static int ps_files_valid_key(const char *key)
{
        size_t len;
        const char *p;
        char c;
        int ret = 1;
&nbsp;
        for (p = key; (c = *p); p++) {
                /* valid characters are a..z,A..Z,0..9 */
                if (!((c &gt;= &#039;a&#039; &amp;&amp; c &lt;= &#039;z&#039;)
                                || (c &gt;= &#039;A&#039; &amp;&amp; c &lt;= &#039;Z&#039;)
                                || (c &gt;= &#039;0&#039; &amp;&amp; c &lt;= &#039;9&#039;)
                                || c == &#039;,&#039;
                                || c == &#039;-&#039;)) {
                        ret = 0;
                        break;
                }
        }
&nbsp;
        len = p - key;
&nbsp;
        if (len == 0) {
                ret = 0;
        }
&nbsp;
        return ret;
}</pre>




<pre>static int ps_files_cleanup_dir(const char *dirname, int maxlifetime TSRMLS_DC)
{
        DIR *dir;
        char dentry[sizeof(struct dirent) + MAXPATHLEN];
        struct dirent *entry = (struct dirent *) &amp;dentry;
        struct stat sbuf;
        char buf[MAXPATHLEN];
        time_t now;
        int nrdels = 0;
        size_t dirname_len;
&nbsp;
        dir = opendir(dirname);
        if (!dir) {
                php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)", dirname, strerror(errno), errno);
                return (0);
        }
&nbsp;
        time(&amp;now);
&nbsp;
        dirname_len = strlen(dirname);
&nbsp;
        /* Prepare buffer (dirname never changes) */
        memcpy(buf, dirname, dirname_len);
        buf[dirname_len] = PHP_DIR_SEPARATOR;
&nbsp;
        while (php_readdir_r(dir, (struct dirent *) dentry, &amp;entry) == 0 &amp;&amp; entry) {
                /* does the file start with our prefix? */
                if (!strncmp(entry-&gt;d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1)) {
                        size_t entry_len = strlen(entry-&gt;d_name);
&nbsp;
                        /* does it fit into our buffer? */
                        if (entry_len + dirname_len + 2 &lt; MAXPATHLEN) {
                                /* create the full path.. */
                                memcpy(buf + dirname_len + 1, entry-&gt;d_name, entry_len);
&nbsp;
                                /* NUL terminate it and */
                                buf[dirname_len + entry_len + 1] = &#039;\0&#039;;
&nbsp;
                                /* check whether its last access was more than maxlifet ago */
                                if (VCWD_STAT(buf, &amp;sbuf) == 0 &amp;&amp;
#ifdef NETWARE
                                                (now - sbuf.st_mtime.tv_sec) &gt; maxlifetime) {
#else
                                                (now - sbuf.st_mtime) &gt; maxlifetime) {
#endif
                                        VCWD_UNLINK(buf);
                                        nrdels++;
                                }
                        }
                }
        }
&nbsp;
        closedir(dir);
&nbsp;
        return (nrdels);
}</pre>







<h3>ext/session/mod_files.c</h3>
<pre>#define PS_FILES_DATA ps_files *data = PS_GET_MOD_DATA()
&nbsp;
PS_OPEN_FUNC(files)
{
        ps_files *data;
        const char *p, *last;
        const char *argv[3];
        int argc = 0;
        size_t dirdepth = 0;
        int filemode = 0600;
&nbsp;
        if (*save_path == &#039;\0&#039;) {
                /* if save path is an empty string, determine the temporary dir */
                save_path = php_get_temporary_directory();
&nbsp;
                if (strcmp(save_path, "/tmp")) {
                        if (PG(safe_mode) &amp;&amp; (!php_checkuid(save_path, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
                                return FAILURE;
                        }
                        if (php_check_open_basedir(save_path TSRMLS_CC)) {
                                return FAILURE;
                        }
                }
        }
&nbsp;
        /* split up input parameter */
        last = save_path;
        p = strchr(save_path, &#039;;&#039;);
        while (p) {
                argv[argc++] = last;
                last = ++p;
                p = strchr(p, &#039;;&#039;);
                if (argc &gt; 2) break;
        }
        argv[argc++] = last;
&nbsp;
        if (argc &gt; 1) {
                errno = 0;
                dirdepth = (size_t) strtol(argv[0], NULL, 10);
                if (errno == ERANGE) {
                        php_error(E_WARNING, "The first parameter in session.save_path is invalid");
                        return FAILURE;
                }
        }
&nbsp;
        if (argc &gt; 2) {
                errno = 0;
                filemode = strtol(argv[1], NULL, 8);
                if (errno == ERANGE || filemode &lt; 0 || filemode &gt; 07777) {
                        php_error(E_WARNING, "The second parameter in session.save_path is invalid");
                        return FAILURE;
                }
        }
        save_path = argv[argc - 1];
&nbsp;
        data = emalloc(sizeof(*data));
        memset(data, 0, sizeof(*data));
&nbsp;
        data-&gt;fd = -1;
        data-&gt;dirdepth = dirdepth;
        data-&gt;filemode = filemode;
        data-&gt;basedir_len = strlen(save_path);
        data-&gt;basedir = estrndup(save_path, data-&gt;basedir_len);
&nbsp;
        PS_SET_MOD_DATA(data);
&nbsp;
        return SUCCESS;
}</pre>










<blockquote><pre>[PHP 5.2.0 session.save_path safe_mode and open_basedir bypass]
&nbsp;
Author: Maksymilian Arciemowicz (SecurityReason)
Date:
- - Written: 02.10.2006
- - Public: 08.12.2006
SecurityAlert Id: 43
CVE: CVE-2006-6383
SecurityRisk: High
Affected Software: PHP 5.2.0
Advisory URL: http://securityreason.com/achievement_securityalert/43
Vendor: http://www.php.net
&nbsp;
- --- 0.Description ---
PHP is an HTML-embedded scripting language. Much of its syntax is borrowed from
C, Java and Perl with a couple of unique PHP-specific features thrown in. The
goal of the language is to allow web developers to write dynamically generated
pages quickly.
&nbsp;
A nice introduction to PHP by Stig Sather Bakken can be found at
http://www.zend.com/zend/art/intro.php on the Zend website. Also, much  of the
PHP Conference Material is freely available.
&nbsp;
Session support in PHP consists of a way to preserve certain data across
subsequent accesses. This enables you to build more customized applications and
increase the appeal of your web site.
&nbsp;
A visitor accessing your web site is assigned a unique id, the so-called
session id. This is either stored in a cookie on the user side or is propagated
in the URL.
&nbsp;
session.save_path defines the argument which is passed to the save handler. If
you choose the default files handler, this is the path where the files are
created. Defaults to /tmp. See also session_save_path().
&nbsp;
There is an optional N argument to this directive that determines the number of
directory levels your session files will be spread around in. For example,
setting to &#039;5;/tmp&#039; may end up creating a session file and location like
/tmp/4/b/1/e/3/sess_4b1e384ad74619bd212e236e52a5a174If . In order to use N you
must create all of these directories before use. A small shell script exists in
ext/session to do this, it&#039;s called mod_files.sh. Also note that if N is used
and greater than 0 then automatic garbage collection will not be performed, see
a copy of php.ini for further information. Also, if you use N, be sure to
surround session.save_path in "quotes" because the separator (;) is also used
for comments in php.ini.
&nbsp;
- --- 1. session.save_path safe mode and open basedir bypass ---
session.save_path can be set in ini_set(), session_save_path() function. In
session.save_path there must be path where you will save yours tmp file. But
syntax for session.save_path can be:
&nbsp;
[/PATH]
&nbsp;
OR
&nbsp;
[N;/PATH]
&nbsp;
N - can be a string.
&nbsp;
EXAMPLES:
&nbsp;
1. session_save_path("/DIR/WHERE/YOU/HAVE/ACCESS")
2. session_save_path("5;/DIR/WHERE/YOU/HAVE/ACCESS")
&nbsp;
and
&nbsp;
3.
session_save_path("/DIR/WHERE/YOU/DONT/HAVE/ACCESS\0;/DIR/WHERE/YOU/HAVE/ACCESS")</pre></blockquote>






<pre>CACHE_LIMITER_FUNC(public)
{
        char buf[MAX_STR + 1];
        struct timeval tv;
        time_t now;
&nbsp;
        gettimeofday(&amp;tv, NULL);
        now = tv.tv_sec + PS(cache_expire) * 60;
#define EXPIRES "Expires: "
        memcpy(buf, EXPIRES, sizeof(EXPIRES) - 1);
        strcpy_gmt(buf + sizeof(EXPIRES) - 1, &amp;now);
        ADD_HEADER(buf);
&nbsp;
        snprintf(buf, sizeof(buf) , "Cache-Control: public, max-age=%ld", PS(cache_expire) * 60); /* SAFE */
        ADD_HEADER(buf);
&nbsp;
        last_modified(TSRMLS_C);
}
&nbsp;
CACHE_LIMITER_FUNC(private_no_expire)
{
        char buf[MAX_STR + 1];
&nbsp;
        snprintf(buf, sizeof(buf), "Cache-Control: private, max-age=%ld, pre-check=%ld", PS(cache_expire) * 60, PS(cache_expire) * 60); /* SAFE */
        ADD_HEADER(buf);
&nbsp;
        last_modified(TSRMLS_C);
}
&nbsp;
CACHE_LIMITER_FUNC(private)
{
        ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
        CACHE_LIMITER(private_no_expire)(TSRMLS_C);
}
&nbsp;
CACHE_LIMITER_FUNC(nocache)
{
        ADD_HEADER("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
        /* For HTTP/1.1 conforming clients and the rest (MSIE 5) */
        ADD_HEADER("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
        /* For HTTP/1.0 conforming clients */
        ADD_HEADER("Pragma: no-cache");
}
&nbsp;
static php_session_cache_limiter_t php_session_cache_limiters[] = {
        CACHE_LIMITER_ENTRY(public)
        CACHE_LIMITER_ENTRY(private)
        CACHE_LIMITER_ENTRY(private_no_expire)
        CACHE_LIMITER_ENTRY(nocache)
        {0}
};
&nbsp;
static int php_session_cache_limiter(TSRMLS_D)
{
        php_session_cache_limiter_t *lim;
&nbsp;
        if (PS(cache_limiter)[0] == &#039;\0&#039;) return 0;
&nbsp;
        if (SG(headers_sent)) {
                char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
                int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
&nbsp;
                if (output_start_filename) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
                                output_start_filename, output_start_lineno);
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent");
                }
                return -2;
        }
&nbsp;
        for (lim = php_session_cache_limiters; lim-&gt;name; lim++) {
                if (!strcasecmp(lim-&gt;name, PS(cache_limiter))) {
                        lim-&gt;func(TSRMLS_C);
                        return 0;
                }
        }
&nbsp;
        return -1;
}</pre>









<pre>static void php_session_send_cookie(TSRMLS_D)
{
        smart_str ncookie = {0};
        char *date_fmt = NULL;
        char *e_session_name, *e_id;
&nbsp;
        if (SG(headers_sent)) {
                char *output_start_filename = php_get_output_start_filename(TSRMLS_C);
                int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
&nbsp;
                if (output_start_filename) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
                                output_start_filename, output_start_lineno);
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
                }
                return;
        }
&nbsp;
        /* URL encode session_name and id because they might be user supplied */
        e_session_name = php_url_encode(PS(session_name), strlen(PS(session_name)), NULL);
        e_id = php_url_encode(PS(id), strlen(PS(id)), NULL);
&nbsp;
        smart_str_appends(&amp;ncookie, COOKIE_SET_COOKIE);
        smart_str_appends(&amp;ncookie, e_session_name);
        smart_str_appendc(&amp;ncookie, &#039;=&#039;);
        smart_str_appends(&amp;ncookie, e_id);
&nbsp;
        efree(e_session_name);
        efree(e_id);
&nbsp;
        if (PS(cookie_lifetime) &gt; 0) {
                struct timeval tv;
                time_t t;
&nbsp;
                gettimeofday(&amp;tv, NULL);
                t = tv.tv_sec + PS(cookie_lifetime);
&nbsp;
                if (t &gt; 0) {
                        date_fmt = php_std_date(t TSRMLS_CC);
                        smart_str_appends(&amp;ncookie, COOKIE_EXPIRES);
                        smart_str_appends(&amp;ncookie, date_fmt);
                        efree(date_fmt);
                }
        }
&nbsp;
        if (PS(cookie_path)[0]) {
                smart_str_appends(&amp;ncookie, COOKIE_PATH);
                smart_str_appends(&amp;ncookie, PS(cookie_path));
        }
&nbsp;
        if (PS(cookie_domain)[0]) {
                smart_str_appends(&amp;ncookie, COOKIE_DOMAIN);
                smart_str_appends(&amp;ncookie, PS(cookie_domain));
        }
&nbsp;
        if (PS(cookie_secure)) {
                smart_str_appends(&amp;ncookie, COOKIE_SECURE);
        }
&nbsp;
        if (PS(cookie_httponly)) {
                smart_str_appends(&amp;ncookie, COOKIE_HTTPONLY);
        }
&nbsp;
        smart_str_0(&amp;ncookie);
&nbsp;
        /*      &#039;replace&#039; must be 0 here, else a previous Set-Cookie
                header, probably sent with setcookie() will be replaced! */
        sapi_add_header_ex(ncookie.c, ncookie.len, 0, 0 TSRMLS_CC);
}</pre><p><a href="http://www.askapache.com/php/php-session-hack.html"></a><a href="http://www.askapache.com/php/php-session-hack.html">PHP Session File Hacks</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/php/php-session-hack.html/feed</wfw:commentRss>
		<slash:comments>2</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]
&#160;
# OR if the request if for wp-admin or wp-login.php
RewriteCond %{REQUEST_URI} ^/(wp-admin&#124;wp-login\.php).*$ [NC,OR]
&#160;
# OR if the Referer is https
RewriteCond %{HTTP_REFERER} ^https://www.askapache.com/.*$ [NC]
&#160;
# THEN skip the following rule, basically all this does is force https or badhost to be redirected
# BUT because of the above 3 rewritecond&#039;s, this won&#039;t break poorly written admin scripts
RewriteRule .* - [S=1]
&#160;
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule .* http://www.askapache.com%{REQUEST_URI} [R=301,L]
&#160;
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 WordPress wp-config.php Tweaks</title>
		<link>http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html</link>
		<comments>http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 08:23:37 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=3341</guid>
		<description><![CDATA[<p>The bottom line for this article is that I want to make WordPress as fast, secure, and easy to install, run, and manage because I am using it more and more for client production sites, I will work for days in order to solve an issue so that I never have to spend time on that issue again. Time is money in this industry and that is ultimately (time) what there is to gain by tweaking WordPress.</p>

<p class="cnote"><strong>Note:</strong> I spent no time on readability, this is primarily a read the code and figure it out article.. This is for advanced users looking for a reference or discussion and for those of you looking to advance.  Feedback would be great <em>if you make it that far..</em></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html"></a><a href="http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html"><cite>AskApache.com</cite></a></p><p>The bottom line for this article is that I want to make WordPress as fast, secure, and easy to install, run, and manage because I am using it more and more for client production sites, I will work for days in order to solve an issue so that I never have to spend time on that issue again. Time is money in this industry and that is ultimately (time) what there is to gain by tweaking WordPress.</p>
<p class="cnote"><strong>Note:</strong> I spent no time on readability, this is primarily a read the code and figure it out article.. This is for advanced users looking for a reference or discussion and for those of you looking to advance.  Feedback would be great <em>if you make it that far..</em></p>
<p>For a better handle on the way I like to structure web site directories, see <a href="http://www.askapache.com/htaccess/optimize-website-files-cache-security.html">Optimize a Website for Speed, Security, and Easy Management</a> but note it is a bit outdated compared to what I'm doing now.  I don't have the luxury of using only one type of server, or hosting provider anymore, so I have been working towards making things even more portable in order to move from host to host from server to server without issues i.e. my portable <a href="http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html">.bash_profile</a>.</p>
<p>So I've been basically experimenting various ways to accomplish that and thought I would share what I am currently doing for my benefit and hopefully get some input.  All of my WP installs run the development version, and one main idea with my setups is that upgrading is automated.  So I really keep the WordPress install clean and use plugins and wp-config.php to do all the customization.</p>
<ul>
    <li>Portability - Hands-free upgrades and easy to move</li>
    <li>Security - Additional security and protection</li>
    <li>Speed - Less CPU and Disk I/O</li>
    <li>Customization - All my favorite customizations</li>
</ul>
<h2>wp-config.php</h2>
<p>These are the main settings I use.. Seriously this is more like an interactive article, because to understand it you will need to do some code grepping.  You may want to grab a jolt.</p>
<h3>ASKAPACHE_ROOT</h3>
<p>The ASKAPACHE_ROOT variable is just a better way for me to be able to include and access all the different files in my site tree.  For instance, in my non-wp php files, I can do this:</p>
<pre>!defined(&#039;ASKAPACHE_ROOT&#039;) &amp;&amp; require $_SERVER[&#039;DOCUMENT_ROOT&#039;] . &#039;/wp-config.php&#039;;
include(ASKAPACHE_ROOT . &#039;/includes/custom-download.inc.php&#039;);</pre>
<h3>ASKAPACHE_LOCK</h3>
<p>This is one of my all-time favorite hacks, that I think is one of the most useful methods I employ as a web developer.  This allows me to use far-future-expire headers for optimum caching, while still forcing browsers to re-validate every day or so automatically, or forcing them to re-validate whenever I change the suffix.  This takes advantage of the <a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html">mod_rewrite trick</a> that I use on EVERY site I run, definately worth learning. Because I practice best-practice web-standards, for every web site I create a single css file and javascript file, which I then add to the template like:</p>
<pre>&lt;link rel="stylesheet" type="text/css" media="all" href="http://static.askapache.com/c/apache-0&lt;?php echo ASKAPACHE_LOCK?&gt;.css" /&gt;
&lt;script src="http://static.askapache.com/j/apache-0&lt;?php echo ASKAPACHE_LOCK;?&gt;.js" type="text/javascript"&gt;&lt;/script&gt;</pre>
<pre>&lt;?php
/**
 * The base configurations of the WordPress.
 *
 * This file has the following configurations: MySQL settings, Table Prefix,
 * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
 * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
 * wp-config.php} Codex page. You can get the MySQL settings from your web host.
 *
 * This file is used by the wp-config.php creation script during the
 * installation. You don&#039;t have to use the web site, you can just copy this file
 * to "wp-config.php" and fill in the values.
 *
 * @package WordPress
 */
/* http://codex.wordpress.org/Editing_wp-config.php */
&nbsp;
/** /home/liet/askapache.com */
!defined(&#039;ASKAPACHE_ROOT&#039;) &amp;&amp; define(&#039;ASKAPACHE_ROOT&#039;, str_replace(&#039;/public_html&#039;,&#039;&#039;, $_SERVER[&#039;DOCUMENT_ROOT&#039;]));
&nbsp;
/** The 008 at the end is for manual tweaking.  time() returns seconds since &#039;00:00:00 1970-01-01 UTC&#039;. */
// http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html
!defined(&#039;ASKAPACHE_LOCK&#039;) &amp;&amp; define(ASKAPACHE_LOCK&#039;, substr(time(),0,5).&#039;008&#039;); // 12533001
&nbsp;
/** absolute path to the WordPress directory */
!defined(&#039;ABSPATH&#039;) &amp;&amp; define(&#039;ABSPATH&#039;, ASKAPACHE_ROOT .&#039;/public_html/&#039;);
&nbsp;
/**
 * WP_SITEURL, defined since WordPress Version 2.2, allows the WordPress address (URL) to be defined. The valued defined is the address where your WordPress core files reside.
 * It should include the http:// part too. Do not put a slash "/" at the end.
 * Setting this value in wp-config.php overrides the wp_options table value for siteurl and disables the WordPress address (URL) field in the Administration &gt; Settings &gt; General panel.
 */
!defined(&#039;WP_SITEURL&#039;) &amp;&amp; define(&#039;WP_SITEURL&#039;, &#039;http://&#039;.$_SERVER[&#039;SERVER_NAME&#039;]);
&nbsp;
/**
 * WP_HOME is another wp-config.php option added in WordPress Version 2.2. Similar to WP_SITEURL,
 * WP_HOME overrides the wp_options table value for home but does not change it permanently.
 * home is the address you want people to type in their browser to reach your WordPress blog. It should include the http:// part. Also, do not put a slash "/" at the end.
 */
!defined(&#039;WP_HOME&#039;) &amp;&amp; define(&#039;WP_HOME&#039;, WP_SITEURL);
&nbsp;
/** no trailing slash, full paths only */
!defined(&#039;WP_CONTENT_DIR&#039;) &amp;&amp; define( &#039;WP_CONTENT_DIR&#039;, ABSPATH . &#039;wp-content&#039; );
&nbsp;
// full url - WP_CONTENT_DIR is defined further up
!defined(&#039;WP_CONTENT_URL&#039;) &amp;&amp; define( &#039;WP_CONTENT_URL&#039;, WP_SITEURL . &#039;/wp-content&#039;);
&nbsp;
/** Allows for the plugins directory to be moved from the default location. @since 2.6.0 */
// full path, no trailing slash
!defined(&#039;WP_PLUGIN_DIR&#039;) &amp;&amp; define( &#039;WP_PLUGIN_DIR&#039;, WP_CONTENT_DIR . &#039;/plugins&#039; );
&nbsp;
/** Allows for the plugins directory to be moved from the default location. @since 2.6.0 */
// full url, no trailing slash
!defined(&#039;WP_PLUGIN_URL&#039;) &amp;&amp; define( &#039;WP_PLUGIN_URL&#039;, WP_CONTENT_URL . &#039;/plugins&#039; );
&nbsp;
/** Allows for the plugins directory to be moved from the default location. @since 2.1.0 */
// Relative to ABSPATH.  For back compat.
//!defined(&#039;PLUGINDIR&#039;) &amp;&amp; define( &#039;PLUGINDIR&#039;, &#039;wp-content/plugins&#039; );
&nbsp;
/** Number of autosaves to save. TRUE is default and enables post revisions, FALSE disables revisions completely. */
!defined(&#039;WP_POST_REVISIONS&#039;) &amp;&amp; define(&#039;WP_POST_REVISIONS&#039;, 150);
&nbsp;
/* ini_set(&#039;memory_limit&#039;, WP_MEMORY_LIMIT); */
!defined(&#039;WP_MEMORY_LIMIT&#039;) &amp;&amp; define(&#039;WP_MEMORY_LIMIT&#039;, &#039;64M&#039;);
&nbsp;
/** Only check at this interval for new messages. Default is 5min */
/** @since 2.9  */
!defined(&#039;WP_MAIL_INTERVAL&#039;) &amp;&amp; define(&#039;WP_MAIL_INTERVAL&#039;, 3600); // 1 hour
&nbsp;
/** Saves updated post values to post from edit window every x seconds. (default 60)
 * When editing a post, WordPress uses Ajax to auto-save revisions to the post as you edit. You may want to increase this setting for longer delays in between auto-saves, or decrease the setting to make sure you never lose changes.
 * @since 2.5.0 */
!defined( &#039;AUTOSAVE_INTERVAL&#039; ) &amp;&amp; define( &#039;AUTOSAVE_INTERVAL&#039;, 60 );
&nbsp;
/** @since 2.9.0  */
/** Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_DAYS. */
!defined( &#039;EMPTY_TRASH_DAYS&#039; ) &amp;&amp; define( &#039;EMPTY_TRASH_DAYS&#039;, 300 );</pre>
<hr class="C" />
<h2>Debugging WordPress</h2>
<p>One of my secrets for getting really good at this stuff is to master debugging.  There is really not ever a time when I am working on a site that I don't have <a href="http://www.askapache.com/security/elite-log-file-scrolling-with-color-syntax.html">color-highlighted logs scrolling automatically in an ssh window</a>.  It's really almost impossible to fix problems with wordpress or do any kind of advanced anything without being able to view debugging info.  At first I relied heavily on a <a href="http://www.askapache.com/php/custom-phpini-tips-and-tricks.html">custom php.ini</a> being available on the server, but after having to deal with many hosts who don't allow <code>php.ini</code> files I now rely completely on setting values using <a href="http://php.net/manual/en/function.ini-set.php">ini_set</a> for ultimate portability. Detailed towards the end of this article and is also included in this <code>wp-config.php</code></p>
<pre>/**#@+
 * DEBUGGING STUFF
 */
/** display of notices during development. if false, error_reporting is E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR otherwise E_ALL */
!defined(&#039;WP_DEBUG&#039;) &amp;&amp; define(&#039;WP_DEBUG&#039;, false);
&nbsp;
/** The SAVEQUERIES definition saves the database queries to a array and that array can be displayed to help analyze those queries.
 *  The information saves each query, what function called it, and how long that query took to execute.  */
!defined(&#039;SAVE_QUERIES&#039;) &amp;&amp; define(&#039;SAVE_QUERIES&#039;, WP_DEBUG);
&nbsp;
!defined(&#039;ACTION_DEBUG&#039;) &amp;&amp; define(&#039;ACTION_DEBUG&#039;, WP_DEBUG);
&nbsp;
/** This will allow you to edit the scriptname.dev.js files in the wp-includes/js and wp-admin/js directories.  */
!defined(&#039;SCRIPT_DEBUG&#039;) &amp;&amp; define(&#039;SCRIPT_DEBUG&#039;, WP_DEBUG);
&nbsp;
/** Add define(&#039;WP_DEBUG_LOG&#039;, true); to enable php debug logging to WP_CONTENT_DIR/debug.log */
//!defined(&#039;WP_DEBUG_LOG&#039;) &amp;&amp; define(&#039;WP_DEBUG_LOG&#039;, true);
&nbsp;
/** This determines whether errors should be printed to the screen as part of the output or if they should be hidden from the user.
 *  Add define(&#039;WP_DEBUG_DISPLAY&#039;, false); to wp-config.php to use the globally configured setting for display_errors and not force it to On */
!defined(&#039;WP_DEBUG_DISPLAY&#039;) &amp;&amp; define(&#039;WP_DEBUG_DISPLAY&#039;, false);</pre>
<hr class="C" />
<h2>Ultimate Security Tweaks</h2>
<p>Well, ultimate for WP's built-in keys and password functions, this is all for wp-config.php keep in mind.  This is a very neccessary and recommended step, and is one of the only things I modify for each new installation.</p>
<h3>Security KEYS</h3>
<p>If like me you are familiar with password-cracking software like John the ripper, rainbow hash tables, l0pht-crack, etc.. then you will like to know that you can specify your own keys and salts for the encryption used by WP.  They are <code>AUTH_KEY</code>, <code>AUTH_SALT</code>, <code>SECURE_AUTH_KEY</code>, <code>SECURE_AUTH_SALT</code>, <code>LOGGED_IN_KEY</code>, <code>LOGGED_IN_SALT</code>, <code>NONCE_KEY</code>, <code>NONCE_SALT</code>, <code>SECRET_KEY</code> and <code>SECRET_SALT</code>.</p>
<p>A random and long key gives you better encryption, and exponentially increasing that is using a random and long salt for the encryption.  Encryptions with known salts are incredibly easy to decrypt compared to encryptions with secure salts, because the salt + key individually need to be guessed in order to find a matching hash, vs. just the key if the salt is known.  See: <a href="http://www.askapache.com/security/locating-weak-passwords.html">Locating weak passwords</a>.</p>
<blockquote>
    <p>A secret key is a hashing salt which makes your site harder to hack and access harder to crack by adding random elements to the password.</p>
    <p>In simple terms, a secret key is a password with elements that make it harder to generate enough options to break through your security barriers. A password like "password" or "test" is simple and easily broken. A random, unpredictable password such as "88a7da62429ba6ad3cb3c76a09641fc" takes years to come up with the right combination.</p>
</blockquote>
<p>For more information on the technical background and breakdown of secret keys and secure passwords, see: </p>
<ul>
    <li><a href="http://wordpress.org/support/topic/170987">WordPress Support Forum - HOWTO: Set up secret keys in WordPress 2.6+</a></li>
    <li><a href="http://en.wikipedia.org/wiki/Password_cracking">Wikipedia's explanation of Password Cracking</a></li>
</ul>
<p>I like to use the <a href="https://api.wordpress.org/secret-key/1.1/">WordPress.org secret-key service</a> 4 times.  That's because for each key and salt I like to do: (1 key from api +random keyboard input+1 key from api).</p>
<pre>/**#@+
 * Authentication Unique Keys.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 *
 * Get salt to add to hashes to help prevent attacks.
 *
 * The secret key is located in two places: the database in case the secret key
 * isn&#039;t defined in the second place, which is in the wp-config.php file. If you
 * are going to set the secret key, then you must do so in the wp-config.php
 * file.
 *
 * The secret key in the database is randomly generated and will be appended to
 * the secret key that is in wp-config.php file in some instances. It is
 * important to have the secret key defined or changed in wp-config.php.
 *
 * If you have installed WordPress 2.5 or later, then you will have the
 * SECRET_KEY defined in the wp-config.php already. You will want to change the
 * value in it because hackers will know what it is. If you have upgraded to
 * WordPress 2.5 or later version from a version before WordPress 2.5, then you
 * should add the constant to your wp-config.php file.
 *
 * Below is an example of how the SECRET_KEY constant is defined with a value.
 * You must not copy the below example and paste into your wp-config.php. If you
 * need an example, then you can have a
 * {@link https://api.wordpress.org/secret-key/1.1/ secret key created} for you.
 *
 * Salting passwords helps against tools which has stored hashed values of
 * common dictionary strings. The added values makes it harder to crack if given
 * salt string is not weak.
 *
 * @since 2.5
 * @link https://api.wordpress.org/secret-key/1.1/ Create a Secret Key for wp-config.php
 *
 * @return string Salt value from either &#039;SECRET_KEY&#039; or &#039;secret&#039; option
 */
define(&#039;AUTH_KEY&#039;,        &#039;jflkhaskljdfhkljasdhflkjashd;flkjhas;djfh;kajshdflkjashdlfkjhasdlkfhal?p[B+GR{@&gt;{Yq`c|LnG;dvq#| %OA_cbBSU6,rICC1o/c)-|&#039;);
define(&#039;SECURE_AUTH_KEY&#039;, &#039;jflkhaskljdfhkljasdhflkjashd;flkjhas;djfh;kajshdflkjashdlfkjhasdlkfhal?Vp[Bb15baar8&amp;R-r&lt;[T|?(xhJJABGq+Ux+U$)-Hltp/&#039;);
define(&#039;LOGGED_IN_KEY&#039;,   &#039;jflkhaskljdfhkljasdhflkjashd;flkjhas;djfh;kajshdflkjashdlfkjhasdlkfhal?Vp[B&lt;5n6DG|YWnJ9tY2!M1L)`{-$LW~~Ia%.uCbn!P. 41o2$Z$4&#039;);
define(&#039;NONCE_KEY&#039;,       &#039;jflkhaskljdfhkljasdhflkjashd;flkjhas;djfh;kajshdflkjashdlfkjhasdlkfhal?Vp[Bgu&lt;wM*zewR0.{+m:bmrB?wj!B,4]Wo+4 Avk ApR-D?E&#039;);
define(&#039;SECRET_KEY&#039;,     &#039;jflkhaskljdfhkljasdhflkjashd;flkjhas;djfh;kajshdflkjashdlfkjhasdlkfhal?Vp[B52ugH6muE9r4._iZwoYKUybrqLPpv|d Xr+|yrqhUE&#039;);
&nbsp;
define(&#039;AUTH_SALT&#039;,        &#039;123423190847olqkfhladhfsldshafasdfasdf09a7f-90a87df98adfyapoiyaf9asd8f70a9s8d7f908a7sdf97W4qCdm~Ky%+%~PPa5b YEmDI%U[W!-B&#039;);
define(&#039;SECURE_AUTH_SALT&#039;, &#039;123423190847olqkfhladhfsldshafasdfasdf09a7f-90a87df98adfyapoiyaf9asd8f70a9s8d7f908a7sdf97W4qCdmad/7o6.AU3%9o-|Kqm]+eUqr-n~:ag&#039;);
define(&#039;LOGGED_IN_SALT&#039;,   &#039;123423190847olqkfhladhfsldshafasdfasdf09a7f-90a87df98adfyapoiyaf9asd8f70a9s8d7f908a7sdf97W4qCdmsLiCv@KJ{#wd(?qe(KcH3!&#039;);
define(&#039;NONCE_SALT&#039;,       &#039;123423190847olqkfhladhfsldshafasdfasdf09a7f-90a87df98adfyapoiyaf9asd8f70a9s8d7f908a7sdf97W4qCdmG9&gt;+wm 2)bS0Pd_+1rx0brX]ND8|&#039;);
define(&#039;SECRET_SALT&#039;,      &#039;123423190847olqkfhladhfsldshafasdfasdf09a7f-90a87df98adfyapoiyaf9asd8f70a9s8d7f908a7sdf97W4qCdm2&lt;&gt;))U|sty)+4vpWooKls/^[vN&#039;);
/**#@-*/</pre>
<hr class="C" />
<h2>Using SSL for Admin and Login</h2>
<p>SSL is kinda required from my point of view, it is just way to easy to sniff data off the wire otherwise.  At least with SSL you force them to use tools like burpsuite, paros proxy, webscarab, etc..</p>
<pre>/** @since 2.6.0  */
!defined(&#039;FORCE_SSL_ADMIN&#039;) &amp;&amp; define(&#039;FORCE_SSL_ADMIN&#039;, true);
&nbsp;
/** @since 2.6.0  */
!defined(&#039;FORCE_SSL_LOGIN&#039;) &amp;&amp; define(&#039;FORCE_SSL_LOGIN&#039;, true);</pre>
<h3>Mod_Rewrite to Force SSL</h3>
<p>This is pretty cool, it forces non-https for all urls except for /wp-admin and wp-login.php, which both require https.  It also checks for the logged_in_cookie, and if that is present in the request then it doesn't force non-https.  Kinda confusing if you don't have a <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">mod_rewrite cheatsheet</a>.</p>
<pre>RewriteCond %{THE_REQUEST} ^$ [OR]
RewriteCond %{REQUEST_URI} ^/(wp-admin|wp-login\.php).*$ [NC,OR]
RewriteCond %{HTTP_COOKIE} ^.*wp_li_sadfsdfasdf11b361cdsdfasdfasd=.*$ [NC]
RewriteRule .* - [S=1]
&nbsp;
RewriteCond %{HTTPS} =on [OR]
RewriteCond %{HTTP_HOST} !^www\.askapache\.com$ [NC]
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
&nbsp;
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(wp-admin/.*|wp-login\.php.*)\ HTTP/ [NC]
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]</pre>
<hr class="C" />
<h2>File System Permissions</h2>
<p><a class="IFR" href="http://www.askapache.com/security/chmod-umask-fileperms-stat-tricks.html"><img src="http://uploads.askapache.com/2008/11/danger-chmod-screenshot.png" alt="chmod, umask, file permissions test" title="chmod, umask, file permissions test" /></a>You can get a basic and solid intro on file permissions by reading: <a href="http://codex.wordpress.org/Changing_File_Permissions">Changing File Permissions</a>, or you can check out some of my <a href="http://www.askapache.com/security/chmod-umask-fileperms-stat-tricks.html">file permission research</a>.<br class="C" />
</p>
<pre>/** The permissions as octal number, usually 0644 for files, 0755 for dirs.
 *  http://codex.wordpress.org/Changing_File_Permissions
 *  if ( !$wp_filesystem-&gt;mkdir($remote_destination, FS_CHMOD_DIR) )
 */
!defined(&#039;FS_CHMOD_DIR&#039;) &amp;&amp; define(&#039;FS_CHMOD_DIR&#039;, (0755 &amp; ~ umask()));
!defined(&#039;FS_CHMOD_FILE&#039;) &amp;&amp; define(&#039;FS_CHMOD_FILE&#039;, (0644 &amp; ~ umask()));
/**#@-*/
&nbsp;
/** Define the timeouts for the connections. Only available after the construct is called to allow for per-transport overriding of the default. */
//stream_set_timeout( $stream, FS_TIMEOUT );
//!defined(&#039;FS_TIMEOUT&#039;) &amp;&amp; define(&#039;FS_TIMEOUT&#039;, 30);
&nbsp;
//$this-&gt;link = @ftp_connect($this-&gt;options[&#039;hostname&#039;], $this-&gt;options[&#039;port&#039;], FS_CONNECT_TIMEOUT);
//!defined(&#039;FS_CONNECT_TIMEOUT&#039;) &amp;&amp; define(&#039;FS_CONNECT_TIMEOUT&#039;, 30);
&nbsp;
// function get_filesystem_method($args = array(), $context = false) {
//  $method = defined(&#039;FS_METHOD&#039;) ? FS_METHOD : false; //Please ensure that this is either &#039;direct&#039;, &#039;ssh&#039;, &#039;ftpext&#039; or &#039;ftpsockets&#039;
//!defined(&#039;FS_METHOD&#039;) &amp;&amp; define(&#039;FS_METHOD&#039;, &#039;direct&#039;);
&nbsp;
/** These methods for the WordPress core, plugin, and theme upgrades try to determine the WordPress path, as reported by PHP, but symlink trickery can sometimes
 * &#039;muck this up&#039; so if you know the paths to the various folders on the server, as seen via your FTP user, you can manually define them in the wp-config.php file.
 * FS_METHOD forces the filesystem method. It should only be "direct", "ssh", "ftpext", or "ftpsockets".
 * FTP_BASE is the full path to the "base" folder of the WordPress installation.
 * FTP_CONTENT_DIR is the full path to the wp-content folder of the WordPress installation.
 * FTP_PLUGIN_DIR is the full path to the plugins folder of the WordPress installation.
 * FTP_PUBKEY is the full path to your SSH public key.
 * FTP_PRIKEY is the full path to your SSH private key.
 * FTP_USER is either user FTP or SSH username. Most likely these are the same, but use the appropriate one for the type of update you wish to do.
 * FTP_PASS is the password for the username entered for FTP_USER. If you are using SSH public key authentication this can be omitted.
 * FTP_HOST is the hostname:port combination for your SSH/FTP server. The standard FTP port is 21 and the standard SSH port is 22.
 */
//define(&#039;FS_METHOD&#039;, &#039;ftpext&#039;);
//define(&#039;FTP_BASE&#039;, &#039;/path/to/wordpress/&#039;);
//define(&#039;FTP_CONTENT_DIR&#039;, &#039;/path/to/wordpress/wp-content/&#039;);
//define(&#039;FTP_PLUGIN_DIR &#039;, &#039;/path/to/wordpress/wp-content/plugins/&#039;);
//define(&#039;FTP_PUBKEY&#039;, &#039;/home/username/.ssh/id_rsa.pub&#039;);
//define(&#039;FTP_PRIKEY&#039;, &#039;/home/username/.ssh/id_rsa&#039;);
//define(&#039;FTP_USER&#039;, &#039;username&#039;);
//define(&#039;FTP_PASS&#039;, &#039;password&#039;);
//define(&#039;FTP_HOST&#039;, &#039;ftp.example.org:21&#039;);
&nbsp;
/**
 * Block requests through the proxy.
 *
 * Those who are behind a proxy and want to prevent access to certain hosts may do so. This will
 * prevent plugins from working and core functionality, if you don&#039;t include api.wordpress.org.
 *
 * You block external URL requests by defining WP_HTTP_BLOCK_EXTERNAL in your wp-config.php file
 * and this will only allow localhost and your blog to make requests.
 * The constant WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for requests. The format of the
 * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow.
 *
 * @since 2.8.0
 * @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
/** @since 2.9  */
//!defined(&#039;WP_HTTP_BLOCK_EXTERNAL&#039;) &amp;&amp; define( &#039;WP_HTTP_BLOCK_EXTERNAL&#039;, false );
&nbsp;
/*
 * The constant WP_ACCESSIBLE_HOSTS will allow additional hosts to go through for requests. The format of the
 * WP_ACCESSIBLE_HOSTS constant is a comma separated list of hostnames to allow.
 *
 * @since 2.8.0
 * @link http://core.trac.wordpress.org/ticket/8927 Allow preventing external requests.
 * $accessible_hosts = preg_split(&#039;|,\s*|&#039;, WP_ACCESSIBLE_HOSTS);
 * return !in_array( $check[&#039;host&#039;], $accessible_hosts ); //Inverse logic, If its in the array, then we can&#039;t access it.
 */
//!defined(&#039;WP_ACCESSIBLE_HOSTS&#039;) &amp;&amp; define( &#039;WP_ACCESSIBLE_HOSTS&#039;, &#039;askapache.com,askapache.org&#039; );</pre>
<hr class="C" />
<h3>Cookies!</h3>
<p>There's always a little comfort in having non-default cookies for security (against auto-bots), and using shorter names also means smaller HTTP Packets.</p>
<p>The <code>$cookie_hash</code> is my hack to get around the fact that <code>COOKIEHASH</code> isn't definable in <code>wp-config</code>.</p>
<pre>/**#@+
 * COOKIES
 * Used to guarantee unique hash cookies @since 1.5 */
$cookie_hash=md5(WP_SITEURL);
&nbsp;
/** Set a cookie now to see if they are supported by the browser.
 * setcookie(TEST_COOKIE, &#039;WP Cookie check&#039;, 0, COOKIEPATH, COOKIE_DOMAIN);
 * @since 2.3.0 */
!defined(&#039;TEST_COOKIE&#039;) &amp;&amp; define(&#039;TEST_COOKIE&#039;, &#039;wp_tc&#039;);
&nbsp;
/* @since 2.6.0 */
!defined(&#039;LOGGED_IN_COOKIE&#039;) &amp;&amp; define(&#039;LOGGED_IN_COOKIE&#039;, &#039;wp_li_&#039; . $cookie_hash);
&nbsp;
/* @since 2.6.0 */
!defined(&#039;SECURE_AUTH_COOKIE&#039;) &amp;&amp; define(&#039;SECURE_AUTH_COOKIE&#039;, &#039;wp_sa_&#039; . $cookie_hash);
&nbsp;
/* @since 2.5.0 */
!defined(&#039;AUTH_COOKIE&#039;) &amp;&amp; define(&#039;AUTH_COOKIE&#039;, &#039;wp_a_&#039; . $cookie_hash);
&nbsp;
/* @since 2.0.0 */
!defined(&#039;PASS_COOKIE&#039;) &amp;&amp; define(&#039;PASS_COOKIE&#039;, &#039;wp_p_&#039; . $cookie_hash);
&nbsp;
/* @since 2.0.0 */
!defined(&#039;USER_COOKIE&#039;) &amp;&amp; define(&#039;USER_COOKIE&#039;, &#039;wp_u_&#039; . $cookie_hash);
&nbsp;
/* ok unset this var, its not needed as COOKIEHASH will have this value, but is not definable in wp-config.php */
unset($cookie_hash);
&nbsp;
/** @since 1.2.0 */
!defined(&#039;COOKIEPATH&#039;) &amp;&amp; define(&#039;COOKIEPATH&#039;, preg_replace(&#039;|https?://[^/]+|i&#039;, &#039;&#039;, WP_HOME . &#039;/&#039; ) );
&nbsp;
/** @since 1.5.0 */
!defined(&#039;SITECOOKIEPATH&#039;) &amp;&amp; define(&#039;SITECOOKIEPATH&#039;, preg_replace(&#039;|https?://[^/]+|i&#039;, &#039;&#039;, WP_SITEURL . &#039;/&#039; ) );
&nbsp;
/** @since 2.6.0 */
!defined(&#039;ADMIN_COOKIE_PATH&#039;) &amp;&amp; define( &#039;ADMIN_COOKIE_PATH&#039;, SITECOOKIEPATH . &#039;wp-admin&#039; );
&nbsp;
/** @since 2.6.0 */
!defined(&#039;PLUGINS_COOKIE_PATH&#039;) &amp;&amp; define( &#039;PLUGINS_COOKIE_PATH&#039;, preg_replace(&#039;|https?://[^/]+|i&#039;, &#039;&#039;, WP_PLUGIN_URL)  );
&nbsp;
/** @since 2.0.0 */
!defined(&#039;COOKIE_DOMAIN&#039;) &amp;&amp; define(&#039;COOKIE_DOMAIN&#039;, $_SERVER[&#039;SERVER_NAME&#039;]);</pre>
<hr class="C" />
<pre>/**
  * The WP_CACHE setting, if true, includes the wp-content/advanced-cache.php script, when executing wp-settings.php.
  * For an advanced caching plugin to use, static because you would only want one
  * if ( defined(&#039;WP_CACHE&#039;) )@include WP_CONTENT_DIR . &#039;/advanced-cache.php&#039;;
  */
!defined(&#039;WP_CACHE&#039;) &amp;&amp; define(&#039;WP_CACHE&#039;, true);
&nbsp;
/** WordPress Localized Language, defaults to en_US.
 *
 * Change this to localize WordPress.  A corresponding MO file for the chosen
 * language must be installed to wp-content/languages. For example, install
 * de.mo to wp-content/languages and set WPLANG to &#039;de&#039; to enable German
 * language support. */
!defined(&#039;WPLANG&#039;) &amp;&amp; define (&#039;WPLANG&#039;, &#039;en_US&#039;);
&nbsp;
/** Stores the location of the language directory. First looks for language folder in WP_CONTENT_DIR
 *   and uses that folder if it exists. Or it uses the "languages" folder in WPINC. @since 2.1.0 */
//!defined(&#039;WP_LANG_DIR&#039;) &amp;&amp; define(&#039;WP_LANG_DIR&#039;, ABSPATH . WPINC . &#039;/languages&#039;);
&nbsp;
/** LANGDIR defines what directory the WPLANG .mo file resides. If LANGDIR is not defined WordPress looks first to wp-content/languages and then wp-includes/languages for the .mo defined by WPLANG file.  Old static relative path maintained for limited backwards compatibility - won&#039;t work in some cases*/
//!defined(&#039;LANGDIR&#039;) &amp;&amp; define(&#039;LANGDIR&#039;, &#039;wp-content/languages&#039;);
&nbsp;
/** Stores the location of the WordPress directory of functions, classes, and core content. @since 1.0.0 */
//!defined(&#039;WPINC&#039;) &amp;&amp; define(&#039;WPINC&#039;, &#039;wp-includes&#039;);</pre>
<hr class="C" />
<h2>WPMU Stuff</h2>
<p>I personally don't use.</p>
<pre>/** Allows for the mu-plugins directory to be moved from the default location. @since 2.8.0 */
//!defined(&#039;WPMU_PLUGIN_DIR&#039;) &amp;&amp; define( &#039;WPMU_PLUGIN_DIR&#039;, WP_CONTENT_DIR . &#039;/mu-plugins&#039; ); // full path, no trailing slash
&nbsp;
/** Allows for the mu-plugins directory to be moved from the default location. @since 2.8.0 */
//!defined(&#039;WPMU_PLUGIN_URL&#039;) &amp;&amp; define( &#039;WPMU_PLUGIN_URL&#039;, WP_CONTENT_URL . &#039;/mu-plugins&#039; ); // full url, no trailing slash
&nbsp;
/** Allows for the mu-plugins directory to be moved from the default location. @since 2.8.0 */
//!defined( &#039;MUPLUGINDIR&#039; ) &amp;&amp; define( &#039;MUPLUGINDIR&#039;, &#039;wp-content/mu-plugins&#039; ); // Relative to ABSPATH.  For back compat.</pre>
<hr class="C" />
<h2>WordPress Database</h2>
<p>This is usually the only thing I have to manually edit when creating a new site, unless I just use the same DB and modify the $table_prefix, (farther down). I run everything I possibly can in UTF-8, but if you don't already know alot about character sets, wow it is one of the most confusing things so you may want to save learning about that topic for another day.  Otherwise the following are helpful (<em>and show how confusing character sets are!</em>)</p>
<ul>
    <li><a href="http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html">Character Sets and Collations MySQL Support</a></li>
    <li><a href="http://codex.wordpress.org/Converting_Database_Character_Sets">Converting Database Character Sets</a></li>
    <li><a href="http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html">UTF-8 character sets</a> (<a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a>)</li>
</ul>
<p>If you ever setup WP to use the builtin membership features, make sure you learn about the <code>CUSTOM_USER_TABLE</code> and <code>CUSTOM_USER_META_TABLE</code> constants, I've found them very helpful.</p>
<pre>/**#@+
 * MySQL settings
 */
/** The name of the database for WordPress */
define(&#039;DB_NAME&#039;, &#039;askapachewpblog75&#039;);
&nbsp;
/** The username to access the database */
define(&#039;DB_USER&#039;, &#039;askapache245d&#039;);
&nbsp;
/** The password for the username to access the database */
define(&#039;DB_PASSWORD&#039;, &#039;asdfklj2340&#039;);
&nbsp;
/** The hostname to connect to the database at */
define(&#039;DB_HOST&#039;, &#039;mysql.askapache.com&#039;);
&nbsp;
/** The charset of the database */
define(&#039;DB_CHARSET&#039;, &#039;utf8&#039;);
&nbsp;
/** The collation of the database */
define(&#039;DB_COLLATE&#039;, &#039;utf8_general_ci&#039;);</pre>
<hr class="C" />
<h2>$table_prefix</h2>
<p>The <code>$table_prefix</code> is the value placed in the front of your database tables. Change the value if you want to use something other than wp_ for your database prefix. Typically this is changed if you are <a href="http://codex.wordpress.org/Installing_Multiple_Blogs">installing multiple WordPress blogs</a> in the same database, and also for enhanced security.</p>
<p>Its a safe and good idea to change this value pre-installation to add more security to your WordPress blog. Exploits attempted against your WordPress blog by malicious crackers often are built with the premise that your blog uses the prefix wp_, by changing the value you mitigate some attack vectors. </p>
<pre>/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each a unique
 * prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = &#039;ar15_&#039;;
&nbsp;
/** CUSTOM_USER_TABLE and CUSTOM_USER_META_TABLE are used to designated that the user and usermeta tables normally utilized by WordPress are not used, instead these values/tables are used to store your user information. */
//!defined(&#039;CUSTOM_USER_TABLE&#039;) &amp;&amp; define(&#039;CUSTOM_USER_TABLE&#039;, $table_prefix . &#039;my_users&#039;);
//!defined(&#039;CUSTOM_USER_META_TABLE&#039;) &amp;&amp; define(&#039;CUSTOM_USER_META_TABLE&#039;, $table_prefix . &#039;my_usermeta&#039;);</pre>
<h2>Setup PHP Ini Settings</h2>
<pre>
/** Turns the output of errors on or off, you really never want this on, you should only view errors by reading the log file. */
ini_set(&#039;display_errors&#039;, WP_DEBUG_DISPLAY);
&nbsp;
/** Tells whether script error messages should be logged to the server&#039;s error log or error_log. */
ini_set(&#039;log_errors&#039;, &#039;On&#039;);
&nbsp;
/** http://us.php.net/manual/en/timezones.php */
ini_set(&#039;date.timezone&#039;, &#039;America/Indianapolis&#039;);
&nbsp;
/** Where to log php errors */
ini_set(&#039;error_log&#039;, ASKAPACHE_ROOT . &#039;/logs/php_error.log&#039;);
&nbsp;
/** Set the memory limit, otherwise defaults to &#039;32M&#039; */
ini_set(&#039;memory_limit&#039;, WP_MEMORY_LIMIT);</pre>
<h2>Sessions are slow</h2>
<p>So I only use sessions when I have a specific use... In this case I need sessions only when one of the tools in the /online-tools/ directory is being used.  And that is for the <a href="http://www.askapache.com/security/php-captcha-anti-spam-example.html">captcha image</a>.  In the future I won't ever use sessions.</p>
<pre>if(preg_match( &#039;#^/online-tools/#&#039;,$_SERVER[&#039;REQUEST_URI&#039;])) session_start();</pre>
<h2>Include Custom Files</h2>
<p>Sure you could use the my-hacks.php that WP allows, or you can just stick your functions in your <code>TEMPLATEPATH/functions.php</code> file, but they are executed only after the wp-settings.php file, which may be too late for your file.</p>
<p>In the past I've also used the <a href="http://us2.php.net/manual/en/ini.core.php#ini.auto-prepend-file">auto_prepend_file</a> settings to run my script before anything (index.php) but I ran into some issues on different hosts, and it wasn't as portable.</p>
<p>This is useful because you can have a file with globally available functions that you can use in non-WP areas as well as WP areas.  I am moving away from this more and more as I learn more about classes and build plugins instead for portability.</p>
<pre>include_once ASKAPACHE_ROOT . &#039;/includes/myfunctions.inc&#039;;
&nbsp;
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . &#039;wp-settings.php&#039;);
?&gt;</pre>
<h2>Some Useful PHP</h2>
<p>I am constantly trying to make my sites and code more portable, so I am using plugins alot more to accomplish things that I use to do with separate php.  Here are some examples of minimal php.</p>
<pre>add_filter("the_generator", create_function(&#039;$a&#039;,&#039;return "";&#039;));
add_filter(&#039;the_content&#039;, create_function(&#039;$a&#039;, &#039;return ((is_feed())? $a."&lt;p&gt;&lt;a href=\"".get_permalink()."\"&gt;".get_the_title()."&lt;/a&gt; originally appeared on ".get_bloginfo("name").".&lt;/p&gt;" : $a);&#039;), 99999);
add_filter(&#039;excerpt_length&#039;, create_function(&#039;$a&#039;, &#039;return 300;&#039;),99);
add_filter(&#039;excerpt_more&#039;, create_function(&#039;$a&#039;, &#039;return "&amp;hellip;";&#039;),99);
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo "&lt;link rel=\"pingback\" href=\"&#039;.get_bloginfo(&#039;pingback_url&#039;).&#039;\" /&gt;\n";&#039;), 95 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo "&lt;link rel=\"schema.rss\" href=\"http://purl.org/rss/1.0/\" /&gt;\n";&#039;), 96 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo "&lt;link rel=\"schema.rel\" href=\"http://purl.org/vocab/relationship/\" /&gt;\n";&#039;), 97 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo "&lt;link rel=\"meta\" type=\"application/rdf+xml\" href=\"/foaf.rdf\" /&gt;\n";&#039;), 98 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo "&lt;link href=\"/favicon.ico\" rel=\"shortcut icon\" type=\"image/x-icon\" /&gt;\n";&#039;), 99 );</pre>
<h2>Debugging Note</h2>
<p><a href="http://wordpress.org/extend/plugins/askapache-debug-viewer/screenshots/"><img alt="AskApache Advanced Debugging Output" src="http://s.wordpress.org/extend/plugins/askapache-debug-viewer/screenshot-1.png?r=160129" title="AskApache Advanced Debugging Output" width="625" height="548" /></a>If you read this far than you probably know how important debugging is, but I sometimes like to stick the best tips deep in my articles to make sure only YOU find it.  GRTFM isn't used on this site, it's mostly a requirement because my writing can get pretty bad..  The point, debugging is more than a crucial requirement if you want to do anything cool.  Don't worry I got you.. check my <a href="http://wordpress.org/extend/plugins/askapache-debug-viewer/">AskApache Debug Viewer Plugin from the official WP site</a>.  It's pretty close to providing as verbose amount of information that I could possibly figure out how to get out of php, probably more than you have ever seen at least, I focused on quantity.  I use it all the time on new installs as there is no setup required and it tells me advanced information about the setup of the server, hacker code for sure.<br class="C" />
</p>
<p>Here's a quick function to see set global vars, I just think this is interesting code.</p>
<pre>function askapache_global_debug(){
  global $_GET,$_POST,$_COOKIE,$_SESSION,$_ENV,$_FILES,$_SERVER,$_REQUEST,$HTTP_POST_FILES,$HTTP_POST_VARS,$HTTP_SERVER_VARS,$HTTP_RAW_POST_DATA,$HTTP_GET_VARS,$HTTP_COOKIE_VARS,$HTTP_ENV_VARS;
  $gv=create_function(&#039;$n&#039;,&#039;global $$n; ob_start(); if ( is_array($$n) &amp;&amp; sizeof($$n)&gt;0 &amp;&amp; print("[{$n}]\n") ) print_r($$n);return ob_get_clean();&#039;);
  foreach (array(&#039;_GET&#039;,&#039;_POST&#039;,&#039;_COOKIE&#039;,&#039;_SESSION&#039;,&#039;_ENV&#039;,&#039;_FILES&#039;,&#039;_SERVER&#039;,&#039;_REQUEST&#039;,&#039;HTTP_POST_FILES&#039;,&#039;HTTP_POST_VARS&#039;,&#039;HTTP_SERVER_VARS&#039;,&#039;HTTP_RAW_POST_DATA&#039;,&#039;HTTP_GET_VARS&#039;,&#039;HTTP_COOKIE_VARS&#039;,&#039;HTTP_ENV_VARS&#039;) as $k)echo $gv($k);
  print_r(get_defined_constants());
}</pre>
<p class="anote">Also check the WordPress Codex page: <a href="http://codex.wordpress.org/Editing_wp-config.php">Editing wp-config.php</a> and Perishable Press's: <a href="http://perishablepress.com/press/2009/12/01/stupid-wordpress-tricks/">Stupid WordPress Tricks</a></p><p><a href="http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html"></a><a href="http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html">Advanced WordPress wp-config.php Tweaks</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/wordpress/advanced-wp-config-php-tweaks.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Firefox Add-ons for Web Developers</title>
		<link>http://www.askapache.com/hacking/firefox-addons-webdev.html</link>
		<comments>http://www.askapache.com/hacking/firefox-addons-webdev.html#comments</comments>
		<pubDate>Mon, 19 Oct 2009 00:14:07 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=3301</guid>
		<description><![CDATA[<p><a href="http://www.askapache.com/firefox/best-firefox-addons-webdev.html" class="IFL"><img src="http://uploads.askapache.com/2009/10/askapache-firefox-cache-116x102.png" alt="askapache favorite addons" title="askapache favorite addons" width="116" height="102" /></a><a href="https://addons.mozilla.org/en-US/firefox/collection/advanced-webdevelopment">Advanced Web Development by AskApache</a> is a <dfn title="Collections are groups of related add-ons assembled for easy sharing">Firefox Collection</dfn> I created since I'm always trying new Addons out and using multiple computers and I wanted a quick and easy way to install my favorite's and keep a running list.  Firebug, YSlow, LastPass, and Web Developer are the only ones I always use regularly.<br /><br />I like the idea of the last.fm but it's not as powerful as the site, which is awesome.  <em>Lately listening to <a href="http://www.last.fm/listen/artist/Kings%2Bof%2BLeon/similarartists">Kings of Leon Radio</a>...</em><br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/hacking/firefox-addons-webdev.html"></a><a href="http://www.askapache.com/hacking/firefox-addons-webdev.html"><cite>AskApache.com</cite></a></p><p><a class="IFL" href="https://addons.mozilla.org/en-US/firefox/collection/advanced-webdevelopment"><img src="https://addons.mozilla.org/en-US/firefox/images/collection_icon/27412/1253649941" title=" hacking" alt="Firefox Add ons for Web Developers" /></a><a href="https://addons.mozilla.org/en-US/firefox/collection/advanced-webdevelopment">Advanced Web Development by AskApache</a> is a <dfn title="Collections are groups of related add-ons assembled for easy sharing">Firefox Collection</dfn> I created for myself to make finding and installing my favorite Firefox Add-ons simple and easy.</p>

<h2>My Setup</h2>
<p><img class="IFL" src="http://uploads.askapache.com/2009/10/askapache-firefox-cache.png" alt="askapache favorite addons" title="askapache favorite addons" width="283" height="250" />As this screenshot shows, I only use a handful of add-ons at a time.  These buttons allow me to clear the DNS/Cookies/Cache for whichever site I'm on when I click it.  Very very helpful for me as a web designer.  The 4th button there is just a restart button.  Other than those, Firebug, YSlow, LastPass, and Web Developer are the only ones I always use regularly.<br /><br />I like the idea of the last.fm but it's not as powerful as the site, which is awesome.  Lately I've been listening to <a href="http://www.last.fm/listen/artist/Kings%2Bof%2BLeon/similarartists">Kings of Leon Radio</a>... <br class="C" /></p>

<h2>Slow Firefox</h2>
<p><strong>The more add-ons you have</strong>, disabled or not, the slower Firefox is. (<em>unless you are running your profile folder in TMPFS</em>).   Also, bookmarks and settings like that have a performance hit.  I have been using Firefox since it launched way back when, and I have always kept my bookmarks when moving to new machines and new installations..  So with over 5 thousand bookmarks I finally did some debugging and discovered that was a huge cause of Firefox acting slow.  Now I am trying to migrate them all over to Google's Gmarks, which knowing Google will be awesome eventually.</p>

<h2>Multiple Firefox Installations, Sorta</h2>
<p>The solution to all these problems is to use <strong>separate Firefox profiles</strong> which use separate folders to store your profile-specific extensions and settings.  So I have profiles with upwards of 40 Addons installed and enabled, and another profile that is built for speed... It's very very slow to be running Firebug and have multiple tabs open..  You can use the profilemanager to load them specific profiles from the command line.  I personally use separate icons on my Windows Quick Launch that I just modified the shortcut pointing to firefox to also have the profile commandline.   Note also that you can have multiple profiles open and running simultaneously.. This lets you do some crazy networking and other random hacks like having many Firefox instances running each of which is configured to use a separate SOCKS Proxy or network interface, so you can really open up those pipes for some intense txrx.</p>
<p>You can do some very powerful things with Firefox that most people are unaware of, if you are interested start with these:</p>
<ul>
<li><a href="https://developer.mozilla.org/en/Setting_up_extension_development_environment">Setting up an extension development environment</a></li>
<li><a href="https://developer.mozilla.org/en/Command_Line_Options">Firefox Command Line Options</a></li>
</ul>
<hr class="C" />


<h3>About This Collection</h3>
<p>Web Development Add-ons for Advanced Web Developers.  I personally use these to work on Sites, Servers, WordPress, Javascript, PHP, CSS, XHTML, validation, page-loading, SEO, optimizing, and much more.  <a href="https://addons.mozilla.org/en-US/firefox/users/login?to=en-US%2Ffirefox%2Fcollection%2Fadvanced-webdevelopment%3Fadvancedsearch%3D1%26show%3D100">Add this collection</a>.</p>
<p><strong>Created by:</strong><a href="https://addons.mozilla.org/en-US/firefox/user/145961">AskApache</a></p>
<p><strong>Updated:</strong>September 22, 2009 </p>


<h3>Share this Collection</h3>
<ul>
    <li class="digg"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=digg">Digg this!</a></li>
    <li class="facebook"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=facebook">Post to Facebook</a></li>
    <li class="delicious"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=delicious">Add to Delicious</a></li>
    <li class="myspace"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=myspace">Post to MySpace</a></li>
    <li class="friendfeed"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=friendfeed">Share on FriendFeed</a></li>
    <li class="twitter"><a href="https://addons.mozilla.org/en-US/firefox/collections/share/advanced-webdevelopment?service=twitter">Post to Twitter</a></li>
</ul>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/13316?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">History Tree</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/13316/1254409345" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Find any page you have visited quickly and easily. Shows your browsing history as a tree of tabs, with thumbnail screenshots of the web-pages in every tab you have opened. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/4882?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab Scope</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Preview and navigate tab contents through popup. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1480?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab Control</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Take control of your tabs!  Purposely lightweight extension with the following features... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5000?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">ShareThis</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5000/1248389010" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />ShareThis makes sharing any online content quick and easy. The ShareThis plugin allows you to share to any contact via email, text message, Facebook, Twitter and more.  You can also store your shares for later to reshare with the ShareThis ShareBox. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
	<h4><a href="https://addons.mozilla.org/en-US/firefox/addon/12377?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FirePalette</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/12377/1244736178" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Adds a color picker to Firebug's CSS panel. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/13000?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab History Menu</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/13000/1252809752" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />When click on the selected tab, a history menu corresponding to it will display. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/8426?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">SyncPlaces</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/8426/1252087590" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Synchronizes your bookmarks, passwords and password exceptions between browsers. Uses your own (or third party) web or ftp server so you have complete control and privacy. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10704?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">CSS Usage</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10704/1255464704" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Firebug extension to view which CSS rules are actually used. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9641?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Inline Code Finder for Firebug</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/9641/1246025189" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Inline Code Finder is an add-on to Firebug, to be able to find HTML elements<br class="C" /></p>
    <blockquote class="publisher-comment"><p>Provides some additional capabilities to firebug to find inline code as opposed to external files.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/4723?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Save Complete</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Saves a webpage completely, providing a better alternative to the flawed built-in save functionality of Firefox. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Another of my personal favorites, modifies the "Save complete page" option of firefox to truly be more complete, I don't understand why firefox doesn't already do this.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10615?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FireDownload</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10615/1249999245" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />The FireDownload extension for Firefox and Wyzo lets you manage and accelerate your web downloads up to 10x faster! With FireDownload, download acceleration is seamlessly displayed within the downloads window. Try the ultimate download accelerator! <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Pretty nice and unobtrusive download enhancer.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/13255?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Xmarks BYOS Edition</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/13255/1248393038" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Bookmark Sync "Bring Your Own Server" Edition (BYOS). For expert users who wish to sync their bookmarks and passwords using their own FTP or WebDAV server. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/13128?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FormBug</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />An extension to Firebug to make dealing with forms easier <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/13135?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Widerbug</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/13135/1247888469" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Firebug Evolved. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/11588?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">SyntaxHighlighter</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />a syntax highlighter, based on SyntaxHighlighter(http://code.google.com/p/syntaxhighlighter/), support lots of program languages. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Adds syntax highlighting, somewhat intensive.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2318?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Total Validator</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2318/1252747670" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Perform multiple validations and take screen shots in one go. This 5-in-1 validator works with external, internal, or local web pages using the Total Validator service or local copy of the desktop tool... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/115?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">ReloadEvery</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/115/1250716156" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Reloads web pages every so many seconds or minutes. The function is accessible via the context menu (menu you get when you right click on a web page) or via a drop down menu on the reload button ... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Love this plugin, replaces the reload button with a look-alike button with a drop-down menu that lets you enable automatic reloading of a tab (or all tabs) and set the number of seconds between reloads.  I've found it very useful for checking cookie behaviour and cache setups, its also nice if you want to keep checking a page for updates.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1985?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Window Resizer</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Resize your browser to various standard resolution sizes... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Quickly resize your window to the common sizes to see what a site looks like for users with that resolution.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/4415?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Font Finder</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Get all CSS styles of selected text in Firefox / Thunderbird... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Locate the fonts that are in use on a webpage.  Small and unobtrusive.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/12632?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FireQuery</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/12632/1248402877" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Firebug enhancements for jQuery (requires Firebug 1.3+) <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Adds jquery support, I usually keep disabled even though I personally use jquery for web development.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5362?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Alexa Sparky</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5362/1255562428" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Alexa Internet's official add-on for Firefox!  Get Alexa data in your status bar. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Shows the alexa rank of a site, I like it but it does make new HTTP requests for each page, so I disable it alot for privacy or speed.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5392?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Dust-Me Selectors</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5392/1246551563" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Finds unused CSS selectors. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>One of the newer add-ons I've been using.  Lets you find which CSS rules are actually in use on a page, thus helping you to minimize and streamline CSS.  Very cool but it is a little resource intensive so by default I keep it disabled.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/11249?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">ToggleUseDocColors</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Toggles Tools-&gt;Options-&gt;Content-&gt;Colors:Allow pages to choose their own colors... option with a single keystroke (Ctrl+M) <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Use the documents colors or other.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3606?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FoxTor</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />FoxTor: Anonymous Web Browsing using the encrypted TOR network... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10434?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Bing</a></h4>
    <p> <img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10434/1247527217" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />This is the only officially supported Bing add-on, provided by the Bing team in Microsoft. Bing is a search engine that finds and organizes the answers you need so you can make faster, more informed decisions. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9640?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Inline Code Finder</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/9640/1245858044" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Inline Code Finder is a tool to traverse through all elements in a web page, and when it finds a HTML element with any of these, it will highlight them: * Inline JavaScript events * Inline style * javascript: links <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2648?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">MM3-ProxySwitch</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2648/1233685187" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />In the Firefox Browser (and other Mozilla programs) you can per default configure only the setting for one internet connection. With the MM3-ProxySwitch you can manage different configurations and simply switch over between these. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>If like me you often connect to websites by proxying firefox through SSH Tunnels, then you can use this MM3-ProxySwitch add-on to run 3 different instances of firefox (by using multiple firefox profiles) that EACH use a different Proxy.  This is useful if you want to MAX out your download speed by downloading using multiple tunnels to do the work. <br />
            <br />
            Also useful for just plain multiple proxy configurations, very easy, and super extremely unobtrusive and low-resource intensive.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6683?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Firecookie</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6683/1251484013" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Firecookie is an extension for Firebug that makes possible to view and manage cookies in your browser <br class="C" /></p>
    <blockquote class="publisher-comment"><p>One of my personal favorites, adds a tab to firebug that lets you view live cookies being set, deleted, and updated, and lets you edit, and delete cookies of a page LIVE.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9780?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">RESTClient</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/9780/1250817670" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />RESTClient is a firefox extension use to visit and test RESTful/WebDav services. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5403?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Java Console 6.0.02</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5403/1189002765" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Java Console Extension for Java SE 1.6.0_02 (version 6 update 2). <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2325?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">RSS Ticker</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />RSS Ticker loads your Live Bookmarks and scrolls their entries across your screen while you surf. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Amazingly awesome add-on that scrolls rss feeds across a small area, helpful to keep track of various feeds and your own sites feeds.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6535?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab Sidebar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6535/1244499111" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Displays previews of your tabs in your sidebar. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>I like this one more than the tab preview add-ons, lets me find a tab quickly but only when I want by opening the sidebar.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/12065?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">CryptoFox</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/12065/1255638751" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />CryptoFox is an encryption/decryption tool for Mozilla Firefox, with dictionary attack support for cracking MD5 passwords. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9027?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Bookmark Current Tab Set</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Adds options to quickly bookmark all tabs in a window and store them in a bookmark folder that is given the date (and optionally the time) as its name. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3362?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Update Scanner</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3362/1252360045" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Monitors web pages for updates. Useful for websites that don't provide Atom or RSS feeds. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/139?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Image Zoom</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/139/1231445959" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Adds zoom functionality for images... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Simple image zooming functionality.  Small and useful add-on.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3780?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FaviconizeTab</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3780/1218612666" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />This extension adds a new "FaviconizeTab" option to the context menu of the tab... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Nice to Faviconize your most-often-used sites</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2489?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">CacheViewer</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />This extenion is GUI Front-end of "about:cache"... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Just a shortcut to the about:cache area.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6366?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FireGestures</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6366/1254150116" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />A customizable mouse gestures extension which enables you to execute various commands and user scripts with five types of gestures. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7189?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Firebug Net History Panel Overlay</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Adds history functionality to firebug net panel. Requires Firebug 1.2.0b4 or 1.2.0b6 For Firebug versions 1.1.* please use Net Panel Add-on Version 0.2.1 <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3880?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Add Bookmark Here ²</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3880/1253393237" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Add a menuitem "Add Bookmark Here..." to Bookmarks... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5914?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">DNS Cache</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5914/1246397200" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Allows you to disable and enable the DNS Cache of Firefox <br class="C" /></p>
    <blockquote class="publisher-comment"><p>The final caching add-on that I absolutely LOVE.  Lets you add anywhere on your toolbar to clear the DNS cache of firefox.  I have  this, clear cache, and clear cookies next to each other on the far left of my bookmarks toolbar, I use them ALOT.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7907?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Manage Folders</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/7907/1248060550" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Places a "Manage Folder" item on the context menu of bookmark folders, which opens the "Places Organizer" expanded to that folder. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2214?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">View Dependencies</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />View Dependencies adds a tab to the Page Info window, in which it lists all the files which were loaded to show the current page. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2275?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Torbutton</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2275/1249863832" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Torbutton provides a button to securely and easily enable or disable the browser's use of Tor. It is currently the only addon that will safely manage your Tor browsing to prevent IP address leakage, cookie leakage, and general privacy attacks. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Quick way to switch firefox to use the TOR network (I recommend the free vidalia suite) which is useful for web developers that rely on an IP address in certain programming and setups.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5447?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab Kit</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5447/1249227762" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Tab grouping, vertical tab tree, multi-rows, and various tweaks for power users. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3559?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">QuickRestart</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3559/1241624360" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Ever needed to restart Firefox after enabling or disabling an extension, switching to a new theme, or modifying configuration files (such as userChrome.css or user.js)? This simple extension adds a "Restart Firefox" item to the "File" menu. You can also use the Ctrl+Alt+R keyboard shortcut, or the included toolbar button. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>A button you can place anywhere that restarts the browser just like you do after updating add-ons.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1759?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Organize Status Bar</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />This extension will enable you to organize your status bar icons.  You can now rearrange or remove any item (icon or text) in the Firefox status bar.  If your status bar is full and cluttered like mine was, give this a try. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Lets you rearrange the items on the status bar.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/722?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">NoScript</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/722/1255474235" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />The best security you can get in a web browser! Allow active content to run only from sites you trust, and protect yourself against XSS and Clickjacking attacks. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2109?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FEBE</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2109/1255569901" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />FEBE (Firefox Environment Backup Extension) allows you to quickly and easily backup your Firefox extensions.  In fact, it goes beyond just backing up -- It will actually rebuild your extensions individually into installable .xpi files.  Now you can easily synchronize your office and home browsers. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Very helpful and well-designed add-on that lets you backup your entire firefox, or individual add-ons, or both!</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10897?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Check Places</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10897/1255544495" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Checks your bookmarks are valid and the pages still exist. Also checks for duplicates and for empty folders and can restore missing favicons. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1027?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">All-in-One Sidebar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1027/1248433103" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />All-in-One Sidebar (AiOS) is an award-winning sidebar control, inspired by Opera's. It lets you quickly switch between sidebar panels, view dialog windows such as downloads, extensions, and more in the sidebar, or view source or websites in the sidebar. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2888?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">GMarks</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />GMarks helps you sync &amp; manage your bookmarks with Google Bookmarks... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/11950?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Add-on Collector</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/11950/1252025520" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />There's a new way to manage and find favorite add-ons. Comment, share, and sync collections, all from your browser. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Lets you get updates and makes it very easy to browse a collection such as this one.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2144?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Advanced Dork:</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2144/1249684650" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Advanced Dork: gives quick access to Google's Advanced Operators directly from the context menu... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Very unobtrusively makes the advanced google search operators available.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2032?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Yahoo! Toolbar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2032/1253720246" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Use Yahoo! and the web faster, safer, and easier with new mail notification, search suggestions, online bookmarks, free spyware scanning, and more... Save time with the new Yahoo! Toolbar 2.0, now in beta at toolbar.yahoo.com/beta. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3102?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Email This!</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3102/1253158256" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Email This! will send your recipient the link, title, &amp; highlighted text of the page you are viewing using GMail, Google Apps GMail, Yahoo, and Stand-Alone Mail Clients like Outlook Express, Thunderbird, &amp; More! If you hate toolbar buttons don’t fret because I've included a right-click pop-up menu and access keys! <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2062?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab To Window</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2062/1244572621" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Open a tab in a new window... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>I have wanted this type of functionality for soo long.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2323?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Cache View</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Cache View is a Firefox extension that displays Google's Cache, Coral's Cache, and Wayback Machine's Cache cache of an open tab or selected link via a right-click or the Tools menu. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Useful to notice how often a page on your site is crawled and cached by these engines.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6984?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Lazarus: Form Recovery</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6984/1252590349" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Never lose anything you type into a web form again! Lazarus securely auto-saves all forms as you type, so after a crash, server timeout, or whatever, you can go back to the form, right click, "recover form", and breathe a sigh of relief. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Saves your form data securely as you enter it, and provides a way to recover that form data if your firefox crashes (more likely windows crashes) and that way you won't lose anything you already entered.  This will slow down firefox alot though.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6132?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tab Preview</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Preview tab contents on mouseover <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6937?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Multirow Bookmarks Toolbar</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Multi Row Bookmarks Toolbar.<br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2517?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Googlepedia</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Shows you a relevant Wikipedia article along with your search results. Clicking links in the article will trigger new Google searches, making it a very useful research tool... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Adds wikipedia results right next to google results, very helpful to keep an eye on what is authoritative, and often get the best information fast.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1237?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">QuickJava</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Allows quick enable and disable of Java and Javascript from... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3082?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Undo Closed Tabs Button</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3082/1244495823" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Tired of going to History -&gt; Recently Closed Tabs just to undo a closed tab? Then this extension is for you!  This extension allows you to undo closed tabs via a toolbar and/or tab bar button or the right-click context menu. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>One of my personal favorites, adds back the most recently closed tab, very helpful.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10618?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Faviconiac Search Engines</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10618/1247849922" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Adds PNG favicons to some search engines and web directories, such as Google, Yahoo, Bing, Ask, Altavista, Wikipedia, AOL, Dmoz, Alexa, del.icio.us and others. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>This is helpful to get a better feel for search engine results by adding their sites favicon to the search results page, is somewhat HTTP Request intensive however.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3928?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Bookmark This Page Plus</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3928/1247125860" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Adds a menu item in each sub folder of the bookmarks menu to bookmark the current page. Just as seen in the Opera browser. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1595?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Remove Cookie(s) for Site</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1595/1214859152" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />A very simple extension to remove all the cookies of currently opened site. It adds an option to the Right Click menu of the page, and a toolbar button to perform this operation. It displays the status of operation in the status bar. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>This is invaluable, it removes all the cookies from whichever domain you are currently viewing.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/967?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Modify Headers</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Add, modify and filter http request headers.  You can modify the user agent string, add headers to spoof a mobile request (e.g. x-up-calling-line-id) and much more.  Take a look at the help tab of the Modify Headers window... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Pretty awesome, lets you modify the HTTP Headers your browser is sending, useful to check accessibility, server settings, language settings, etc.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2625?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">OPML Support</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />OPML Support adds OPML import/export functionality to the Firefox Bookmarks manager. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6647?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">HttpFox</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />An HTTP analyzer addon for Firefox <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/8879?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FoxTab</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/8879/1249840764" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />3D in your browser!  FoxTab brings innovative 3D functionality to your Firefox. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Super awesome cool.  If your machine is fast this is a really helpful add-on.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/655?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">View Source Chart</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/655/1246405984" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />View Source In Color-Coded Chart Get V2.8 w/ a brand new feature from jennifermadden.com <br class="C" /></p>
    <blockquote class="publisher-comment"><p>One of my long-time, all-time favorites that lets you view the source code of a website, but in a color-coded and formatted view.  Very nice and helpful for (X)HTML developers.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/4072?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Smart Bookmarks Bar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/4072/1234555016" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Not enough place on your bookmarks bar ?... Smart Bookmarks Bar extension comes right here by hiding bookmarks names and only showing icons. Bookmark names will be displayed on mouse over. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>For those who frequently use the bookmarks in the firefox bookmarks toolbar, this is a great way to show more in a cleaner way.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1433?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Extended Statusbar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1433/1246438548" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />A Statusbar with speed, percentage, time and loaded size (similar to Opera's one) <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Provides much more information unobtrusively on your statusbar, very cool!</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10300?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Email Yourself!</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10300/1253228434" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Email Yourself! allows you to email yourself the link, title, and a selected summary of the webpage you are viewing using GMail. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/125?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">SwitchProxy Tool</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />SwitchProxy lets you manage and switch between multiple proxy configurations... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2499?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">LiveClick</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Adds feed reading, notifications, favicons, and other enhancements to Live Bookmarks. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7314?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Places' Tooltips</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />This addon enhances all the tooltips in Firefox. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/11173?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Multi Smart Search</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />"Multi smart search" displays a new context menu including all the installed search engine. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9275?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">SortPlaces</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/9275/1252087512" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Sorts your bookmarks in a variety of ways. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/433?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Flashblock</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/433/1247913103" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Never be annoyed by a Flash animation again! Blocks Flash so it won't get in your way, but if you want to see it, just click on... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Lets you block flash for all/specific websites/domains, which is pretty nice capability to test both your sites for non-flash viewers, and speeds up firefox.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6249?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Google Toolbar</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6249/1237314369" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Take the power of Google with you anywhere on the Web <br class="C" /></p>
    <blockquote class="publisher-comment"><p>A great add-on that lets you use hundreds of google tricks and tools.  Very helpful but also makes a lot of background HTTP requests so privacy-conscious or speed-freaks will want it disabled.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6622?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">DOM Inspector</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />DOM Inspector is a tool that can be used to inspect and edit the live DOM of any web document or XUL application. The DOM hierarchy can be navigated using a two-paned window that allows for a variety of different views on the document and all nodes within. Note:  This add-on depends on binary changes to Firefox, and will not work with Firefox 2. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Way to inspect the DOM of a page, useful for web developers.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6459?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Stay-Open Menu</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/6459/1250004873" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Enables multiple selections from Bookmarks Menu,  History Menu, or Smart Location Bar (awesomebar)  dropdown list, without reopening menu or using sidebar. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/710?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Menu Editor</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Customize application menus: Rearrange or remove menuitems from the main context menu (right-click menu) and main menubar (File Edit View etc.) <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/4838?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Multiple Tab Handler</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/4838/1251873082" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Provides feature to close multiple tabs. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1815?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Console²</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1815/1246698544" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Console² (pronounced Console Squared or Console Two) replaces the JavaScript Console with what could be the next generation Error Console. From v0.5 includes the Console Filter extension previously available separately from the Console² website. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>An advanced java script console.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/6271?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Bookmark Previews</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Bookmark Previews adds an album view and thumbnail view to the bookmarks manager. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Now this one is what I call genius.  Lets you view previews of your bookmarks!  Great if like me you have over a thousand bookmarks.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/8542?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">LastPass Password Manager</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/8542/1252161868" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />LastPass is a free online password manager and Form Filler that makes your web browsing easier and more secure.   LastPass supports IE and Firefox as Plugins (Opera, Safari, Chrome, iPhone, Opera Mini via Bookmarklets), allows you to import from every major password storage vendor and export too, captures passwords that other managers won't including many AJAX forms, and allows you to make strong passwords easily.  Your sensitive data is encrypted _locally_ before upload so even LastPass cannot get access to it.  One Time Passwords &amp; Screen Keyboard help protect your master password. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>What can I say, this add-on is in my top 10 for sure, and I recommend it to all my friends and even my family.  Lets me create very secure passwords for sites that I don't have to remember because lastpass remembers them for me, and stores them encrypted on both a usb medium I keep, and on their servers.  So when I use someone elses computer or reinstall firefox, I have all my usernames and passwords, and its just sooooooooooooooooo useful.  Get this add-on, it truly is a secure way to only have to remember 1 password from now on, thus LastPass.  The last password you need.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1956?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tabs Open Relative</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1956/1211284492" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Tabs Open Relative makes all new tabs open to the right of the current tab, rather than at the far right of the tab bar (optionally this only applies to links). <br class="C" /></p>
    <blockquote class="publisher-comment"><p>This stops that annoying default of opening tabs wayy on the right.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/10909?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Coral IE Tab</a></h4>
    <p> <img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/10909/1255054707" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />An enhanced version of IE Tab which enables you to use the embedded IE engine within tabs of Mozilla Firefox. It supports Adblock Plus in IE, and can sync cookies between IE and Firefox. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/966?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Tamper Data</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Use tamperdata to view and modify HTTP/HTTPS headers and post parameters... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Useful for checking form validation and security, lets you tamper data! lol</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/5369?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">YSlow</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/5369/1253220367" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />YSlow analyzes web pages and why they're slow based on Yahoo!'s rules for high performance web sites. YSlow uses Yahoo!'s Smush.it service, which is subject to Smush.it Terms of Use: http://info.yahoo.com/legal/us/yahoo/smush_it/smush_it-4378.html <br class="C" /></p>
    <blockquote class="publisher-comment"><p>One of the top 3 most important and helpful add-ons for firefox.  Web Developers who don't use this one are simply irresponsible.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/539?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">MeasureIt</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Draw out a ruler to get the pixel width and height of any elements on a... <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/271?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">ColorZilla</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/271/1234546689" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Advanced Eyedropper, ColorPicker, Page Zoomer and other colorful goodies... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>A must-have add-on for anyone using CSS or developing websites, very amazing, highly capable add-on.  The one issue is that is is somewhat of a resource-hog.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/748?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Greasemonkey</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/748/1253968926" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Allows you to customize the way a webpage displays using small bits of JavaScript. ... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Lets you use user-contributed javascripts (or your own of course) that modifies the behavior and/or appearance of many different websites.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/684?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FireFTP</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/684/1254121244" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />FireFTP is a free, secure, cross-platform FTP client for Mozilla Firefox which provides easy and intuitive access to FTP servers. <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7943?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Pixel Perfect</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/7943/1254757574" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Pixel Perfect is a Firefox/Firebug extension that allows web developers and designers to easily overlay a web composition over top of the developed HTML. * Requires Firebug <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/60?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Web Developer</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/60/1252695377" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />The Web Developer extension adds a menu and a toolbar with various web developer tools. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>This add-on is 1 of the top 2 most important add-ons for web developers.  The other is firebug.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1843?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Firebug</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1843/1254249333" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page... Firebug 1.4 requires Firefox 3.0 or higher. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>By far, without a doubt, the single most important and valuable add on for ANY web developer.  This is the one that is definitely required.  The features are too numerous to name here.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3829?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Live HTTP Headers</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3829/1245295166" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />View HTTP headers of a page and while... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Very helpful for those that don't have and use wireshark.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/2464?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FoxyProxy</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/2464/1254948830" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />FoxyProxy is an advanced proxy management tool that completely replaces Firefox's limited proxying capabilities. It offers more features than SwitchProxy, ProxyButton, QuickProxy, xyzproxy, ProxyTex, TorButton, etc. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>The most complete proxifying tool for firefox, multiple configurations possible.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/321?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">SearchStatus</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/321/1254725500" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Display the Google PageRank, Alexa rank, Compete ranking and SEOmoz Linkscape mozRank anywhere in your browser, along with fast keyword density analyser, keyword/nofollow highlighting, backward/related links, Alexa info and more. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Adds a very unobtrusive way to check the pagerank, and several other SEO statistics but only when you click a button (if configured that way) very helpful occasionally.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/201?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">DownThemAll!</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/201/1253178038" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />The first and only download manager/accelerator built inside Firefox! <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Very nice, easy, fast, and unobtrusive add-on that lets you download all files of a certain type to a certain save location, lets you use builtin filters or configure your own using basic REGEX.  Very helpful.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/1801?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Clear Cache Button</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/1801/1248704772" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Adds a clear cache toolbar button. After installing the extension, find the clear cache button in the toolbar customization... <br class="C" /></p>
    <blockquote class="publisher-comment"><p>A button you can add to your toolbar that clears your firefox cache (not cookies or history) which is invaluable for web developers.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/12006?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Wolfram Alpha Google</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/12006/1254285310" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Display Wolfram Alpha results in Google searches. No need to switch search engines when you can use both at once! <br class="C" /></p>
    <blockquote class="publisher-comment"><p>The new search is a glimpse at the future of computing.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/3895?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Personal Menu</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/3895/1253278678" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />"Menus Toolbar" item is now available in Toolbar Context Menu and you may hide it forever! <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Lets you go beyond firefox builtin menu editing and create a custom toolbar.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7613?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Jiffy</a></h4>
    <p><img src="https://addons.mozilla.org/img/default_icon.png" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title="default icon hacking" />Adds a new panel to Firebug for displaying timing measurements for JavaScript applications. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>Adds the ability to time or profile your javascript, I usually leave disabled.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/9603?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">FireRainbow</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/9603/1248403194" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Javascript syntax highlighting for Firebug 1.3+ <br class="C" /></p>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/7684?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">Fire.fm</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/7684/1254412991" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />Fire.fm gives you access to the extensive music library on Last.fm. Last.fm gives free radio to the US, UK, and Germany, plus subscriber-based service to the rest of the world. Listen to your favorite music and discover new artists in the process. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>What would work be without free streaming music that is customizable and recommends music based on your history.  Conveniently can be added to your status bar, or your toolbar.</p></blockquote>
</div>
<hr class="C" />


<div class="item-info">
    <h4><a href="https://addons.mozilla.org/en-US/firefox/addon/138?collection_uuid=2f6fd413%26%2345%3B1146%26%2345%3Bad49%26%2345%3B1cca%26%2345%3B84102bff60fb">StumbleUpon</a></h4>
    <p><img src="https://addons.mozilla.org/en-US/firefox/images/addon_icon/138/1248392473" alt="Firefox Add ons for Web Developers" height="32" width="32" class="IFL" title=" hacking" />StumbleUpon discovers web sites based on your interests, learns what you like and brings you more. <br class="C" /></p>
    <blockquote class="publisher-comment"><p>StumbleUpon is great.  Very cool way to see relevant and interesting web development articles and sites.</p></blockquote>
</div>
<hr class="C" /><p><a href="http://www.askapache.com/hacking/firefox-addons-webdev.html"></a><a href="http://www.askapache.com/hacking/firefox-addons-webdev.html">Firefox Add-ons for Web Developers</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/hacking/firefox-addons-webdev.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

