<?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; CSS</title>
	<atom:link href="http://www.askapache.com/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Fri, 25 Jun 2010 00:55:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Linux Unix BSD]]></category>
		<category><![CDATA[Mod_Rewrite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[301 Redirect]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Anti-Spam]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[bash_profile]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[chmod]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Elite]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[error log]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[File Permissions]]></category>
		<category><![CDATA[File System]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[HTTP Headers]]></category>
		<category><![CDATA[HTTPS SSL]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Mod_Rewrite cheatsheet]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[phpinfo]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Rewrite Tricks]]></category>
		<category><![CDATA[rewritecond]]></category>
		<category><![CDATA[rewriterule]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Sessions]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Socket]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[umask]]></category>
		<category><![CDATA[Username]]></category>
		<category><![CDATA[wp-config.php]]></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>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&#8217;m doing now.  I don&#8217;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-unix/bash_profile-functions-advanced-shell.html">.bash_profile</a>.</p>
<p>So I&#8217;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 &#8211; Hands-free upgrades and easy to move</li>
<li>Security &#8211; Additional security and protection</li>
<li>Speed &#8211; Less CPU and Disk I/O</li>
<li>Customization &#8211; 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=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;all&quot; href=&quot;http://static.askapache.com/c/apache-0&lt;?php echo ASKAPACHE_LOCK?&gt;.css&quot; /&gt;
&lt;script src=&quot;http://static.askapache.com/j/apache-0&lt;?php echo ASKAPACHE_LOCK;?&gt;.js&quot; type=&quot;text/javascript&quot;&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 &quot;wp-config.php&quot; 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 &quot;/&quot; 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 &quot;/&quot; 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&#8217;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&#8217;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&#8217;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" rel="nofollow" >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&#8217;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 &#8220;password&#8221; or &#8220;test&#8221; is simple and easily broken. A random, unpredictable password such as &#8220;88a7da62429ba6ad3cb3c76a09641fc&#8221; 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" rel="nofollow" >WordPress Support Forum &#8211; HOWTO: Set up secret keys in WordPress 2.6+</a></li>
<li><a href="http://en.wikipedia.org/wiki/Password_cracking" rel="nofollow" >Wikipedia&#8217;s explanation of Password Cracking</a></li>
</ul>
<p>I like to use the <a href="https://api.wordpress.org/secret-key/1.1/" rel="nofollow" >WordPress.org secret-key service</a> 4 times.  That&#8217;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 href="http://www.askapache.com/security/chmod-umask-fileperms-stat-tricks.html"class="IFR" ><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" rel="nofollow" >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 &quot;direct&quot;, &quot;ssh&quot;, &quot;ftpext&quot;, or &quot;ftpsockets&quot;.
 * FTP_BASE is the full path to the &quot;base&quot; 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&#8217;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&#8217;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 &quot;languages&quot; 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&#8217;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&#8217;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" rel="nofollow" >Character Sets and Collations MySQL Support</a></li>
