<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent">]>
<rss version="2.0" xml:base="http://randomfoo.net/code" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>random($code) - Redirection</title>
 <link>http://randomfoo.net/code/taxonomy/term/33/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>Weighted Round-Robin Redirection</title>
 <link>http://randomfoo.net/code/node/7</link>
 <description>&lt;p&gt;Here&#039;s a quick and dirty way to do weighted round-robin redirection.  I assign the key rather than the entire array for weighted array creation so it&#039;s not the &lt;em&gt;most&lt;/em&gt; inefficient way to do it ever (a more efficient way is to call &lt;code&gt;rand(1,100)&lt;/code&gt; and then have a big switch, but it&#039;s a PITA to shuffle, especially as you add more sites).&lt;/p&gt;

&lt;p&gt;Anyway, the following example shows 50% of the traffic going to url-3, 37.5% to url-2, and 12.5% to url-1:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://randomfoo.net/code/node/7&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://randomfoo.net/code/node/7#comment</comments>
 <category domain="http://randomfoo.net/code/taxonomy/term/29">Example</category>
 <category domain="http://randomfoo.net/code/taxonomy/term/12">random($foo)</category>
 <category domain="http://randomfoo.net/code/taxonomy/term/33">Redirection</category>
 <category domain="http://randomfoo.net/code/taxonomy/term/5">Public Domain</category>
 <pubDate>Mon, 18 Oct 2004 02:15:40 -0700</pubDate>
 <dc:creator>lhl</dc:creator>
 <guid isPermaLink="false">7 at http://randomfoo.net/code</guid>
</item>
</channel>
</rss>