<li><a href="http://codex.wordpress.org/Converting_Database_Character_Sets" rel="nofollow" >Converting Database Character Sets</a></li>
<li><a href="http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html" rel="nofollow" >UTF-8 character sets</a> (<a href="http://en.wikipedia.org/wiki/UTF-8" rel="nofollow" >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&#8217;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" rel="nofollow" >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>&nbsp;
/** 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&#8230; 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&#8217;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&#8217;ve also used the <a href="http://us2.php.net/manual/en/ini.core.php#ini.auto-prepend-file" rel="nofollow" >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&#8217;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(&quot;the_generator&quot;, create_function(&#039;$a&#039;,&#039;return &quot;&quot;;&#039;));
add_filter(&#039;the_content&#039;, create_function(&#039;$a&#039;, &#039;return ((is_feed())? $a.&quot;&lt;p&gt;&lt;a href=\&quot;&quot;.get_permalink().&quot;\&quot;&gt;&quot;.get_the_title().&quot;&lt;/a&gt; originally appeared on &quot;.get_bloginfo(&quot;name&quot;).&quot;.&lt;/p&gt;&quot; : $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 &quot;&amp;hellip;&quot;;&#039;),99);
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo &quot;&lt;link rel=\&quot;pingback\&quot; href=\&quot;&#039;.get_bloginfo(&#039;pingback_url&#039;).&#039;\&quot; /&gt;\n&quot;;&#039;), 95 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo &quot;&lt;link rel=\&quot;schema.rss\&quot; href=\&quot;http://purl.org/rss/1.0/\&quot; /&gt;\n&quot;;&#039;), 96 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo &quot;&lt;link rel=\&quot;schema.rel\&quot; href=\&quot;http://purl.org/vocab/relationship/\&quot; /&gt;\n&quot;;&#039;), 97 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo &quot;&lt;link rel=\&quot;meta\&quot; type=\&quot;application/rdf+xml\&quot; href=\&quot;/foaf.rdf\&quot; /&gt;\n&quot;;&#039;), 98 );
add_action( &#039;wp_head&#039;, create_function(&#039;$a&#039;,&#039;echo &quot;&lt;link href=\&quot;/favicon.ico\&quot; rel=\&quot;shortcut icon\&quot; type=\&quot;image/x-icon\&quot; /&gt;\n&quot;;&#039;), 99 );</pre>
<h2>Debugging Note</h2>
<p><a href="http://wordpress.org/extend/plugins/askapache-debug-viewer/screenshots/" rel="nofollow" ><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&#8217;t used on this site, it&#8217;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&#8217;t worry I got you.. check my <a href="http://wordpress.org/extend/plugins/askapache-debug-viewer/" rel="nofollow" >AskApache Debug Viewer Plugin from the official WP site</a>.  It&#8217;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&#8217;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(&quot;[{$n}]\n&quot;) ) 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" rel="nofollow" >Editing wp-config.php</a> and Perishable Press&#8217;s: <a href="http://perishablepress.com/press/2009/12/01/stupid-wordpress-tricks/" rel="nofollow" >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>5</slash:comments>
		</item>
		<item>
		<title>mod_rewrite Fix for Caching Updated Files</title>
		<link>http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html</link>
		<comments>http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html#comments</comments>
		<pubDate>Sun, 30 Aug 2009 13:20:59 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Mod_Rewrite]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Cache-Control]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[HTTP Headers]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[httpd.conf]]></category>
		<category><![CDATA[If-Modified-Since]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Last-Modified]]></category>
		<category><![CDATA[Redirect]]></category>
		<category><![CDATA[Rewrite Tricks]]></category>
		<category><![CDATA[rewritecond]]></category>
		<category><![CDATA[rewriterule]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.askapache.com/htaccess/mod_rewrite-code-to-fix-caching-updated-files.html</guid>
		<description><![CDATA[<p>Web Developers sometimes use <code>file.ext?v=004</code> as a version control system to force visitors to use updated files.  <strong>This is terrible.</strong>  Instead link to <code>apache-003.css</code> and set it to be cached forever. When you change the file you just change the links to <code>apache-004.css</code>. That eliminates millions of bandwidth and resource robbing If-Modified-Since requests. You only need Apache with mod_rewrite, and 1-10 minutes!</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Web Developers sometimes use</strong> <code>file.ext?v=137</code> as a <strong>version control system</strong> so they can force visitors to use an updated file.  <strong>This is so terrible</strong>.  Instead link to <code>apache-003.css</code> and set it to be cached forever. When you change the file you just change the links to <code>apache-004.css</code>.</p>
<h2>Raw Speed Benefit</h2>
<p>This eliminates millions of bandwidth and resource robbing <code>304 If-Modified-Since</code> requests.</p>
<hr />
<h2>Renaming links vs. Renaming files</h2>
<p>On the server my files are named <strong>apache.css</strong> and <strong>apache.js</strong>, but in the xhtml I point to them using the names <code>apache-113.css</code> and <code>apache-113.js</code>, after I change the file I just add 1 to the number, and the new file is cached. They are internally redirected to apache.css and apache.js (invisible to the user) The concept is similar to a &#8220;shortcut&#8221; in windows or a symlink in BSD.  The trick is that I never actually rename the files on the server.  I just rename them in the html.  That means <code>apache-135.css</code> is served from the file apache.css but the browser/cache only see and know about <code>apache-135.css</code>.</p>
<h2>XHTML</h2>
<p><strong>NOTE</strong>: You can do your own investigating of this sites source code and <a href="http://www.askapache.com/online-tools/http-headers-tool/">HTTP headers</a> to see this whole system in action</p>
<pre>&lt;link href=&quot;http://static.askapache.com/z/c/apache-0031.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;script src=&quot;http://static.askapache.com/z/j/apache-0031.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre>
<h2>mod_rewrite code for htaccess or httpd.conf</h2>
<p><strong>Updated:</strong> 10/20/2008</p>
<pre>RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /z/([a-z]+)/(.+)-([0-9]+)\.(js|css).*\ HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .+ /z/%2/%3.%5 [NC,L]</pre>
<h3>Alternate mod_rewrite code</h3>
<pre>RewriteEngine On
RewriteBase /
RewriteRule ^([cij]+)(/?[a-z]*)/([a-z]+)-([0-9]+)\.([a-z]+)$ /$1$2/$3.$5 [L]</pre>
<h2>Ideal Caching Scheme</h2>
<p>Ok so you want the xhtml to be the only file that isn&#8217;t cached without being validated, its simple to <a href="http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html" title="Speed Up Sites with htaccess Caching">setup your own caching scheme</a>.</p>
<h3>Bad Cache information for a file with the <code>?v=foo</code> hack</h3>
<blockquote><p>This object will be fresh for 1 week. It can be validated with Last-Modified. This object requests that a Cookie be set; this makes it and other pages affected automatically stale; clients must check them upon every request. Because it contains a query (&#8216;?&#8217;) in the URL, many caches will not keep this object.</p>
</blockquote>
<p><a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html"></a><a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html">mod_rewrite Fix for Caching Updated Files</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Print Capability to your Site with CSS</title>
		<link>http://www.askapache.com/css/css-print-site-stylesheet.html</link>
		<comments>http://www.askapache.com/css/css-print-site-stylesheet.html#comments</comments>
		<pubDate>Wed, 01 Jul 2009 04:39:56 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Print]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1043</guid>
		<description><![CDATA[<p><a class="IFR hs hs36" rel="lb" href='http://uploads.askapache.com/2008/07/printer.jpg' title="css printer friendly website"></a>Its really nice to be able to print out a webpage you are reading using your browsers built-in print feature.  Using CSS you can easily transform your site into a print-friendly site.<br /><br />Today I received an email from a visitor to my site requesting that I add a way to <strong>print site articles</strong> on AskApache<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a class="IFL hs hs36" rel="lb" href='http://uploads.askapache.com/2008/07/printer.jpg' title="css printer friendly website"></a>Its really nice to be able to print out a webpage you are reading using your browsers built-in print feature.  Using CSS you can easily transform your site into a print-friendly site.</p>
<p>Today I received an email from a visitor to my site requesting that I add a way to <strong>print site articles</strong> on AskApache<br class="C" /></p>
<blockquote><p>Finally, you have so much great stuff that I need to print it take it offline so I can consume it. However, your theme prints just awful with huge empty spaces between paragraphs and especially with some of your example code, i.e. see <a href="http://www.askapache.com/htaccess/htaccess-fresh.html">&#8220;Redirect All Feeds to Feedburner’s MyBrand&#8221;</a>.  Not sure if you care but it would really be great for those of us who print if you could clean it up for nicer printing to fully print your examples and to get rid of the excessive whitespace.</p>
</blockquote>
<p class="anote">Go ahead and hit print preview to see how effective this simple CSS print method is!  Updated! Now both the print and regular css are in the same file!  <a href="http://www.w3.org/TR/CSS21/page.html" rel="nofollow" >Please read this</a>.</p>
<h2>Making AskApache Printer-Friendly</h2>
<p>The first thing I did was to create a blank style sheet named <a href="http://static.askapache.com/css/apacheprint.css" rel="nofollow" >apacheprint.css</a> and then I added this XHTML to my <code><head></head></code></p>
<pre>&lt;link href=&quot;http://static.askapache.com/css/apacheprint.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;print&quot; /&gt;</pre>
<p>Amazingly, to make my site printer-friendly, all I had to do was edit the apacheprint.css file to control how browsers will print my site.</p>
<h2>Resetting the CSS</h2>
<p>Next I added the Yahoo Reset.css and Base.css files to my apacheprint.css file.  That code looks like this.</p>
<pre>html {color:#000; background:#FFF;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td {margin:0; padding:0;}
table {border-collapse:collapse; border-spacing:0;}
fieldset,img {border:0;}
address,caption,cite,code,dfn,em,strong,th,var {font-style:normal; font-weight:normal;}
li {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6 {font-size:100%; font-weight:normal;}
q:before,q:after {content:&#039;&#039;;}
abbr,acronym {border:0; font-variant:normal;}
sup {vertical-align:text-top;}
sub {vertical-align:text-bottom;}
input,textarea,select {font-family:inherit; font-size:inherit; font-weight:inherit;}
input,textarea,select {*font-size:100%;}
legend {color:#000;}
code {display:inline;text-indent:3px;}
h1 {font-size:138.5%;}
h2 {font-size:123.1%;}
h3 {font-size:108%;}
h1,h2,h3 {margin:1em 0;}
h1,h2,h3,h4,h5,h6,strong {font-weight:bold;}
abbr,acronym {border-bottom:1px dotted #000; cursor:help;}
em {font-style:italic;}
blockquote,ul,ol,dl {margin:1em;}
ol,ul,dl {margin-left:2em;}
ol li {list-style:decimal outside;}
ul li {list-style:disc outside;}
dl dd {margin-left:1em;}
th,td {border:1px solid #000; padding:.5em;}
th {font-weight:bold; text-align:center;}
caption {margin-bottom:.5em; text-align:center;}
p,fieldset,table,pre {margin-bottom:1em;}
input[type=text],input[type=password],textarea {width:12.25em; *width:11.9em;}</pre>
<h2>Hiding Unfriendly Content</h2>
<p>Ok so I don&#8217;t want to display the sidebar, header, footer, and several other elements on this site, so I added them to apacheprint.css with the instruction to not display them.</p>
<pre>#HeadW,#HeadW,
#NavM,#HeadW,
#FootW,#FootW,
#simg,#simg,
#BTNfs,#BTNfs,
#sidebar,#sidebar,
#content #pagebar,#pagebar,
#content #digg,#digg,
#content #bcomme,#bcomme,
#content #comments,#comments,
#content #related1p,#related1p,
#content .rnote,
.flef,.flef,
#content #npl,#npl {display:none !important;}
&nbsp;
#searchbox_002660089121042511758:kk7rwc2gx0i,#searchbox_002660089121042511758:kk7rwc2gx0i,
form#searchbox_002660089121042511758:kk7rwc2gx0i,form#searchbox_002660089121042511758:kk7rwc2gx0i,
#snaptalent,#snaptalent,
h2.HAC {display:none !important;}</pre>
<h2>Misc CSS Fixes</h2>
<p>Once that was done I tested my site using the &#8220;print preview&#8221; browser feature, and found some other things I needed to fix.</p>
<pre>#GlobalW,
#content,
#htaccess {width:auto !important; height:auto !important; overflow:visible !important; background:transparent !important; background-image:none !important; padding:0 !important; margin:0 !important; float:none !important;}
&nbsp;
.item {width:auto !important; height:100% !important; overflow:visible !important; float:none !important;}
.post-content {width:auto !important; height:auto !important; float:none !important;}
.item .post-content {width:90% !important;padding:0 6% 0 0 !important;max-width:100% !important;margin:0 auto !important;}
&nbsp;
.C {clear:both; padding:0; margin:0; line-height:5px; font-size:10px; border-bottom-width:0px;}
#content .post-content h2 {margin-top:1em;}
#content h1#sing {margin:0; width:100%; padding:0;}
.item {padding:0; margin:0;}
#content .commentlist li,#content .commentlist li.alt {margin:0.25em;}</pre>
<h2>Correct Page Breaks and Width</h2>
<p>In order to print correctly, I also added the following.</p>
<pre>html,body {background-color:#FFF; color:#000; font-size: 12pt;}
img  {max-width: 100%;}
h1,h2,h3,h4,h5,h6 {page-break-after: avoid;}
ul, ol, li {page-break-inside: avoid;}
table table,tr,td {page-break-before: avoid;page-break-after: avoid;}</pre>
<h3>Making Comments Appear on Separate Page</h3>
<p>I created a class called .pb in my main css file</p>
<pre>.pb { page-break-before: always; }</pre>
<p>that creates a page break and then added that class to a hr element before my comment div.</p>
<pre>&lt;hr class=&quot;pb&quot; /&gt;</pre>
<h2>Wrapping Code in PRE</h2>
<p>I use <code>
<pre>&lt;/code&gt; tags to markup code in my posts, but printing doesn&#039;t show you a scrollbar like my site does, so I added this fine CSS pre hack to wrap the lines when printing.&lt;/p&gt;
&lt;pre&gt;
pre {page-break-inside: avoid; font-size: 7pt !important; max-width:95% !important; overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */ white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ /* width: 99%; */ word-wrap: break-word; /* Internet Explorer 5.5+ */}</pre>
<h2>Displaying links for print</h2>
<p>I opted not to do this because I have way to many links in my posts, but here is how I can display the links next to the link name in p and li tags.  Note that it will not print relative links or anchor links or javascript links.</p>
<pre>.item p a:link:after,
.item p a:visited:after,
.item li a:link:after,
.item li a:visited:after { content: &quot; (&quot; attr(href) &quot;) &quot;;}
.item p a[href^=&quot;/&quot;]:after,
.item li a[href^=&quot;/&quot;]:after,
.item p a[href^=&quot;#&quot;]:after,
.item p a[href^=&quot;javascript&quot;]:after,
.item li a[href^=&quot;#&quot;]:after,
.item li a[href^=&quot;javascript&quot;]:after,
.item p a[href^=&quot;http://www.askapache&quot;]:after,
.item p a[href^=&quot;http://www.askapache&quot;]:after,
.item li a[href^=&quot;http://www.askapache&quot;]:after,
.item li a[href^=&quot;http://www.askapache&quot;]:after {content: &quot;&quot;;}</pre>
<h2>Learn More about CSS Printing</h2>
<ol>
<li><a href="http://developer.yahoo.com/yui/reset/" rel="nofollow" >Yahoo UI Library for Resetting CSS</a></li>
<li>A List Aparts: Going To Print</li>
<li><a href="http://www.longren.org/2006/09/27/wrapping-text-inside-pre-tags/" rel="nofollow" >Wrapping Text Inside Pre Tags</a></li>
<li><a href="http://www.alistapart.com/articles/pocket/" rel="nofollow" >A List Aparts: Taking Your Design to the Small Screen</a></li>
<li><a href="http://dev.opera.com/articles/view/making-small-devices-look-great/" rel="nofollow" >Dev Operas: Making Small Devices Look Great</a></li>
<li><a href="http://css-tricks.com/css-tricks-finally-gets-a-print-stylesheet/" rel="nofollow" >CSS-Tricks finally gets a Print Stylesheet</a></li>
<li><a href="http://davidwalsh.name/advanced-css-printing-css-page-breaks" rel="nofollow" >Advanced CSS Printing: Using Page Breaks</a></li>
<li><a href="http://members.chello.nl/b.kroonspecker/opera/" rel="nofollow" >Opera user stylesheets</a></li>
<li><a href="http://www.w3.org/TR/REC-CSS2/page.html" rel="nofollow" >W3.org Paged Media</a></li>
</ol>
<p><a href="http://www.askapache.com/css/css-print-site-stylesheet.html"></a><a href="http://www.askapache.com/css/css-print-site-stylesheet.html">Adding Print Capability to your Site with CSS</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/css-print-site-stylesheet.html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>.htaccess trick to show Alternate CSS file based on IP</title>
		<link>http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html</link>
		<comments>http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html#comments</comments>
		<pubDate>Mon, 20 Oct 2008 21:17:00 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Mod_Rewrite]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Cache-Control]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[cheatsheet]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[expires header]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[HTTP Headers]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rewrite Tricks]]></category>
		<category><![CDATA[rewritecond]]></category>
		<category><![CDATA[rewriterule]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=1724</guid>
		<description><![CDATA[<p><a class="IFL" id="id14" href="http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html" title=".htaccess trick to show Alternate CSS file based on IP"></a>This past week I updated my sites <a href="http://static.askapache.com/z/c/apache-0031.css">apache.css file</a> for a <strong>site-redesign</strong>.  I wanted to make changes to the .css file that only I could see, so that my regular traffic and site-visitors would still see the old version.  Here's the elegant solution I came up with using <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> and <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">mod_rewrite</a> that works so well I'm sharing it with all you wonderful and incredible people reading my blog :)<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html"class="IFL" id="id14"  title=".htaccess trick to show Alternate CSS file based on IP"></a>This past week I was making changes to my sites <a href="http://static.askapache.com/z/c/apache-0031.css" rel="nofollow" >apache.css file</a> for a <strong>site-redesign</strong>.  I wanted to make changes to the .css file that only I could see, so that my regular traffic and site-visitors would still see the old version.  I quickly came up with an elegant solution using the incredibly powerful <a href="http://www.askapache.com/htaccess/htaccess.html">.htaccess</a> and <a href="http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html">mod_rewrite</a> that worked so well I wanted to share it with all you great and interesting people :)<br class="C" /></p>
<hr class="C" />
<h2>Why and How to Use</h2>
<p>So to develop the new site&#8217;s css file I created a new file on my server called apachenew.css, and the old file was called apache.css, this trick simply shows anyone accessing the site from a certain IP address the apachenew.css file instead of the apache.css file.  Cool huh!?!  So I can edit the apachenew.css file and preview the site with the new css while everyone else still sees the old css.  When I am finished I just save apachenew.css as apache.css and remove this .htaccess code.  Sweet!</p>
<hr class="C" />
<p class="anote"><strong>Updated:</strong> I got some emails from you all asking for a clearer ready-to-use example, especially from WordPress bloggers.  Here you go!</p>
<h2>.htaccess code for WordPress</h2>
<p>Ok find your <code>.htaccess file</code></p>
<pre># BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
&nbsp;
# END WordPress</pre>
<hr class="C" />
<h2>The New htaccess</h2>
<p>This is assuming that your themes real .css file is <code>/wp-content/themes/yourtheme/stylesheet.css</code> and the developer .css file you will only be able to see is located at <code>/wp-content/themes/yourtheme/stylesheet-new.css</code></p>
<pre>&lt;Files stylesheet-new.css&gt;
&lt;IfModule mod_headers.c&gt;
Header set Cache-Control &quot;must-revalidate, no-store, no-cache&quot;
&lt;/IfModule&gt;
&lt;/Files&gt;
&nbsp;
RewriteEngine On
RewriteBase /
&nbsp;
RewriteCond %{REMOTE_ADDR} =208.113.134.190
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /wp-content/themes/yourtheme/stylesheet.css.* HTTP/ [NC]
RewriteRule ^wp-content/themes/yourtheme/stylesheet\.css$ /wp-content/themes/yourtheme/stylesheet-new.css [L]
&nbsp;
# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
&lt;/IfModule&gt;
&nbsp;
# END WordPress</pre>
<p class="anote"><strong>Note:</strong> The real filename is <code>apache.css</code>, the <code>-0031</code> part is because I use the incredibly useful <a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html">mod_rewrite updated file caching techinque</a> which allows me to force clients to use updated versions of my <a href="http://www.askapache.com/css/">.css</a> file by renaming it, while at the same being able to set <a href="http://www.askapache.com/htaccess/apache-speed-expires.html">Far Future Expires Headers for optimum caching</a>.</p>
<hr class="C" />
<h2>Changes to XHTML</h2>
<p><strong>None!</strong>  The link to include my <a href="http://www.askapache.com/css/">.css file</a> within the <code><head></head></code> of my pages <a href="http://www.askapache.com/xhtml/">XHTML</a> remains the same.</p>
<pre>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://static.askapache.com/z/c/apache-0031.css&quot; /&gt;</pre>
<hr class="C" />
<h2>.htaccess code to show alternate .css file based on IP</h2>
<p>So my browser makes a request for the apache-0031.css file, and IF the request originates from the IP address <code>208.113.134.190</code> then this code will instead serve the apachenew.css file AND then it uses the <code>S=1</code> RewriteRule flag to skip over the next RewriteRule Block, which is my <a href="http://www.askapache.com/htaccess/mod_rewrite-fix-for-caching-updated-files.html">updated file caching techinque</a> trick.  If you don&#8217;t use that you won&#8217;t need to skip any rules or use the 2nd RewriteRule block below, just the first.</p>
<pre>RewriteEngine On
RewriteBase /
&nbsp;
RewriteCond %{REMOTE_ADDR} =208.113.134.190
RewriteCond %{THE_REQUEST} ^(GET|HEAD) /z/c/apache-([0-9]+).css.* HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^z/c/apache-([0-9+]).css$ /z/c/apachenew.css [L,S=1]
&nbsp;
RewriteCond %{THE_REQUEST} ^(GET|HEAD) /z/([cj]+)/(.+)-([0-9]+).(js|css).* HTTP/ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^z/([cj]+)/.*.(css|js)$ /z/%2/%3.%5 [NC,L]</pre>
<hr class="C" />
<h2>Turn OFF Caching for Development CSS</h2>
<p>The next thing I wanted to automate was to turn off the caching of the apachenew.css file, which only I can see so there is no need to cache.  To do this with my current caching scheme I simply add the <code>must-revalidate</code> header to the headers sent for that file.</p>
<pre>&lt;Files apachenew.css&gt;
&lt;IfModule mod_headers.c&gt;
Header set Cache-Control &quot;must-revalidate&quot;
&lt;/IfModule&gt;
&lt;/Files&gt;</pre>
<hr class="C" />
<p>What do you think?  Questions/Improvements/Comments Welcome!</p>
<p><a href="http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html"></a><a href="http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html">.htaccess trick to show Alternate CSS file based on IP</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/htaccess/htaccess-trick-to-show-alternate-css-file-based-on-ip.html/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>SEO Secrets of AskApache Part 2</title>
		<link>http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html</link>
		<comments>http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html#comments</comments>
		<pubDate>Fri, 17 Oct 2008 21:44:22 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Linux Unix BSD]]></category>
		<category><![CDATA[Making Money]]></category>
		<category><![CDATA[Mod_Rewrite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[404 Not Found]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Advanced]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[htaccess tutorial]]></category>
		<category><![CDATA[HTTPS SSL]]></category>
		<category><![CDATA[Pagerank]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[robots.txt]]></category>
		<category><![CDATA[seo secrets]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=567</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL hs hs31" href='http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html' title="Advanced SEO part 2: Search Engine Indexing and Pagerank Control"></a>This is part II of the <a href="http://www.askapache.com/seo/seo-secrets.html">Advanced SEO used on AskApache.com Series</a> and describes how to control which urls are indexed by Search Engines and how to move them higher up in Search Results.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.askapache.com/seo/seo-secrets.html">part I: SEO Secrets of AskApache.com</a> we talked about content and building a website to be your &#8220;SEO Base&#8221;.  This article discusses some advanced SEO concepts to get a site indexed, move your best pages higher in search results, and controlling the pagerank/seo-juice of your site.  but relatively easy ways to control and tweak WHAT urls on your site are indexed, and HOW.  I&#8217;ve heard some people refer to this as &#8220;controlling pagerank flow&#8221; and &#8220;controlling pagerank juice&#8221;, basically we want our best pages to rank higher in the search engine results.</p>
<p><strong>Big Picture:</strong> Going from no website to AskApache.com in less than a year can be accomplished by anyone with unique content and a resolve to avoid any shortcuts and take it one step at a time.</p>
<p class="cnote">We want what Google wants, to provide the most relevant content for someone who is doing a search.   Basically, you want every url on your site that has unique content to be included in the index.  In other words, <strong>you have to think like a search engine</strong>!</p>
<hr class="C" />
<h2>The Goal of Google</h2>
<p>Here&#8217;s what I mean, Google approaches search with the overwhelming goal of bringing the content to a searcher that is the most-likely to be what that searcher is searching for.  Another way of looking at it is something I read on Google&#8230;</p>
<blockquote cite="http://www.google.com/"><p>Google&#8217;s goal is to get you off of their site as fast as possible by providing you with exactly what you are looking for.</p></blockquote>
<hr class="C" />
<h2>Think about SEO like this</h2>
<p>If you search for <a href="http://www.google.com/search?aq=f&#038;complete=1&#038;hl=en&#038;q=htaccess+tutorial+for+seo&#038;btnG=Search" rel="nofollow"  title="Google Search for htaccess tutorial for seo">htaccess tutorial for seo</a> on Google, would you be more likely to visit a <strong>tutorial about using .htaccess for seo</strong> or <strong>a category page for htaccess articles</strong>?  AskApache.com has both of those urls included in the index, but the article ranks higher than the category page, as it very well should.</p>
<hr class="C" />
<h2>Get Your URLS Indexed</h2>
<p>Before I explain how I am able to help Google and other search engines rank my article pages higher than my category pages, we need to get the urls in the index or nothing will show up.  There are many well-discussed methods for getting included in the index, so I&#8217;ll just list a few that I use.</p>
<ol>
<li>Provide High-Quality original content, people will link to it</li>
<li>Get a sitemap and use <a href="https://www.google.com/webmasters/tools/siteoverview?hl=en" rel="nofollow" >Google Webmaster Tools</a></li>
<li>Publish an <a href="http://feeds.askapache.com/apache/htaccess" rel="nofollow" >RSS/Atom Feed</a> and ping the net when you publish a post</li>
<li>Use robots.txt and robots meta tags</li>
</ol>
<h3>Your URLs in the index</h3>
<p>Here&#8217;s how to find out which of your pages are indexed.</p>
<ul>
<li>Indexed pages in your site: <a href="http://www.google.com/search?q=site:www.askapache.com" rel="nofollow" >site:</a></li>
<li>Pages that link to your site&#8217;s front page: <a href="http://www.google.com/search?q=link:www.askapache.com" rel="nofollow" >link:</a></li>
<li>The current cache of your site: <a href="http://www.google.com/search?q=cache:www.askapache.com" rel="nofollow" >cache:</a></li>
<li>Information about your site: <a href="http://www.google.com/search?q=info:www.askapache.com" rel="nofollow" >info:</a></li>
<li>Pages that are similar to your site: <a href="http://www.google.com/search?q=related:www.askapache.com" rel="nofollow" >related:</a></li>
</ul>
<hr class="C" />
<h2>Break It Down</h2>
<p>Yo homeslice! I didn&#8217;t mean break dance..  I mean lets simplify AskApache in the context of getting our urls indexed high/low.  Here&#8217;s the stats:  <strong>1 Homepage, 206 Articles, 19 Pages, 31 Categories</strong></p>
<h3>1 Homepage</h3>
<p>This page is generally the highest ranking page in the index, it should contain links to your best urls, and provide easy navigation</p>
<h3>206 Specific Topic Articles</h3>
<p>These are the article&#8217;s (like this one) of AskApache.com and are the main source of search engine traffic.  You want each url (if its a good article) to be ranked as high as possible.  Some keys are to really make each article specific to a topic by using best-practice (X)HTML.</p>
<h3>19 Static Pages</h3>
<p>Most of these are pages like the online-tools hosted on this site, or other basic pages like about, contact us, site-map, etc..  Some of these you may want to rank very high ( like the /about/ page ) and some you may not want to even be included in the index.</p>
<h3>31 Specific Topic Category Pages</h3>
<p>These are tricky because they are generally just lists of articles from each category, which isn&#8217;t specific enough to get much seach-engine-traffic, but is very useful to site visitors.  I beefed up my category pages by adding additional information about the category topic in addition to excerpts of the articles.</p>
<hr class="C" />
<h2>Higher Pagerank = Higher Up in Search Results</h2>
<p>So Googlebot and other search engine robots have these crazy complicated algorithms (many patented) that SEO Industry types may get caught up in and try to technically analyze them.  I&#8217;m sure you&#8217;ve seen/read/heard the complicated advice that will always be pushed by many&#8230; advice like:</p>
<ul>
<li>analyze the number of words in the description/title/1st paragraph/etc.</li>
<li>Make sure your &#8220;keyword&#8221; is sprinkled throughout the text every 10-30th word..</li>
<li>Other equally unexciting technical analysis</li>
</ul>
<p>Now if you&#8217;ve had success with that then props to you, success is success, but I personally choose to completely ignore all that.  The number 1 thing that the top search engines advise is to design your page for a <strong>Human Visitor</strong>, not a computer.  The golden rule for me is how I would rank the page, not how some algorithm would.</p>
<hr class="C" />
<h2>Designing for a Human Visitor</h2>
<p>This is a major factor in your site being at the top vs. nowhere.   You design your HTML to be as minimal as possible (see source code for my homepage) and contain ONLY the neccessary elements.  Above all, use semantically sound XHTML markup.  (view source of <a href="http://www.w3.org/" rel="nofollow"  title="World Wide Web Consortium"><acronym title="World Wide Web Consortium">W3C</acronym></a>)</p>
<h3>External CSS/Javascript</h3>
<p>Get your javascript and CSS out of your HTML and use external files (like this site) ALWAYS!  You should start with just the HTML, no css, no colors, no javascript, and THEN you add the .css and then you add the javascript.</p>
<h3>Site Accessibility</h3>
<p>Say your browser didn&#8217;t have a mouse, didn&#8217;t support images, css, javascript, or even colors!  Your HTML should be structured such that your page is still easily readable and easy to navigate.  You can use lynx, links, and many other terminal-based browsers to test for this&#8230; please see the <a href="http://www.w3.org/WAI/" rel="nofollow" >Web Accessibility Initiative (<acronym title="Web Accessibility Initiative">WAI</acronym>)</a> for detailed info.</p>
<blockquote cite="http://en.wikipedia.org/wiki/Web_accessibility"><p><a href="http://en.wikipedia.org/wiki/Web_accessibility" rel="nofollow" >Web accessibility</a> refers to the practice of making websites usable by people of all abilities and disabilities. When sites are correctly designed, developed and edited, all users can have equal access to information and functionality. For example, when a site is coded with semantically meaningful HTML, with textual equivalents provided for images and with links named meaningfully, this helps blind users using text-to-speech software and/or text-to-Braille hardware.</p>
</blockquote>
<hr class="C" />
<h2>Controlling a URL&#8217;s Pagerank</h2>
<p>A few tools and techniques are available for controlling the &#8220;juice&#8221; or &#8220;pagerank&#8221; of your urls.</p>
<ol>
<li>Robots.txt</li>
<li>Robots Meta Tags</li>
<li>Links</li>
</ol>
<h2>Robots.txt</h2>
<p>I&#8217;ve done quite a bit of research and experimentation with <a href="http://www.askapache.com/search/robots.txt">robots.txt files</a>, which is a file located in the root of your website at <a href="http://www.askapache.com/robots.txt">http://www.askapache.com/robots.txt</a> that is downloaded by all legitimate search engine spiders/bots and used as a Blacklist to prevent certain urls from being indexed.  Here are a few of the articles on this site, which you may skip if you like as they don&#8217;t illustrate the big-picture that I am going to discuss now.</p>
<ul>
<li><a href="http://www.askapache.com/seo/robotstxt-mattcutts-noindex.html">Control Flow of Pagerank with robots.txt and NoFollow, NoIndex</a></li>
<li><a href="http://www.askapache.com/seo/updated-robotstxt-for-wordpress.html">WordPress robots.txt</a></li>
<li><a href="http://www.askapache.com/seo/seo-with-robotstxt.html">SEO with Robots.txt</a></li>
<li><a href="http://www.askapache.com/google/adsense-robots.html">Google AdSense using robots.txt</a></li>
<li><a href="http://www.askapache.com/seo/wordpress-robotstxt-seo.html">WordPress robots.txt file optimized for SEO and Google</a></li>
</ul>
<h3>How To Use Robots.txt</h3>
<p>Even though robots.txt files are for whitelisting and blacklisting urls, I have found that they should only be used as an extreme form of blacklisting.  When you Disallow a url in your robots.txt file, that means most search engine bots won&#8217;t even LOOK at the url.  As you can see in the below example, I only disallow urls that shouldn&#8217;t ever be LOOKED at.  The real powertool is the <strong>robots meta tag</strong>.</p>
<pre>User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content
&nbsp;
Sitemap: http://www.askapache.com/sitemap.xml</pre>
<hr class="C" />
<h2>Robots Meta Tag</h2>
<p>Ok I&#8217;m really trying to simplify, because what you should understand is the big-picture.  Every page can have a robots meta tag in the header, and this robots meta tag can tell the search-engine to index/not-index AND follow/not-follow.  Here are some examples:</p>
<pre>&lt;meta name=&quot;robots&quot; content=&quot;index&quot; /&gt;
&lt;meta name=&quot;robots&quot; content=&quot;noindex&quot; /&gt;
&lt;meta name=&quot;robots&quot; content=&quot;noindex,follow&quot; /&gt;
&lt;meta name=&quot;robots&quot; content=&quot;index,nofollow&quot; /&gt;</pre>
<h3>content=&#8221;index&#8221; / noindex</h3>
<p><code>index</code> means the search engine is free to index, archive, cache, and follow the page whereas <code>noindex</code> means DO NOT include this page in the search engine results.</p>
<h3>content=&#8221;follow&#8221; / nofollow</h3>
<p><code>follow</code> means the search engine is free to LOOK at the page and follow the links on the page whereas <code>nofollow</code> means DO NOT follow the links on the page.</p>
<hr class="C" />
<h3>WordPress Auto-Robots meta tag code</h3>
<p>Just add this to any plugin file and it will add the right robots meta tag to your site..  tweak to taste.</p>
<pre>function askapache_robots_header(){
 global $wpdb;
&nbsp;
 $robot = &#039;&lt;meta name=&quot;robots&quot; content=&quot;noindex,follow,nocache,noarchive&quot; /&gt;&#039;;

 if ( is_paged() || is_search() || is_404() || is_author() || is_tag() )
   $robot = &#039;&lt;meta name=&quot;robots&quot; content=&quot;noindex,follow&quot; /&gt;&#039;;
 elseif ( is_home() || is_front_page() || is_single() )
   $robot = &#039;&lt;meta name=&quot;robots&quot; content=&quot;follow,index&quot; /&gt;&#039;;
 elseif ( is_category() || is_page() )
   $robot = &#039;&lt;meta name=&quot;robots&quot; content=&quot;follow&quot; /&gt;&#039;;
&nbsp;
 echo $robot . &quot;\n&quot;;
}
add_action( &#039;wp_head&#039;, &#039;askapache_robots_header&#039; );</pre>
<hr class="C" />
<h2>Links</h2>
<p>External and Internal Links are the crux of SEO.  It&#8217;s important to start FIRST on your Internal Links and linking structure&#8230; Once you are satisfied that the correct pages are indexed and ranked appropriately, then you can begin to look at external links.</p>
<ul>
<li>The fewer links on a page, generally the better.</li>
<li>If every page of your site points to the same url on your site, pagerank goes up from the number of internal links.</li>
<li>Use of the <code>rel</code>, <code>title</code>, <code>alt</code> attribute semantically is very helpful.  (next, prev, index)</li>
<li>Put your best links higher up in the XHTML, and put helpful/solid links at the end.</li>
<li>You can add <code>rel="nofollow"</code> to links that you dont want followed.</li>
</ul>
<p>The web has gotten to be so full of malicious/non-helpful SEO activity that I recommend developing your content NOT external links.  If you want to do this right and provide great content that makes search engine users happy and makes the web better, then explore this blog and develop content until the next article in this series, where I&#8217;ll show you how to <strong>make your site explode</strong>.</p>
<p class="anote">Stay tuned for Part III, which will dive deeper into the pipeworks of AskApache.com</p>
<p><a href="http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html"></a><a href="http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html">SEO Secrets of AskApache Part 2</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/seo/seo-advanced-pagerank-indexing.html/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SEO Boost from Google 404 Plugin</title>
		<link>http://www.askapache.com/ajax/404-google-wordpress-plugin.html</link>
		<comments>http://www.askapache.com/ajax/404-google-wordpress-plugin.html#comments</comments>
		<pubDate>Tue, 01 Jul 2008 15:11:16 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Making Money]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[404 Not Found]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[AskApache Google 404]]></category>
		<category><![CDATA[errordocument]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[Robot]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.askapache.com/seo/404-google-wordpress-plugin.html</guid>
		<description><![CDATA[<p><a class="IFL hs hs33" href="http://www.askapache.com/google-seo-wordpress-yaHOO-robots" rel="nofollow" title="404 Not Found page using Google Ajax Search API"></a><strong>1 minute Install!</strong><br />Turns every 404 Not Found error into a SEO traffic generating event! Now you have many unique users with unique IP addresses and cookies searching your blog on all of the Google Indexes... <strong>Sweet!</strong><br /><br /><a href="http://www.askapache.com/google-wordpress-plugin-htaccess-robots-php-plugin.html?linux=bsd&#038;g=354" rel="nofollow">&#171;Take My 404 for a Test-Drive</a><br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html#aademo">Demo</a> | <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html#aadl">Download</a> | <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html#aai">Installation</a> | <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html#aaf">FAQ</a> | <a href="http://www.askapache.com/seo/404-google-wordpress-plugin.html#aass">Screenshots / Video</a></p>
<p><strong>AskApache Google 404</strong> is a <strong>must-have</strong> WordPress plugin that uses some ajax and a couple tricks to display a very helpful and SEO Error Page.  The default displays Google Search Results for <strong>images, news, blogs, videos, web, custom search engine, and your own site</strong>.<br class="C" /></p>
<p class="bnote"><strong>Updated:</strong>  01/26/2008<br /><strong>Install Time:</strong>   10 seconds to 5 minutes<br /><strong>Install Difficulty:</strong>   Super Easy</p>
<h2><a id="aademo"></a>Demo 404 Error Page</h2>
<p><a href="http://www.askapache.com/google-seo-wordpress-yaHOO-robots"class="IFL hs hs33"  rel="nofollow" title="404 Not Found page using Google Ajax Search API">Click Image</a><br class="C" /></p>
<p class="anote"><strong>Heads Up:</strong>  I&#8217;ve been thinking about ways to improve this plugin for awhile now, and I&#8217;m going to be releasing an upgrade in the coming weeks!  Any specific feature requests let me know~</p>
<h2><a id="aadl"></a>Downloads</h2>
<div class="dlarea">
<div class="dlin">
<ol>
<li><a href="http://wordpress.org/extend/plugins/askapache-google-404/" rel="nofollow" >askapache-google-404</a></li>
</ol>
</div>
</div>
<h2><a id="aai">404.php Installation</a></h2>
<ol>
<li>Upload <code>zip/tar.gz</code> file to the <code>/wp-content/plugins/</code> directory and unzip.</li>
<li>Activate the plugin through the &#8216;Plugins&#8217; menu in WordPress.</li>
<li>Go to your Options Panel and open the &#8220;AA Google 404&#8243; submenu. <code>/wp-admin/options-general.php?page=askapache-google-404.php</code></li>
<li>Enter in your Google Search API Key and hit the &#8220;Update Key&#8221; Button. <a href="http://code.google.com/apis/ajaxsearch/signup.html" rel="nofollow" >(Get One)</a></li>
<li>Add the code to your 404.php template page by including <code><?php if(function_exists('aa_google_404'))aa_google_404();?></code> in your main content area.</li>
</ol>
<h2><a id="aaf"></a>Frequently Asked Questions</h2>
<p><strong>Do I need a Google Account?</strong></p>
<p>Yes.</p>
<p><strong>Do I need a 404.php template file?</strong></p>
<p>Only if you want to use this for your error page.</p>
<p><strong>My 404.php page isn&#8217;t being served for 404 Not Found errors!?</strong></p>
<p>Add <code>ErrorDocument 404 /index.php?error=404</code> to your .htaccess file.</p>
<p><strong>What is a Google API Key?</strong></p>
<p><a class="IFL" rel="lb" href='http://uploads.askapache.com/2007/09/aa-got-key.png' title='The Google Ajax API Key'><img src='http://uploads.askapache.com/2007/09/aa-got-key.thumbnail.png' alt='The Google Ajax API Key' title="aa got key.thumbnail ajax" /></a><br class="C" /></p>
<p><strong>How do I get a Google API Key?</strong></p>
<p><a class="IFL" rel="lb" href='http://uploads.askapache.com/2007/09/aa-get-key.png' title='Get Google API Key'><img src='http://uploads.askapache.com/2007/09/aa-get-key.thumbnail.png' alt='Get Google API Key' title="aa get key.thumbnail ajax" /></a><br class="C" /></p>
<h2><a id="aass"></a>Google 404 Screenshots</h2>
<p><span id="errorpage404" class="v601"><span class="load">Loading Video&#8230; <a href="http://f.askapache.com/mp4/" rel="nofollow" >[dl]</a></span></span></p>
<p class="IFL"><strong>Plugin Configuration Panel</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-panel-preview1.png' title='AskApache Google 404 WordPress Plugin Configuration Panel'><img src='http://uploads.askapache.com/2007/09/aa-panel-preview1.thumbnail.png' alt='AskApache Google 404 WordPress Plugin Configuration Panel' title="aa panel preview1.thumbnail ajax" /></a></p>
<p class="IFL"><strong>Search Entire Web</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-404-all-web.png' title='Search Entire Web with Google'><img src='http://uploads.askapache.com/2007/09/aa-404-all-web.thumbnail.png' alt='Search Entire Web with Google' title="aa 404 all web.thumbnail ajax" /></a></p>
<p class="IFL"><strong>Search Blogs</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-404-blog-search.png' title='Search Blogs'><img src='http://uploads.askapache.com/2007/09/aa-404-blog-search.thumbnail.png' alt='Search Blogs' title="aa 404 blog search.thumbnail ajax" /></a></p>
<p class="IFL"><strong>Search Custom Search Engines</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-404-google-cse.png' title='Search Custom Search Engines'><img src='http://uploads.askapache.com/2007/09/aa-404-google-cse.thumbnail.png' alt='Search Custom Search Engines' title="aa 404 google cse.thumbnail ajax" /></a></p>
<p class="IFL"><strong>Search Images</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-404-image-search.png' title='Search Images'><img src='http://uploads.askapache.com/2007/09/aa-404-image-search.thumbnail.png' alt='Search Images' title="aa 404 image search.thumbnail ajax" /></a></p>
<p class="IFL"><strong>Search Online Videos</strong><br /><a rel="lb" href='http://uploads.askapache.com/2007/09/aa-404-video-search.png' title='Search Online Videos'><img src='http://uploads.askapache.com/2007/09/aa-404-video-search.thumbnail.png' alt='Search Online Videos' title="aa 404 video search.thumbnail ajax" /></a></p>
<hr />
<h2>More Info from Google</h2>
<ul>
<li><a href="http://code.google.com/apis/ajaxsearch/" rel="nofollow" >AJAX Search API</a></li>
<li><a href="http://code.google.com/apis/ajaxsearch/wizards.html" rel="nofollow" >AJAX Search Wizards</a></li>
<li><a href="http://code.google.com/apis/ajaxsearch/documentation/" rel="nofollow" >Developer Guide</a></li>
<li><a href="http://code.google.com/apis/ajaxsearch/samples.html" rel="nofollow" >Code Samples</a></li>
<li><a href="http://code.google.com/apis/ajaxsearch/community-samples.html" rel="nofollow" >Community Samples</a></li>
<li><a href="http://code.google.com/support/bin/topic.py?topic=10021" rel="nofollow" >Knowledge Base</a></li>
<li><a href="http://googleajaxsearchapi.blogspot.com/" rel="nofollow" >AJAX APIs Blog</a></li>
<li><a href="http://groups.google.com/group/Google-AJAX-Search-API" rel="nofollow" >Developer Forum</a></li>
</ul>
<p><a href="http://www.askapache.com/ajax/404-google-wordpress-plugin.html"></a><a href="http://www.askapache.com/ajax/404-google-wordpress-plugin.html">SEO Boost from Google 404 Plugin</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/ajax/404-google-wordpress-plugin.html/feed/</wfw:commentRss>
		<slash:comments>115</slash:comments>
		</item>
		<item>
		<title>Come On and Sprite for your Website</title>
		<link>http://www.askapache.com/css/background-image.html</link>
		<comments>http://www.askapache.com/css/background-image.html#comments</comments>
		<pubDate>Wed, 16 Jan 2008 04:56:15 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/background-image.html</guid>
		<description><![CDATA[<p><a rel="lb" class="IFL" href='http://static.askapache.com/i/css-sprite.png' title='CSS Sprite, candid shot'><img src='http://uploads.askapache.com/2008/01/css-bg-sprite1.png' alt='CSS Sprite, candid shot' /></a>Let me show you an example that works so well I am using it right now on my site.  Every page in fact.  If you are a young or up and coming web developer with skills to pay the bills, lets make the future Net fast, learn about optimization and refactoring while you still have the chance.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a class="IFL" rel="lb" href='http://uploads.askapache.com/2008/01/css-bg-sprite.png' title='CSS Image Sprite Example'><img src='http://uploads.askapache.com/2008/01/css-bg-sprite.thumbnail.png' alt='CSS Image Sprite Example' title="css bg sprite.thumbnail css" /></a><strong>Notice any familiar images from my website?</strong>  Real special huh?  Hah, maybe.. No, let&#8217;s not be silly, let&#8217;s get to it.  <em>Get ready to save some bandwidth</em></p>
<h2>CSS Sprites- What you say?</h2>
<p>Css sprites sound tough but <strong>they aren&#8217;t</strong>, not here, not in this article.  I want you to make one, I want a faster technorati, I want a faster hypem.com!  Just one.  Now your website visitors only have to download 1 image instead of 3-15!  I do that for you guys and girls, won&#8217;t you return the favor?</p>
<h2>Image Sprite before XHTML</h2>
<ul>
<li>Go to you site and pick out 3-15 images that are on almost every page.</li>
<li>Now create a new image with all of those images side by side, it will make things easier to have each image be at the very top, so they aren&#8217;t on top or above each other.</li>
<li>Then make the background white and save the file.</li>
</ul>
<p><strong>That&#8217;s it! Your own Image Sprite!</strong></p>
<p>Just a couple images pasted together in a photoshop file.  Now that we understand the simplicity of a sprite, lets focus on using one, and making that as easy as possible, none of that tricky CSS stuff that <em>I love</em>.<br class="C" /></p>
<h2>XHTML before CSS</h2>
<p>Ok before you have CSS, you have XHTML.  This is the XHTML that IS my askapache logo at the top left of this screen.  It is conveniently a link to my home page.  All you need to notice from this example is the <code>id="apache"</code>. That is how we can control that particular tag from within CSS.</p>
<pre>&lt;a id=&quot;apache&quot; href=&quot;http://www.askapache.com/&quot; title=&quot;AskApache.com Logo&quot;&gt;&lt;/a&gt;</pre>
<h2>CSS and We&#8217;re spent</h2>
<p><a rel="lb" class="IFL" href='http://static.askapache.com/i/css-sprite.png' title='CSS Sprite, candid shot'><img src='http://uploads.askapache.com/2008/01/css-bg-sprite1.png' alt='CSS Sprite, candid shot' title="css bg sprite1 css" /></a>Whew, that was an exhausting couple minutes right?  Ok did you take a water break?  You ready go?  Lets do it.  Time to pay a little back to our Internet.</p>
<p>This css explains that the background-image to be displayed for the #apache link element is exactly 160&#215;27 pixels and is 81pixes in from the left of the image css-sprite.</p>
<pre>#apache {width:160px; height:27px; background:url(http://static.askapache.com/i/css-sprite.png) -81px 0 no-repeat;
margin:0; padding:0; overflow:hidden;display:block; position:absolute; top:10px; left:10px; }</pre>
<h2>Dancing the Sprite Dance</h2>
<p>Ok so that should get you started, or if that makes you happy enough you are good to go!</p>
<h3>Using CSS Sprites for image elements</h3>
<p>See now why I said it would be easier if you keep your images all aligned at the top?  This way you only have to figure out the distance from the left as well as the actual image dimensions. But as my sprite example shows, you don&#8217;t have to do it the easy way, but just coming this far you&#8217;ve accomplished more than you realize, and  probably gave you an advantage most of your competitors don&#8217;t have.  No doubt.  Congratulations.</p>
<p><strong>But</strong>, what if you are a stickler for semantically ideal coding guru and you don&#8217;t like using background-images on an a element without using an image element?  <em>First, chill :p</em></p>
<p>I experimented a little bit on this awhile ago, and discovered a simple but IMO very elegant solution.  To get it to work, use a 1&#215;1 transparent .gif image and set that as the source of your image, everything else discussed above will then work.</p>
<h3>Caveats</h3>
<p>Not many.  Because you should only use this for your most requested images that are more design elements than something like a photo of your dog.</p>
<ul>
<li>Use the overflow:hidden css to prevent overlapping.</li>
<li>For list elements like li, ul, dt, etc.. follow <a href="http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html">this article</a> and <a href="http://static.askapache.com/i/sprite-icons.png" rel="nofollow" >align the elements vertically</a>.</li>
<li><strong>Dont become a SNOB!</strong></li>
</ul>
<p><a href="http://www.askapache.com/css/background-image.html"></a><a href="http://www.askapache.com/css/background-image.html">Come On and Sprite for your Website</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/background-image.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Cross-Browser Compatibility Tip</title>
		<link>http://www.askapache.com/tools/css-browser-screenshots.html</link>
		<comments>http://www.askapache.com/tools/css-browser-screenshots.html#comments</comments>
		<pubDate>Thu, 13 Dec 2007 08:08:02 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Tools]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[Windows XP]]></category>

		<guid isPermaLink="false">http://www.askapache.com/tools/css-browser-screenshots.html</guid>
		<description><![CDATA[<p><a rel="iz" href="http://www.askapache.com/tools/css-browser-screenshots.html" title="AskApache.com ScreenShot - Epiphany 2.18" class="IZ20W160H429"><img id="iz20" class="IFL" style="width:80px;height:214px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-887edf28651df631d87d1ecc73fc9600.png" alt="Epiphany 2.18" /></a>What I used to do when I was still learning CSS was to check the web page in each of the various problematic browsers to make sure the display stayed the same.  I have several actual machines and several vmware virtual machines running various browers but I decided to skip all that extra time and effort and just use an online tool to do it for me.  The tool views my page in all the various browsers and generates a screenshot image from each browser so that I can see if there are issues with my CSS.</p>]]></description>
			<content:encoded><![CDATA[<p class="IFL" style="width:100px; height:214px;"><a href="http://static.askapache.com/i/screenshots/887edf28651df631d87d1ecc73fc9600.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Epiphany 2.18"><img id="iz1W160H429" class="preview" style="width:80px;height:214px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-887edf28651df631d87d1ecc73fc9600.png" alt="AskApache.com ScreenShot - Epiphany 2.18" title="sm 887edf28651df631d87d1ecc73fc9600 css" /></a><br class="C" /></p>
<p>I&#8217;ve been trying to master <dfn title="Cascading Style Sheets">CSS</dfn> for a number of years, and rely on it heavily for every web design project I am involved in.  An issue that was more important in the past but still huge today is the difference between how the various browser rendering engines and DOM engines process CSS.  Basically, an WHTML Strict <em>(the only way I code)</em> web page can look dramatically different depending on which browser is viewing it.</p>
<p>Just last week I finished up an online <strong>Webinar Registration</strong> form for one of regular clients, and proceeded to send an invitation to register out to hundreds of qualified leads.  I received feedback from a couple of the leads using the registration form that they were having problems seeing the submission button/image to complete the registration.  I instantly realized that the problem could only be occuring because of CSS issues.  These particular leads were using old versions of Apples&#8217; Safari web browser and even a version of Internet Explorer dating from the stone-age.  The problem was how floated elements, cleared elements, and block level vs. inline elements are displayed in those browsers.  The fix was very simple and only took me a minute or 2, but it highlighted that I have become a little to confident in my CSS cross-browser-compatibility skills.</p>
<p>What I used to do when I was still learning CSS was to check the web page in each of the various problematic browsers to make sure the display stayed the same.  I have several actual machines and several vmware virtual machines running various browers but I decided to skip all that extra time and effort and just use an online tool to do it for me.  The tool views my page in all the various browsers and generates a screenshot image from each browser so that I can see if there are issues with my CSS.</p>
<h2><a href="http://browsershots.org/http://www.askapache.com/">Browsershots</a></h2>
<blockquote cite="http://browsershots.com">
<p>Browsershots makes screenshots of your web design in different browsers. It is a free open-source online service created by Johann C. Rocholl. When you submit your web address, it will be added to the job queue. A number of distributed computers will open your website in their browser. Then they will make screenshots and upload them to the central server here. </p>
</blockquote>
<p class="anote">Below are the actual screenshots generated from Browsershots, and so this tool is incredibly helpful in verifying my sites as cross-browser compatible.</p>
<div class="previews">
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/59d75c9ad351625603c4a8b82f39c3b8.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Safari 3.0.3"><img id="iz2W160H339" class="preview" style="width:80px;height:169px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-59d75c9ad351625603c4a8b82f39c3b8.png" alt="AskApache.com ScreenShot - Safari 3.0.3" title="sm 59d75c9ad351625603c4a8b82f39c3b8 css" /></a></p>
<p class="caption" style="padding-top:169px">Safari 3.0.3<br />Windows 2000</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/3dfbd2bac4218bcf63afdf555efbd90a.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Opera 9.24"><img id="iz3W160H339" class="preview" style="width:80px;height:169px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-3dfbd2bac4218bcf63afdf555efbd90a.png" alt="AskApache.com ScreenShot - Opera 9.24" title="sm 3dfbd2bac4218bcf63afdf555efbd90a css" /></a></p>
<p class="caption" style="padding-top:169px">Opera 9.24<br />Windows 2000</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/4d7a045eb9b65a3db5e5468d22e8436f.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Firefox 2.0.0.9"><img id="iz4H160X343" title=" css" alt="CSS Cross Browser Compatibility Tip" /><img id="iz1" class="preview" style="width:80px;height:214px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-887edf28651df631d87d1ecc73fc9600.png" alt="AskApache.com ScreenShot - Epiphany 2.18" title="sm 887edf28651df631d87d1ecc73fc9600 css" /></a></p>
<p class="caption" style="padding-top:171px">Firefox 2.0.0.9<br />Windows 2000</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/fefabdb5e785c8d7d336f02ba44a9e1d.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Konqueror 3.5"><img id="iz5W160H426" class="preview" style="width:80px;height:213px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-fefabdb5e785c8d7d336f02ba44a9e1d.png" alt="AskApache.com ScreenShot - Konqueror 3.5" title="sm fefabdb5e785c8d7d336f02ba44a9e1d css" /></a></p>
<p class="caption" style="padding-top:213px">Konqueror 3.5<br />Ubuntu 6.06</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/90c428064deea40e357008ca993c122b.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Firefox 1.5.0.13"><img id="iz6W160H304" class="preview" style="width:80px;height:152px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-90c428064deea40e357008ca993c122b.png" alt="AskApache.com ScreenShot - Firefox 1.5.0.13" title="sm 90c428064deea40e357008ca993c122b css" /></a></p>
<p class="caption" style="padding-top:152px">Firefox 1.5.0.13<br />Ubuntu 6.06</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/42079ea80adf203a6473677e561ed1ee.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Opera 9.24"><img id="iz7W160H428" class="preview" style="width:80px;height:214px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-42079ea80adf203a6473677e561ed1ee.png" alt="AskApache.com ScreenShot - Opera 9.24" title="sm 42079ea80adf203a6473677e561ed1ee css" /></a></p>
<p class="caption" style="padding-top:214px">Opera 9.24<br />Ubuntu 6.06</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/5207deed2f26b8596b6d39417dc34755.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - MSIE 7.0"><img id="iz8W160H443" class="preview" style="width:80px;height:221px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-5207deed2f26b8596b6d39417dc34755.png" alt="AskApache.com ScreenShot - MSIE 7.0" title="sm 5207deed2f26b8596b6d39417dc34755 css" /></a></p>
<p class="caption" style="padding-top:222px">MSIE 7.0<br />Windows 2003</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/5bfa8b38448de10da470c2934b3999ce.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - MSIE 6.0"><img id="iz9W160H375" class="preview" style="width:80px;height:187px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-5bfa8b38448de10da470c2934b3999ce.png" alt="AskApache.com ScreenShot - MSIE 6.0" title="sm 5bfa8b38448de10da470c2934b3999ce css" /></a></p>
<p class="caption" style="padding-top:188px">MSIE 6.0<br />Windows XP</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/d7e64509891f5083b4dae3f3599027db.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Firefox 1.5"><img id="iz10W160H366" class="preview" style="width:80px;height:183px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-d7e64509891f5083b4dae3f3599027db.png" alt="AskApache.com ScreenShot - Firefox 1.5" title="sm d7e64509891f5083b4dae3f3599027db css" /></a></p>
<p class="caption" style="padding-top:183px">Firefox 1.5<br />Windows XP</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/d9fdd7b4a886acc30391d025c37e28b6.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Opera 9.50"><img id="iz11W160H120" class="preview" style="width:80px;height:60px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-d9fdd7b4a886acc30391d025c37e28b6.png" alt="AskApache.com ScreenShot - Opera 9.50" title="sm d9fdd7b4a886acc30391d025c37e28b6 css" /></a></p>
<p class="caption" style="padding-top:60px">Opera 9.50<br />Ubuntu 7.10</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/75b0e208b5bf12fdc25f2155c6c177f6.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Firefox 2.0.0.11"><img id="iz12W160H182" class="preview" style="width:80px;height:91px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-75b0e208b5bf12fdc25f2155c6c177f6.png" alt="AskApache.com ScreenShot - Firefox 2.0.0.11" title="sm 75b0e208b5bf12fdc25f2155c6c177f6 css" /></a></p>
<p class="caption" style="padding-top:91px">Firefox 2.0.0.11<br />Ubuntu 7.10</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/bf5518c1a5f089de932973bdbafb8eda.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - MSIE 5.5"><img id="iz13W160H369" class="preview" style="width:80px;height:184px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-bf5518c1a5f089de932973bdbafb8eda.png" alt="AskApache.com ScreenShot - MSIE 5.5" title="sm bf5518c1a5f089de932973bdbafb8eda css" /></a></p>
<p class="caption" style="padding-top:185px">MSIE 5.5<br />Windows 2000</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/de5e271fb99eb8151847c7419a5d0b45.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Safari 1.3.2"><img id="iz14W160H459" class="preview" style="width:80px;height:229px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-de5e271fb99eb8151847c7419a5d0b45.png" alt="AskApache.com ScreenShot - Safari 1.3.2" title="sm de5e271fb99eb8151847c7419a5d0b45 css" /></a></p>
<p class="caption" style="padding-top:230px">Safari 1.3.2<br />Mac OS X 10.3</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/35931d6e5f2252b4bf528015e51ce794.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Safari 3.0.4"><img id="iz15W160H476" class="preview" style="width:80px;height:238px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-35931d6e5f2252b4bf528015e51ce794.png" alt="AskApache.com ScreenShot - Safari 3.0.4" title="sm 35931d6e5f2252b4bf528015e51ce794 css" /></a></p>
<p class="caption" style="padding-top:238px">Safari 3.0.4<br />Mac OS X 10.4</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/f399b1c394ce837ba2124ca5568d5c53.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Safari 2.0.4"><img id="iz16W160H477" class="preview" style="width:80px;height:238px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-f399b1c394ce837ba2124ca5568d5c53.png" alt="AskApache.com ScreenShot - Safari 2.0.4" title="sm f399b1c394ce837ba2124ca5568d5c53 css" /></a></p>
<p class="caption" style="padding-top:238px">Safari 2.0.4<br />Mac OS X 10.4</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/2ea619b388a7c223ac759b559729b628.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Firefox 2.0.0.1"><img id="iz17W160H337" class="preview" style="width:80px;height:168px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-2ea619b388a7c223ac759b559729b628.png" alt="AskApache.com ScreenShot - Firefox 2.0.0.1" title="sm 2ea619b388a7c223ac759b559729b628 css" /></a></p>
<p class="caption" style="padding-top:168px">Firefox 2.0.0.1<br />Mac OS X 10.4</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/61e561d14653f8c963ad051f7e7d9011.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - NetFront 3.2"><img id="iz18W160H349" class="preview" style="width:80px;height:174px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-61e561d14653f8c963ad051f7e7d9011.png" alt="AskApache.com ScreenShot - NetFront 3.2" title="sm 61e561d14653f8c963ad051f7e7d9011 css" /></a></p>
<p class="caption" style="padding-top:175px">NetFront 3.2<br />Ubuntu 7.10</p>
</p></div>
<div class="preview" style="width:80px;height:258px;float:left;">
<p><a href="http://static.askapache.com/i/screenshots/887edf28651df631d87d1ecc73fc9600.png" rel="nofollow" rel="iz"  title="AskApache.com ScreenShot - Epiphany 2.18"><img id="iz19W160H429" class="preview" style="width:80px;height:214px;z-index:0" src="http://static.askapache.com/i/screenshots/sm-887edf28651df631d87d1ecc73fc9600.png" alt="AskApache.com ScreenShot - Epiphany 2.18" title="sm 887edf28651df631d87d1ecc73fc9600 css" /></a></p>
<p class="caption" style="padding-top:215px">Epiphany 2.18<br />Ubuntu 7.04</p>
</p></div>
<p>	<br class="C" />
</div>
<p><a href="http://www.askapache.com/tools/css-browser-screenshots.html"></a><a href="http://www.askapache.com/tools/css-browser-screenshots.html">CSS Cross-Browser Compatibility Tip</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/tools/css-browser-screenshots.html/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Best CSS .Classes for CSS Toolbox</title>
		<link>http://www.askapache.com/css/css-class-example.html</link>
		<comments>http://www.askapache.com/css/css-class-example.html#comments</comments>
		<pubDate>Wed, 28 Nov 2007 21:57:41 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[SSI]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/css-class-example.html</guid>
		<description><![CDATA[<p><a class="IFL" href='http://www.askapache.com/css/css-class-example.html' title='CSS Classes Toolbox .class'><img src='http://uploads.askapache.com/2007/10/toolbox-css-office.thumbnail.jpg' alt='CSS Classes Toolbox .class' /></a>CSS is one of the most useful tools I have in my toolbox as a Web Developer.  Having a CSS Toolbox containing good CSS Classes that you repeatedly use is quite helpful for us XHTML / web-standards / best-practices developers.  Check out 10 of my favorite CSS classes.</p>]]></description>
			<content:encoded><![CDATA[<p><img class="IFL" src='http://uploads.askapache.com/2007/10/toolbox-css-office.thumbnail.jpg' alt='CSS Classes Toolbox .class' title="toolbox css office.thumbnail css" />As a Professional Web Developer and Designer, CSS is by far one of the most useful tools I use.  Moving from one web site to the next is made easier by having a CSS Toolbox containing some default CSS Classes that you use over and over again.  Here are 10 of my favorite CSS Classes.<br class="C" /></p>
<p class="anote">What are Your favorite CSS Classes?  Please share your tips!</p>
<h2>Universal CSS .Classes</h2>
<p>Most of these are what I like to think of as &#8220;actionable&#8221; classes, IOW, they aren&#8217;t just color classes or font-size classes.</p>
<ol>
<li><code>.S {display:block; visibility:visible;}</code> &#8211; Shows the element.</li>
<li><code>.H {display:none; visibility:hidden;}</code> &#8211; Hides the element.</li>
<li><code>.VV {visibility:visible;}</code> &#8211; Makes the element visible.</li>
<li><code>.VH {visibility:hidden;}</code> &#8211; Hides an element but still takes up space, not fullly hidden like <code>.H</code></li>
<li><code>.FR {float:right;}</code> &#8211; Floats the element to the right.</li>
<li><code>.FL {float:left;}</code> &#8211; Floats the element to the left.</li>
<li><code>.DI {display:inline;}</code> &#8211; Changes the display type to &#8220;inline&#8221;.</li>
<li><code>.DB {display:block;}</code> &#8211; Makes the element a block-level element.</li>
<li><code>.C {clear:both; padding:0; margin:0; line-height:2em; font-size:10px; border-bottom:1px solid #FFF;}</code> &#8211; Clears floated elements.</li>
<li><code>.CENT {margin:0 auto;}</code> &#8211; Makes block element centred.</li>
</ol>
<p class="anote">Please note that these classes are meant only to show what can be done with CSS, I wrote this post for CSS guru&#8217;s and up and coming gurus.  Sometimes I assume everyone reading my blog know as much as I do about what I&#8217;m writing about, so I skip almost all explanation and skip to the code.  Basically stick to the W3C&#8217;s recommendations and try not to use classes inline unless its for something specific.  Most of these classes are very useful for use in javascript as well using the <code>element.className='S'</code> method.</p>
<h2>Universal CSS Classes Example</h2>
<pre>&lt;br class=&quot;C&quot; /&gt; - clears any block level element.
&lt;hr class=&quot;C VH&quot; /&gt; - Its still a block-level element, so it correctly clears floated elements and is a semantic page separator.
&lt;img class=&quot;FR&quot; src=&quot;/1.gif&quot; alt=&quot;&quot; /&gt; - this image will float to the right.
&lt;p class=&quot;CENT&quot;&gt; - the p is centred (if width isn&#039;t 100%;).</pre>
<p class="enote">Think you are such a CSS/semantics guru that using classes is below you?  <strong>Ridiculous!</strong>  Classes are extremely helpful when used properly and not in excess.  Surely you don&#8217;t think you know more than <a href="http://meyerweb.com/eric/css/" rel="nofollow" >Eric Meyer</a> or the <a href="http://www.w3.org/" rel="nofollow" >W3C</a>&#8230; please view their source code, and try to loosen up while your at it ;)</p>
<p><a href="http://www.askapache.com/css/css-class-example.html"></a><a href="http://www.askapache.com/css/css-class-example.html">Best CSS .Classes for CSS Toolbox</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/css-class-example.html/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Review: Posh CSS</title>
		<link>http://www.askapache.com/css/posh-css.html</link>
		<comments>http://www.askapache.com/css/posh-css.html#comments</comments>
		<pubDate>Wed, 28 Nov 2007 20:41:45 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[Nice]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/posh-css.html</guid>
		<description><![CDATA[<p>PoshCSS.com has links to nice and new CSS Articles.  Don't worry, they aren't snobs. ;)</p>]]></description>
			<content:encoded><![CDATA[<p><a class="IFL" href='http://poshcss.com/' title='Posh CSS is Cascading Style Sheet Articles, Tutorials, Tips and Code for the modern day web designer'><img src='http://uploads.askapache.com/2007/11/posh-css-logo.png' alt='PoshCss.com logo' title="posh css logo css" /></a>PoshCSS.com is a site by Massive Blue that has links to some really nice CSS Articles.  I recommend subscribing to their RSS Feed so you don&#8217;t miss any.</p>
<h2>Posh CSS</h2>
<blockquote><p>Posh CSS is the brainchild of <a href="http://sam.brown.tc/" rel="nofollow" >Sam Brown</a> from <a href="http://www.massiveblue.com/" rel="nofollow" >Massive Blue</a> who was looking for one central place to read about the latest and greatest techniques, tips and tutorials in the Cascading Style Sheet world. None existed and thus, Posh CSS was born.</p></blockquote>
<h3>Posh CSS Articles</h3>
<ul>
<li><a href="http://poshcss.com/2007/11/29/clean-css" rel="nofollow" >Clean CSS optimizer and formatter</a></li>
<li><a href="http://poshcss.com/2007/11/28/coding-efficient-style-sheets" rel="nofollow" >Coding Efficient Style Sheets</a></li>
<li><a href="http://poshcss.com/2007/11/26/the-css-media-types" rel="nofollow" >The CSS media types</a></li>
<li><a href="http://poshcss.com/2007/11/27/css-drop-down-menu" rel="nofollow" >CSS Drop Down Menu</a></li>
<li><a href="http://poshcss.com/2007/11/28/wufoos-free-css-form-designs" rel="nofollow" >Wufoo&#8217;s Free CSS Form Designs</a></li>
<li><a href="http://poshcss.com/2007/11/26/simple-css-blockquotes-and-pullquotes" rel="nofollow" >Simple CSS Blockquotes and Pullquotes</a></li>
<li><a href="http://poshcss.com/2007/11/29/best-css-classes-for-css-toolbox" rel="nofollow" >Best CSS .Classes for CSS Toolbox</a></li>
</ul>
<p><img src='http://uploads.askapache.com/2007/11/posh-css.png' alt='PoshCss.com Screenshot' title="posh css css" /></p>
<p><a href="http://www.askapache.com/css/posh-css.html"></a><a href="http://www.askapache.com/css/posh-css.html">Review: Posh CSS</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/posh-css.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Background Image Sprites</title>
		<link>http://www.askapache.com/css/css-background-image-sprite.html</link>
		<comments>http://www.askapache.com/css/css-background-image-sprite.html#comments</comments>
		<pubDate>Mon, 08 Oct 2007 12:47:34 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Webmaster]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[Image Sprites]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/css-background-image-sprite.html</guid>
		<description><![CDATA[<p class="GIF">Using a <strong>CSS Background Image</strong> Sprite with the CSS <code>background-position</code> and <code>background-image</code> I can display all these icons: <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-3" class="i3"></a> <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-4" class="i4"></a> <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-5" class="i5"></a> <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-6" class="i6"></a>.  <strong>I <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-7" class="i7"></a> can <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-8" class="i8"></a> even</strong> <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-9" class="i9"></a> have <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-10" class="i10"></a> them <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-11" class="i11"></a> show <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-12" class="i12"></a> up <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-13" class="i13"></a> anywhere <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-14" class="i14"></a> on <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-15" class="i15"></a> the <a href="http://www.askapache.com/css/css-background-image-sprite.html#css-sprite-16" class="i16"></a> page!</p>]]></description>
			<content:encoded><![CDATA[<p class="GIF">Using a <strong>CSS Background Image</strong> Sprite with the CSS <code>background-position</code> and <code>background-image</code> I can display all these icons: <a href="#css-sprite-3" rel="nofollow"  name="css-sprite-3" id="css-sprite-3" class="i3"></a> <a href="#css-sprite-4" rel="nofollow"  name="css-sprite-4" id="css-sprite-4" class="i4"></a> <a href="#css-sprite-5" rel="nofollow"  name="css-sprite-5" id="css-sprite-5" class="i5"></a> <a href="#css-sprite-6" rel="nofollow"  name="css-sprite-6" id="css-sprite-6" class="i6"></a>.  <strong>I <a href="#css-sprite-7" rel="nofollow"  name="css-sprite-7" id="css-sprite-7" class="i7"></a> can</strong> <a href="#css-sprite-8" rel="nofollow"  name="css-sprite-8" id="css-sprite-8" class="i8"></a> even <a href="#css-sprite-9" rel="nofollow"  name="css-sprite-9" id="css-sprite-9" class="i9"></a> have <a href="#css-sprite-10" rel="nofollow"  name="css-sprite-10" id="css-sprite-10" class="i10"></a> them <a href="#css-sprite-11" rel="nofollow"  name="css-sprite-11" id="css-sprite-11" class="i11"></a> show <a href="#css-sprite-12" rel="nofollow"  name="css-sprite-12" id="css-sprite-12" class="i12"></a> up <a href="#css-sprite-13" rel="nofollow"  name="css-sprite-13" id="css-sprite-13" class="i13"></a> anywhere <a href="#css-sprite-14" rel="nofollow"  name="css-sprite-14" id="css-sprite-14" class="i14"></a> on <a href="#css-sprite-15" rel="nofollow"  name="css-sprite-15" id="css-sprite-15" class="i15"></a> the <a href="#css-sprite-16" rel="nofollow"  name="css-sprite-16" id="css-sprite-16" class="i16"></a> page!<br class="C" /></p>
<h2>Using CSS Image Sprites</h2>
<p><img src="http://static.askapache.com/i/sprite-ico.png" height="18" width="677" alt="CSS CSS Background Image Sprite Example" title="sprite ico css" />The above image is one that I actually use on this site.  You will see a lot of the images in this sprite by looking around on my page..</p>
<p class="GIF"><strong>Wow!</strong> here are more images&#8230; but remember they are all from the same image.  So instead of your visitors browsers requesting 22 images to display these 22 icons, your browser made a <strong>single request</strong>, saving you bandwidth and speeding up your site for visitors. <a href="#css-sprite-17" rel="nofollow"  name="css-sprite-17" id="css-sprite-17" class="i17"></a>, <a href="#css-sprite-18" rel="nofollow"  name="css-sprite-18" id="css-sprite-18" class="i18"></a>, <a href="#css-sprite-19" rel="nofollow"  name="css-sprite-19" id="css-sprite-19" class="i19"></a>, <a href="#css-sprite-20" rel="nofollow"  name="css-sprite-20" id="css-sprite-20" class="i20"></a>, <a href="#css-sprite-21" rel="nofollow"  name="css-sprite-21" id="css-sprite-21" class="i21"></a>, <a href="#css-sprite-22" rel="nofollow"  name="css-sprite-22" id="css-sprite-22" class="i22"></a>, <a href="#css-sprite-23" rel="nofollow"  name="css-sprite-23" id="css-sprite-23" class="i23"></a></p>
<h2>What Are CSS Sprites</h2>
<p><strong>CSS sprites can majorly reduce the number of HTTP requests</strong> for images referenced by your sites html, javascript, and css files. Images are combined into a single larger image at specific X and Y points. Now you give an html element the background-image of the sprite, and specify the background-position of the image all in the CSS.  You can learn <a href="http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html" title="Speedy Sites use CSS Sprites">how to create CSS Image Sprites in Adobe Photoshop</a>.</p>
<p>A method of using a <em>master image</em> made up of smaller images that are used for presentation within a site, and displaying these images as needed by positioning them via the <em>background-position</em> property</p>
<h2>CSS background-position</h2>
<p><strong>The css background-position</strong> declaration informs the clients browser where to position a background image. The property accepts three kinds of values: keywords, pixels and percentages, values that may be mixed.  When you use only pixels and percentages, the first value denotes the left position, the second one the top position.  <a href="http://www.w3schools.com/css/pr_background-position.asp" rel="nofollow" >Get the backgrond-position specs</a> and practice some example positioning.</p>
<h2>More CSS Sprites Resources</h2>
<h3>CSS Sprite Articles</h3>
<blockquote cite="http://www.fiftyfoureleven.com/weblog/web-development/css/doors-meet-sprites"><p><a href="http://www.fiftyfoureleven.com/weblog/web-development/css/doors-meet-sprites" rel="nofollow" >Sliding Doors Meets CSS Sprites</a><br />
A while back <a href="http://www.stopdesign.com/more/bio/" rel="nofollow" >Douglas Bowman</a> wowed <a href="http://www.alistapart.com/" rel="nofollow" >Alistapart</a> readers with his excellent article <a href="http://www.alistapart.com/articles/slidingdoors/" rel="nofollow" >Sliding Doors of CSS</a>, describing a new and revolutionary way to build a tabbed menu interface using CSS.</p></blockquote>
<blockquote cite="http://www.alistapart.com/articles/sprites"><p><a href="http://www.alistapart.com/articles/sprites" rel="nofollow" >CSS Sprites: Image Slicing&#8217;s Kiss of Death</a><br />
The natural tendency is to assume that a full double-sized image must be heavier than a similar set of sliced images, since the overall image area will usually be larger. All image formats have a certain amount of overhead though (which is why a 1px by 1px white GIF saves to around 50 bytes), and the more slices you have, the more quickly that overhead adds up. Plus, one master image requires only a single color table when using a GIF, but each slice would need its own. Preliminary tests suggest that all this indicates smaller total file sizes for CSS Sprites, or at the very least not appreciably larger sizes</p></blockquote>
<h3>CSS Sprite Image Tools</h3>
<blockquote cite="http://spritegen.website-performance.org/section/tool-help/"><p><a href="http://spritegen.website-performance.org/section/tool-help/" rel="nofollow" >This tool</a> allows you to automate the process of generating CSS sprites. Simply give it a ZIP file containing 2 or more images (GIF, PNG or JPG) and it will generate a sprite image and the corresponding CSS rules to target and display each component image.<br />
Options</p>
<p>The tool has a number of options you can configure to modify characteristics of the generated sprite image and CSS to better match the specifics of your site set up. These options are detailed below:</p></blockquote>
<blockquote cite="http://ajaxian.com/archives/css-sprite-generator-released"><p><a href="http://ajaxian.com/archives/css-sprite-generator-released" rel="nofollow" >CSS Sprite Generator</a><br />
For the uninitiated, a CSS Sprite is a single image file which contains several graphics. Using CSS background positions it&#8217;s possible to display any one of the graphics. By using a sprite you save on multiple http requests which helps speed up the rendering of your page.</p>
<p>The tool allows you to upload a zip of images which the script then concatenates into one image to be used as a CSS Sprite. The CSS offsets for each image are created and output and class-names for each image in the sprite can be generated from the filenames of each of the original images. In fact this approach is recommended.</p></blockquote>
<p><a href="http://www.askapache.com/css/css-background-image-sprite.html"></a><a href="http://www.askapache.com/css/css-background-image-sprite.html">CSS Background Image Sprites</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/css-background-image-sprite.html/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Getting flash to show up in front of content</title>
		<link>http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html</link>
		<comments>http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html#comments</comments>
		<pubDate>Sun, 07 Oct 2007 16:20:29 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[ASP]]></category>
		<category><![CDATA[code snippets]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[Nice]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[SSI]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html</guid>
		<description><![CDATA[<p><img class="IFL" src='http://uploads.askapache.com/2007/12/flashplayer.gif' alt='Adobe Flash Positioning' /><strong>I used to have a problem of controlling flash elements</strong> on my sites..  On one site we have 6 different flash flv movies that are all the same size and are in the same position on the page.  But only 1 is displayed at a time based on what the user wants to watch.  So the selected flash movie needs to have the highest stacking order/zIndex.</p>]]></description>
			<content:encoded><![CDATA[<p><img class="IFL" src='http://uploads.askapache.com/2007/12/flashplayer.gif' alt='Adobe Flash Positioning' title="flashplayer css" /><strong>I used to have a problem of controlling flash elements</strong> on my sites.. specifically I wanted to be able to specify the stacking/zIndex order of the element.  Sometimes I want flash to show up in front of or behind other content.  My company does a ton of video/audio production for tv and radio spots and most of the time we use flash to make them available online.  On one site we have 6 different flash flv movies that are all the same size and are in the same position on the page.  But only 1 is displayed at a time based on what the user wants to watch.  So the selected flash movie needs to have the highest stacking order/zIndex to be the only viewable movie.</p>
<p class="anote">The reason I choose to load all 6 files at a time is so that when a user clicks 1 of 6 buttons to select a video, it INSTANTLY is front and center.. literally milliseconds because all that is happening is moving the video in front of the others.</p>
<h2>Controlling flash to show in foreground or background on command</h2>
<blockquote><p>Basically the &#8220;hover&#8221; buttons I&#8217;ve created using css, are placed under the flash animation clip. I can&#8217;t come up with a good solution. Any ideas??</p></blockquote>
<h2>The Solution is <code>wmode</code> and <code>css</code></h2>
<p>I used to have this problem all the time too! Very frustrating. I figured out that there is a parameter for embedding flash files that change the way the flash is displayed in the DOM..  After looking through a lot of macromedia flash documentation, I learned about flash&#8217;s wmode attribute.</p>
<h3>wmode</h3>
<p>The flash wmode attribute has three different values.</p>
<h3>From the official flash documentation</h3>
<p><strong>wmode attribute/parameter</strong><br />
<strong>Values: </strong> </p>
<ol>
<li><strong>Window</strong></li>
<li><strong>Opaque</strong></li>
<li><strong>Transparent</strong></li>
</ol>
<blockquote><p>The default value is Window if this attribute is omitted. Applies to object only.</p>
<p><strong>Description:</strong><br />
(Optional) Lets you use the <strong>transparent Flash content</strong>, <strong>absolute positioning</strong>, and <strong>layering capabilities</strong> available in Internet Explorer 4.0. </p>
<p><strong>Window</strong> plays the application in its own rectangular window on a web page. Window indicates that the Flash application has no interaction with HTML layers and is always the topmost item.</p>
<p><strong>Opaque</strong> makes the application hide everything behind it on the page.</p>
<p><strong>Transparent</strong> makes the background of the HTML page show through all the transparent portions of the application and can slow animation performance.</p>
<p><strong class="lead">Opaque windowless and Transparent windowless both interact with HTML layers, letting layers above the SWF file block out the application. The difference between the two is that Transparent allows transparency so that HTML layers below the SWF file might show through if a section of the SWF file has transparency; opaque does not.</strong></p></blockquote>
<h3>Using the wmode attribute/parameter</h3>
<p>I like to use 1 of 2 awesome javascript scripts to insert flash into my page, which fixes the microsoft activex problem.</p>
<ol>
<li><a href="http://blog.deconcept.com/swfobject/" rel="nofollow"  title="Javascript Flash Player detection and embed script">SWFObject</a></li>
<li><a href="http://www.bobbyvandersluis.com/ufo/" rel="nofollow"  title="DOM script that detects the Flash plug-in and embeds Flash objects (files with the .swf extension)">Unobtrusive Flash Objects (UFO)</a></li>
</ol>
<h3>Basically to get your site working change:</h3>
<pre>&lt;script type=&quot;text/javascript&quot;&gt;
var so = new SWFObject(&quot;intro.swf&quot;, &quot;flashcontent&quot;, &quot;800&quot;, &quot;290&quot;, &quot;7&quot;, &quot;#ffffff&quot;); so.write(&quot;flashcontent&quot;);
&lt;/script&gt;</pre>
<p>to</p>
<pre>&lt;script type=&quot;text/javascript&quot;&gt;
var so = new SWFObject(&quot;intro.swf&quot;, &quot;flashcontent&quot;, &quot;800&quot;, &quot;290&quot;, &quot;7&quot;, &quot;#ffffff&quot;); so.addParam(&quot;wmode&quot;, &quot;transparent&quot;); so.write(&quot;flashcontent&quot;);
&lt;/script&gt;</pre>
<blockquote>
<p>Nice one askapache! Which browsers does this work in?  If it&#8217;s all of them: you know how to fix a bug even the owners of Flash don&#8217;t. Sadly I expect that to just be IE7 for Windows. Very aggravating for the rest of us :)</p>
</blockquote>
<p>This is a trick that I learned towards the end of 05&#8242; for a site that I was developing.  I&#8217;m obsessed with cross-browser functionality and I got the flash element to disappear behind other content by using the zIndex css attribute with javascript.</p>
<p>I had 5 elements to control, 5 divs that held various content, including flash video.  By apsolutely positioning each of the 5 divs within 1 relative parent div I was able to manipulate the stacking order of the divs by applying a className.</p>
<pre>.z6 {z-index:9119;}
.z0 {z-index:459;}
.z1 {z-index:449;}
.z2 {z-index:439;}
.z3 {z-index:429;}
.z4 {z-index:419;}</pre>
<h2>Applying CSS Classes with JavaScript</h2>
<p>Using an easy javascript example from my <strong>best javascript code snippets 2007 article</strong> its incredibly easy to make this work.  Add an event to each of the buttons that when clicked changes the className of the videos containing element to have the highest z-index.</p>
<p>I created an array of the the 6 video containers using a quick <code>getElementsByTagName</code> and applied the className to all of them at once using a simple foreach loop.</p>
<pre>document.getElementById(&quot;video1div&quot;).className=&#039;z6&#039;;</pre>
<hr class="C" />
<blockquote>
<pre>wmode attribute/parameter
Value:
&lt;strong&gt;Window | Opaque | Transparent&lt;/strong&gt;
&nbsp;
Description:
(Optional) Lets you use the transparent Flash content, absolute positioning, and layering capabilities available in Internet Explorer 4.0. This attribute/parameter works only in Windows with the Flash Player ActiveX control.
&nbsp;
Window plays the application in its own rectangular window on a web page. [B]Window indicates that the Flash application has no interaction with HTML layers and is always the topmost item.
&nbsp;
Opaque makes the application hide everything behind it on the page.
&nbsp;
Transparent makes the background of the HTML page show through all the transparent portions of the application and can slow animation performance.
&nbsp;
Opaque windowless and Transparent windowless both interact with HTML layers, letting layers above the SWF file block out the application. The difference between the two is that Transparent allows transparency so that HTML layers below the SWF file might show through if a section of the SWF file has transparency; opaque does not.
&nbsp;
[B]The default value is Window if this attribute is omitted. Applies to object only.</pre>
</blockquote>
<h2>Flash OBJECT and EMBED tag attributes</h2>
<p>This document lists the <a href="#required" rel="nofollow" >required</a> and <a href="#optional" rel="nofollow" >optional attributes</a> of the <code>object</code> and <code>embed</code> tags used to publish Adobe Flash movies.</p>
<p>For specific usage information for these attributes, refer to sections of the <em>Using Flash</em> manual devoted to using <code>object</code> and <code>embed</code> tags (exact headings vary among Flash versions). Information is also available at <a href="http://www.adobe.com/go/tn_12701/cfusion/knowledgebase/index.cfm?id=tn_4150" rel="nofollow" >Adobe Flash OBJECT and EMBED tag syntax</a>.</p>
<hr />
<h2><a id="required">Required attributes</a></h2>
<p>The following attributes are required within the <code>object</code> and/or <code>embed</code> tags when adding a Flash movie to an HTML page:</p>
<h3>Both <code>object</code> and <code>embed</code></h3>
<dl>
<dt><code>width</code></dt>
<dd>Specifies the width of the movie in either pixels or percentage of browser window.</dd>
<dt><code>height</code></dt>
<dd>Specifies the height of the movie in either pixels or percentage of browser window. </dd>
</dl>
<h3><code>object</code> only</h3>
<dl>
<dt><code>classid</code></dt>
<dd>Identifies the ActiveX control for the browser. <a href="http://www.adobe.com/go/tn_12701/cfusion/knowledgebase/index.cfm?id=tn_4150" rel="nofollow" >See example code for value</a></dd>
<dt><code>codebase</code></dt>
<dd>Identifies the location of the Flash Player ActiveX control so that the browser can automatically download it if it is not already installed.</dd>
<dt><code>movie (param)</code></dt>
<dd>Specifies the location (URL) of the movie to be loaded.</dd>
</dl>
<h3><code>embed</code> tag only:</h3>
<dl>
<dt><code>src</code></dt>
<dd>Specifies the location (URL) of the movie to be loaded.</dd>
<dt><code>pluginspage</code></dt>
<dd>Identifies the location of the Flash Player plug-in so that the user can download it if it is not already installed. EMBED only.</dd>
</dl>
<hr />
<h2><a id="optional">Optional attributes and possible values</a></h2>
<p>The following attributes are optional when defining the <code>object</code> and/or <code>embed</code> tags. For <code>object</code>, all attributes are defined in <code>param</code> tags unless otherwise specified:</p>
<dl>
<dt><code>id</code></dt>
<dd><em>Movie Identifier.</em> Identifies the Flash movie to the host environment (a web browser, for example) so that it can be referenced using a scripting language. (attribute for <code>object</code>, <code>object</code> only)</dd>
<dt><code>name</code></dt>
<dd><em>Movie name.</em> Identifies the Flash movie to the host environment (a web browser, typically) so that it can be referenced using a scripting language such as JavaScript or VBScript. (<code>embed</code> only)</dd>
<dt><code>swliveconnect</code></dt>
<dd>( true / false ) Specifies whether the browser should start Java when loading the Flash Player for the first time. The default value is false if this attribute is omitted. If you use JavaScript and Flash on the same page, Java must be running for the FSCommand to work.</dd>
<dt><code>play</code></dt>
<dd>Specifies whether the movie begins playing immediately on loading in the browser. The default value is true if this attribute is omitted.  ( true / false )</dd>
<dt><code>loop</code></dt>
<dd>( true / false ) Specifies whether the movie repeats indefinitely or stops when it reaches the last frame. The default value is true if this attribute is omitted.</dd>
<dt><code>menu</code></dt>
<dd><code>true</code> displays the full menu, allowing the user a variety of options to enhance or control playback. <code>false</code> displays a menu that contains only the Settings option and the About Flash option.</dd>
<dt><code>quality</code></dt>
<dd>Possible values: <strong>low</strong>, <strong>high</strong>, <strong>autolow</strong>, <strong>autohigh</strong>, <strong>best</strong>.</p>
<ul>
<li><code>low</code>: favors playback speed over appearance and never uses anti-aliasing.</li>
<li><code>autolow</code>: emphasizes speed at first but improves appearance whenever possible. Playback begins with anti-aliasing turned off. If the Flash Player detects that the processor can handle it, anti-aliasing is turned on.</li>
<li><code>autohigh</code>: emphasizes playback speed and appearance equally at first but sacrifices appearance for playback speed if necessary. Playback begins with anti-aliasing turned on. If the actual frame rate drops below the specified frame rate, anti-aliasing is turned off to improve playback speed. Use this setting to emulate the View &gt; Antialias setting in Flash.</li>
<li><code>medium</code>: applies some anti-aliasing and does not smooth bitmaps. It produces a better quality than the Low setting, but lower quality than the High setting.</li>
<li><code>high</code>: favors appearance over playback speed and always applies anti-aliasing. If the movie does not contain animation, bitmaps are smoothed; if the movie has animation, bitmaps are not smoothed.</li>
<li><code>best</code>: provides the best display quality and does not consider playback speed. All output is anti-aliased and all bitmaps are smoothed. </li>
</ul>
</dd>
<dt><code>scale</code></dt>
<dd>Possible values: <strong>showall</strong>, <strong>noborder</strong>, <strong>exactfit</strong>.</p>
<dl>
<dt><code>default</code></dt>
<dd>(Show all) makes the entire movie visible in the specified area without distortion, while maintaining the original aspect ratio of the movie. Borders may appear on two sides of the movie.</dd>
<dt><code>noorder</code></dt>
<dd>scales the movie to fill the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the movie.</dd>
<dt><code>exactfit</code></dt>
<dd>makes the entire movie visible in the specified area without trying to preserve the original aspect ratio. Distortion may occur. </dd>
</dl>
</dd>
<dt><code>align</code></dt>
<dd>Possible values: <strong>l</strong>, <strong>t</strong>, <strong>r</strong>, <strong>b</strong>.  Default centers the movie in the browser window and crops edges if the browser window is smaller than the movie.</p>
<dl>
<dt><code>l</code></dt>
<dd>(left)</dd>
<dt><code>r</code></dt>
<dd>(right)</dd>
<dt><code>t</code></dt>
<dd>(top)</dd>
<dt><code>b</code></dt>
<dd>(bottom) align the movie along the corresponding edge of the browser window and crop the remaining three sides as needed.</dd>
</dl>
</dd>
<dt><code>salign</code></dt>
<dd> Possible values: l, t, r, b, tl, tr, bl, br.</p>
<ul>
<li><code>l</code>, <code>r</code>, <code>t</code>, and <code>b</code> align the movie along the left, right, top or bottom edge, respectively, of the browser window and crop the remaining three sides as needed.</li>
<li><code>tl</code> and <code>tr</code> align the movie to the top left and top right corner, respectively, of the browser window and crop the bottom and remaining right or left side as needed.</li>
<li><code>bl</code> and <code>br</code> align the movie to the bottom left and bottom right corner, respectively, of the browser window and crop the top and remaining right or left side as needed. </li>
</ul>
</dd>
<dt><code>wmode</code></dt>
<dd>Possible values: <strong>window</strong>, <strong>opaque</strong>, <strong>transparent</strong>. Sets the Window Mode property of the Flash movie for <em>transparency, layering, and positioning in the browser.</em></p>
<dl>
<dt><code>window</code></dt>
<dd>movie plays in its own rectangular window on a web page.</dd>
<dt><code>opaque</code></dt>
<dd>the movie hides everything on the page behind it.</dd>
<dt><code>transparent</code></dt>
<dd>the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance. </dd>
</dl>
</dd>
<dt><code>bgcolor</code></dt>
<dd><em>[ hexadecimal RGB value]</em> in the format <em>#RRGGBB</em> . Specifies the background color of the movie. Use this attribute to override the background color setting specified in the Flash file. This attribute does not affect the background color of the HTML page.</dd>
<dt><code>base</code></dt>
<dd>. or <em>[base directory]</em> or <em>[URL]</em>. Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.</dd>
<dt><code>flashvars</code></dt>
<dd> Possible values: <em>variable to pass to Flash Player</em>. Requires Macromedia Flash Player 6 or later. Used to send root level variables to the movie. The format of the string is a set of name=value combinations separated by &#8216;&#038;&#8217;. Browsers will support string sizes of up to 64KB (65535 bytes) in length. For more information on FlashVars, please refer to <a href="http://www.adobe.com/go/tn_12701/cfusion/knowledgebase/index.cfm?id=tn_16417" rel="nofollow" >Using FlashVars to pass variables to a SWF</a>.</dd>
</dl>
<h3>Flash &#8220;scale&#8221; Attribute</h3>
<p><strong>noBorder</strong></p>
<p>The Stage.width and Stage.height values will remain constant and will reflect the values set in the Document Properties dialog box. The &#8220;noBorder&#8221; setting means that the SWF will be scaled, maintaining the original aspect ratio, but there may be some cropping.  The Update Dimensions button is there to keep us honest. The values in the width and height boxes are not automatically updated when the player window is resized, so you must click the button to update the displayed values of Stage.width and Stage.height. If you have resized the player window in &#8220;noScale&#8221; mode before switching to this mode, click the Update Dimensions button to see the width and height revert to the values defined in the Document Properties dialog box.</p>
<p><strong>exactFit</strong></p>
<p>The Stage.width and Stage.height values will remain constant and will reflect the values set in the Document Properties dialog box. The &#8220;exactFit&#8221; setting means that the Flash content will be scaled, without maintaining the original aspect ratio. All of the Flash content will be visible, but some distortion may occur.   The Update Dimensions button is there to keep us honest. The values in the width and height boxes are not automatically updated when the player window is resized, so you must click the button to update the displayed values of Stage.width and Stage.height. If you have resized the player window in &#8220;noScale&#8221; mode before switching to this mode, click the Update Dimensions button to see the width and height revert to the values defined in the Document Properties dialog box.</p>
<p><strong>noScale</strong></p>
<p>The Stage.width and Stage.height values will change as you resize the player window. The &#8220;noScale&#8221; setting means that the SWF will not be scaled when the size of the player window changes. Resize the player window and you&#8217;ll see what I mean.  There&#8217;s no need for an Update button with this setting because this is the only setting for which the onResize message is sent when the player window size changes. In other words, we can add code to the SWF to update the width and height whenever the player window size changes</p>
<p><strong>showAll</strong></p>
<p>The Stage.width and Stage.height values will remain constant and will reflect the values set in the Document Properties dialog box. The &#8220;showAll&#8221; setting means that the all Flash content will be visible and the original aspect ratio will be preserved, but borders may appear on two sides of the application.  The Update Dimensions button is there to keep us honest. The values in the width and height boxes are not automatically updated when the player window is resized, so you must click the button to update the displayed values of Stage.width and Stage.height. If you have resized the player window in &#8220;noScale&#8221; mode before switching to this mode, click the Update Dimensions button to see the width and height revert to the values defined in the Document Properties dialog box.</p>
<p><a href="http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html"></a><a href="http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html">Getting flash to show up in front of content</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/getting-flash-to-show-up-in-front-of-content.html/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PullQuotes using CSS</title>
		<link>http://www.askapache.com/css/pullquotes-using-css-and_or-javascript.html</link>
		<comments>http://www.askapache.com/css/pullquotes-using-css-and_or-javascript.html#comments</comments>
		<pubDate>Sat, 09 Jun 2007 14:06:58 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[Logs]]></category>
		<category><![CDATA[Nice]]></category>
		<category><![CDATA[stat]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.askapache.com.com/css/pullquotes-using-css-and_or-javascript.html</guid>
		<description><![CDATA[<p><a class="IFL" rel="lb" href="http://uploads.askapache.com/2007/07/pullquotes.png" title="CSS, no javascript pullquote not blockquote"><img src="http://uploads.askapache.com/2007/07/pullquotes.thumbnail.png" alt="CSS, no javascript pullquote not blockquote" /></a>I looked at a lot of different ways to display quotes and pullquotes and even though the javascript solutions are very nice, esp. the 456bereastreet.com solution, I decided to just use CSS (Keep It Simple Stupid).<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://uploads.askapache.com/2007/07/pullquotes.png" rel="nofollow" class="IFL" rel="lb"  title="CSS, no javascript pullquote not blockquote"><img src="http://uploads.askapache.com/2007/07/pullquotes.thumbnail.png" alt="CSS, no javascript pullquote not blockquote" title="pullquotes.thumbnail css" /></a>I looked at a lot of different ways to display quotes and pullquotes and even though the javascript solutions are very nice, esp. the 456bereastreet.com solution, I decided to just use CSS (Keep It Simple Stupid).<br class="C" /></p>
<hr />
<h2>Heres what it looks like:</h2>
<p><img src="http://static.askapache.com/i/pullquotes.png" alt="CSS, no javascript pullquote not blockquote" title="pullquotes css" /></p>
<p>I discovered the &#8220;q&#8221; tag and tried it out, once it validated as<br />
<code><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"></code><br />
Yes thats <strong>XHTML 1.0 Strict</strong>.  I also checked it with Firefox 1.0*-2.0* and IE 6.0.2*-the new IE 7.0.  It also renders perfectly in Opera, Mozilla, and Netscape.  Once I learned all that I was completely sold!</p>
<h2>Example XHTML:</h2>
<p><code><br />
<q>I can go to bat for them and make it a win-win-win </q>       </p>
<p><strong>"I put a renewal plan togethe</strong>r last year for one of my clients</p>
<p><q class="q2">our clients are the ones who really reap the greatest benefits!</q></p>
<p><strong>"I have to be sure that I can</strong> get all of the ..sometimes I can go to bat for them and make it a win-win-win etween!"</p>
<p></code></p>
<h2>Example CSS:</h2>
<p><code><br />
q {float:left; width:18em; display:block; margin:0.25em 0.75em 0.25em 1em; padding:0.5em; border:3px double #CCC; border-width:3px 0; color:#333; background-color:#f0f0f0; text-align:center; font:italic 1.3em/1.3 Georgia;}<br />
q.q2 {float:left; width:9em; display:block; margin:0.25em 0.75em 0.25em 1em; padding:0.5em; border:3px double #CCC; border-width:3px 0; color:#333; background-color:#f0f0f0; text-align:center; font:italic 1.3em/1.3 Georgia;}<br />
</code></p>
<h1>Links</h1>
<h2>Pure CSS (no js)</h2>
<ol>
<li><a href="http://natbat.net/code/clientside/css/blockquote.html" rel="nofollow" >Inline BlockQuote Images</a></li>
<li><a href="http://binnyva.blogspot.com/2006/09/sementic-pullquotes.html" rel="nofollow" >Semantic Pullquotes</a></li>
</ol>
<h2>Good Javascript Examples:</h2>
<ol>
<li><a href="http://www.456bereastreet.com/archive/200609/automatic_pullquotes_with_javascript_and_css/" rel="nofollow" >456bereastreet auto pullquotes</a></li>
</ol>
<h2>For WordPress:</h2>
<ol>
<li><a href="http://www.striderweb.com/nerdaphernalia/features/wp-javascript-pull-quotes/" rel="nofollow" >wp-javascript-pull-quotes/</a></li>
</ol>
<p><a href="http://www.askapache.com/css/pullquotes-using-css-and_or-javascript.html"></a><a href="http://www.askapache.com/css/pullquotes-using-css-and_or-javascript.html">PullQuotes using CSS</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/pullquotes-using-css-and_or-javascript.html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Speedier Sites use CSS Sprites</title>
		<link>http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html</link>
		<comments>http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html#comments</comments>
		<pubDate>Fri, 04 May 2007 21:05:16 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[askapache]]></category>
		<category><![CDATA[Bandwidth]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Htaccess]]></category>
		<category><![CDATA[Port]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[SPEED]]></category>
		<category><![CDATA[stat]]></category>

		<guid isPermaLink="false">http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html</guid>
		<description><![CDATA[<p><span class="FL brd" style="display:block; position:relative; width:40px; height:120px; overflow:hidden;"><img src="http://static.askapache.com/i/sprite.png" alt="CSS Image Sprite Example" /></span><strong>An Image Sprite is simply multiple images combined into one image.  Using the <code>background-position</code> in CSS you can display a specific image from the image sprite.</strong><br />
<br />
Sprites reduce the number of files that are requested and downloaded by site visitors, resulting in noticeable decreases in Page-Loading times, Bandwidth usage, and Server loads.<br class="CLS" /></p>]]></description>
			<content:encoded><![CDATA[<p><span class="FL brd" style="display:block; position:relative; width:40px; height:120px; overflow:hidden;"><img src="http://static.askapache.com/i/sprite.png" alt="CSS Image Sprite Example" title="sprite css" /></span><strong>An Image Sprite is simply multiple images combined into one image.  Using the <code>background-position</code> in CSS you can display a specific image from the image sprite.</strong></p>
<p>Sprites reduce the number of files that are requested and downloaded by site visitors, resulting in noticeable decreases in Page-Loading times, Bandwidth usage, and Server loads.<br class="C" /></p>
<h3>1&#215;1 Transparent Gif</h3>
<p>To make everything standards compliants I use a <a href="http://static.askapache.com/i/gif.gif" rel="nofollow" >1x1pixel transparent gif</a> as the src for an <code>img</code> tag, then by specifying a class for the img I can make the background-image and size of the img anything.</p>
<p>Now you can use <code><img src="/transparent.gif" class="spriteImage001" alt="Speedier Sites use CSS Sprites"  title="transparent css" /></code> and it will display an image.  Without using a transparent gif <em>(src=&#8221;" or src=&#8221;#&#8221;)</em> you get weird results in multiple browsers.</p>
<h2>Finding background-position Values</h2>
<p><a rel="lb" href='http://uploads.askapache.com/2007/08/spritehowto.jpg' title='CSS Sprite'><img class="FL brd"  src='http://uploads.askapache.com/2007/08/spritehowto.thumbnail.jpg' alt='CSS Sprite' title="spritehowto.thumbnail css" /></a><strong><br />
I use Adobe Photoshop</strong> to create a master background-layer with a solid bright color, then I change the opacity to 90%.</p>
<p>
<strong>I find the height</strong> and width of an image within the sprite then I measure the distance from the top of the sprite to the top of the image with the sprite.<br class="C" />
</p>
<h2>XHTML Example Markup</h2>
<div class="FL hd">
<h3>PICS class</h3>
<div class="I">
<p><code><img class="PICS pic1" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="PICS pic1 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="PICS pic2" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="PICS pic2 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="PICS pic3" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="PICS pic3 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="PICS pic4" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="PICS pic4 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
</div>
</div>
<div class="FR hd">
<h3>LOGOS class</h3>
<div class="I">
<p><code><img class="LOGOS logo1" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="LOGOS logo1 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="LOGOS logo2" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="LOGOS logo2 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="LOGOS logo3" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="LOGOS logo3 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="LOGOS logo4" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="LOGOS logo4 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
<p><code><img class="LOGOS logo5" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></code><img class="LOGOS logo5 brd" src="http://static.askapache.com/i/gif.gif" alt="Speedier Sites use CSS Sprites"  title="gif css" /></p>
</div>
</div>
<p><br class="C" /></p>
<div class="FL hd">
<h3>UL tag usage</h3>
<pre>&lt;ul class=&quot;ICOS ico1&quot;&gt;
&lt;li&gt;CSS.&lt;/li&gt;
&lt;li&gt;Apache.&lt;/li&gt;
&lt;/ul&gt;</pre>
<div class="I">
<ul class="ICOS ico1">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico2">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico3">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico4">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico5">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico6">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico7">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico8">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico9">
<li>CSS.</li>
<li>Apache.</li>
</ul>
<ul class="ICOS ico10">
<li>CSS.</li>
<li>Apache.</li>
</ul>
</div>
</div>
<div class="FR hd">
<h3>A tag usage</h3>
<div class="I">
<ul style="list-style:none;list-style-type:none;">
<li><a href="#" rel="nofollow"  class="ICOS ico1"><code><a href="#" class="ICOS ico1"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico2"><code><a href="#" class="ICOS ico2"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico3"><code><a href="#" class="ICOS ico3"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico4"><code><a href="#" class="ICOS ico4"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico5"><code><a href="#" class="ICOS ico5"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico6"><code><a href="#" class="ICOS ico6"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico7"><code><a href="#" class="ICOS ico7"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico8"><code><a href="#" class="ICOS ico8"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico9"><code><a href="#" class="ICOS ico9"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico10"><code><a href="#" class="ICOS ico10"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico11"><code><a href="#" class="ICOS ico11"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico12"><code><a href="#" class="ICOS ico12"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico13"><code><a href="#" class="ICOS ico13"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico14"><code><a href="#" class="ICOS ico14"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico15"><code><a href="#" class="ICOS ico15"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico16"><code><a href="#" class="ICOS ico16"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico17"><code><a href="#" class="ICOS ico17"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico18"><code><a href="#" class="ICOS ico18"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico19"><code><a href="#" class="ICOS ico19"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico20"><code><a href="#" class="ICOS ico20"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico21"><code><a href="#" class="ICOS ico21"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico22"><code><a href="#" class="ICOS ico22"></a></code></a></li>
<li><a href="#" rel="nofollow"  class="ICOS ico23"><code><a href="#" class="ICOS ico23"></a></code></a></li>
</ul>
</div>
</div>
<h2>CSS Example</h2>
<pre> .PICS {display:block; background-color:#FFF; background-image:url(http://static.askapache.com/i/sprite-pictures.jpg); background-repeat:no-repeat; overflow:hidden;}
.pic1 {width:147px; height:144px; line-height:144px; background-position:0 0;}
.pic2 {width:172px; height:123px; line-height:123px; background-position:0 -145px;}
.pic3 {width:169px; height:152px; line-height:152px; background-position:0 -270px;}
.pic4 {width:160px; height:145px; line-height:145px; background-position:0 -423px;}
&nbsp;
.LOGOS {display:block; background-color:#FFF; background-image:url(http://static.askapache.com/i/sprite.png); background-repeat:no-repeat; overflow:hidden;}
.logo1 {width:81px; height:72px; line-height:72px; background-position:0 -70px;}
.logo2 {width:194px; height:64px; line-height:64px; background-position:0 -185px;}
.logo3 {width:150px; height:67px; line-height:67px; background-position:0 -250px;}
.logo4 {width:174px; height:52px; line-height:52px; background-position:0 -424px;}
.logo5 {width:98px; height:41px; line-height:41px; background-position:0 -509px;}
&nbsp;
.ICOS {background-color:transparent; background-image:url(http://static.askapache.com/i/sprite-icons.png) !important; background-repeat:no-repeat; padding:1px 0 2px 27px;}
ul.ICOS {background-image:none !important;}
ul.ICOS li {background-color:transparent; background-image:url(http://static.askapache.com/i/sprite-icons.png) !important; background-repeat:no-repeat; padding:0 0 0 27px;}
.ico1 li {background-position:0 0;}
.ico2 li {background-position:0 -70px;}
.ico3 li {background-position:0 -140px;}
.ico4 li {background-position:0 -210px;}
.ico5 li {background-position:0 -280px;}
.ico6 li {background-position:0 -350px;}
.ico7 li {background-position:0 -420px;}
.ico8 li {background-position:0 -490px;}
.ico9 li {background-position:0 -560px;}
.ico10 li {background-position:0 -630px;}
&nbsp;
a.ico1,a.ico1:link,a.ico1:visited,a.ico1:active,a.ico1:hover {background-position:0 0;}
a.ico2,a.ico2:link,a.ico2:visited,a.ico2:active,a.ico2:hover {background-position:0 -70px;}
a.ico3,a.ico3:link,a.ico3:visited,a.ico3:active,a.ico3:hover {background-position:0 -140px;}
a.ico4,a.ico4:link,a.ico4:visited,a.ico4:active,a.ico4:hover {background-position:0 -210px;}
a.ico5,a.ico5:link,a.ico5:visited,a.ico5:active,a.ico5:hover {background-position:0 -280px;}
a.ico6,a.ico6:link,a.ico6:visited,a.ico6:active,a.ico6:hover {background-position:0 -350px;}
a.ico7,a.ico7:link,a.ico7:visited,a.ico7:active,a.ico7:hover {background-position:0 -420px;}
a.ico8,a.ico8:link,a.ico8:visited,a.ico8:active,a.ico8:hover {background-position:0 -490px;}
a.ico9,a.ico9:link,a.ico9:visited,a.ico9:active,a.ico9:hover {background-position:0 -560px;}
a.ico10,a.ico10:link,a.ico10:visited,a.ico10:active,a.ico10:hover {background-position:0 -630px;}
a.ico11,a.ico11:link,a.ico11:visited,a.ico11:active,a.ico11:hover {background-position:0 -700px;}
a.ico12,a.ico12:link,a.ico12:visited,a.ico12:active,a.ico12:hover {background-position:0 -770px;}
a.ico13,a.ico13:link,a.ico13:visited,a.ico13:active,a.ico13:hover {background-position:0 -840px;}
a.ico14,a.ico14:link,a.ico14:visited,a.ico14:active,a.ico14:hover {background-position:0 -910px;}
a.ico15,a.ico15:link,a.ico15:visited,a.ico15:active,a.ico15:hover {background-position:0 -980px;}
a.ico16,a.ico16:link,a.ico16:visited,a.ico16:active,a.ico16:hover {background-position:0 -1050px;}
a.ico17,a.ico17:link,a.ico17:visited,a.ico17:active,a.ico17:hover {background-position:0 -1120px;}
a.ico18,a.ico18:link,a.ico18:visited,a.ico18:active,a.ico18:hover {background-position:0 -1190px;}
a.ico19,a.ico19:link,a.ico19:visited,a.ico19:active,a.ico19:hover {background-position:0 -1260px;}
a.ico20,a.ico20:link,a.ico20:visited,a.ico20:active,a.ico20:hover {background-position:0 -1330px;}
a.ico21,a.ico21:link,a.ico21:visited,a.ico21:active,a.ico21:hover {background-position:0 -1400px;}
a.ico22,a.ico22:link,a.ico22:visited,a.ico22:active,a.ico22:hover {background-position:0 -1470px;}
a.ico23,a.ico23:link,a.ico23:visited,a.ico23:active,a.ico23:hover {background-position:0 -1540px;} </pre>
<h4>Cross-Browser/Standards Friendly</h4>
<p>This technique works in all major browsers, including Firefox, Internet Explorer, Opera, Safari, and Mozilla. </p>
<h4>Hack-free CSS</h4>
<p>Works in all browsers, no hacks or funny stuff needed!</p>
<h2>3 Sprite Images</h2>
<p style="width:80%; margin:0 auto; text-align:center;"><img class="FL brd" src="http://static.askapache.com/i/sprite-icons.png" alt="CSS Image Sprite Example" title="sprite icons css" /><img class="FL brd" src="http://static.askapache.com/i/sprite.png" alt="CSS Image Sprite Example" title="sprite css" /><img class="FL brd" src="http://static.askapache.com/i/sprite-pictures.jpg" alt="CSS Image Sprite Example" title="sprite pictures css" /><br class="C" />
</p>
<h2>Important Speed Tips</h2>
<p>To truly speed up your site, you will want to implement a <a href="http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html" title="Speed Up Sites with htaccess Caching">server-side caching technique</a>.  Or you can read more about <a href="http://www.askapache.com/htaccess/speed-up-sites-with-htaccess-caching.html" title="Caching Overview">caching and web cache</a>.<br />
<a href="http://askapache.info/trunk/caching.html" rel="nofollow"  title="Apache Caching Guide">Apache Caching Guide</a></p>
<p><a href="http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html"></a><a href="http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html">Speedier Sites use CSS Sprites</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/speedy-sites-with-image-sprites-and-css.html/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>12 Lessons for Those Afraid of CSS</title>
		<link>http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html</link>
		<comments>http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html#comments</comments>
		<pubDate>Thu, 09 Nov 2006 12:24:14 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[GET]]></category>
		<category><![CDATA[SSI]]></category>

		<guid isPermaLink="false">http://www.askapache.com.com/css/12-lessons-for-those-afraid-of-css.html</guid>
		<description><![CDATA[<p>full article: <a href="http://alistapart.com/articles/12lessonsCSSandstandards">alistapart.com</a></p>

<ol>
<li>Everything you know is wrong sort of</li>
<li>It's not going to look exactly the same everywhere unless you're willing to face some grief and possibly not even then</li>
<li>You will be forced to choose between the ideal and the practicable</li>
<li>(with thanks to Antoine de Saint-ExupÃ©ry): Perfection is not when there's nothing to add, but when there's nothing to take away</li>
<li>Some sites are steaming heaps of edge cases</li>
<li>Longer lead times</li></ol>]]></description>
			<content:encoded><![CDATA[<p>full article: <a href="http://alistapart.com/articles/12lessonsCSSandstandards" rel="nofollow" >alistapart.com</a></p>
<hr />
<ol>
<li>Everything you know is wrong sort of</li>
<li>It&#8217;s not going to look exactly the same everywhere unless you&#8217;re willing to face some grief and possibly not even then</li>
<li>You will be forced to choose between the ideal and the practicable</li>
<li>(with thanks to Antoine de Saint-ExupÃ©ry): Perfection is not when there&#8217;s nothing to add, but when there&#8217;s nothing to take away</li>
<li>Some sites are steaming heaps of edge cases</li>
<li>Longer lead times are inevitable</li>
<li>Coherent and sensible source order is the best of Good Things</li>
<li>Descendant selectors are the beginning and end of genuinely powerful CSS rules</li>
<li>In the real world, stylesheet hacks will get your project across the finish line</li>
<li>Working around rendering bugs is like playing Whack-a-Mole</li>
<li>When you&#8217;re drowning in CSS layout problems, make sure of the width and height of the water, float without putting up a struggle, and get clear of the problems</li>
<li>Background images will make the difference between the plain and the tastefully embellished</li>
</ol>
<p><a href="http://centricle.com/ref/css/filters/" rel="nofollow" >CSS HACKS</a></p>
<p><a href="http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html"></a><a href="http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html">12 Lessons for Those Afraid of CSS</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/css/12-lessons-for-those-afraid-of-css.html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
