title: A/B Testing with apache and mod_rewrite
body: <p>Tried searching for this but my google-fu is lacking today. </p>
  
  <p>So I have 2 versions of site, in </p>
  
  <pre><code>/var/www/vhosts/testa.mydomain.com/httpdocs and 
  /var/www/vhosts/testb.mydomain.com/httpdocs
  </code></pre>
  
  <p>where each documentroot is pretty much a complete site overhaul, and I want to do A/B (multivariate) testing to see which site performs better. </p>
  
  <p>Googling last week I saw suggestions on doing this time based (even &amp; odd seconds), but because the site is a basket site (or perhaps even a basket-case!), I don't want to flit between 2 different processing scenarios mid-transaction. </p>
  
  <p>So I thought it would be good to serve from testa if client ip address last octet was even, and from testb if last octet was odd. We could then at least gain some metrics on how many people abandoned the basket as too unwieldy in different versions of the site. </p>
  
  <p>I'm pretty sure that a bunch of RewriteCond lines based on %{REMOTE_ADDR} will do it, but I'm pretty hopless at mod_rewrite.</p>
  
  <p>users would visit test.mydomain.com, and be should served from one or the other DocumentRoot's evenly, not seeing testa or testb in their url, but we could log each variant's performance.</p>
  
  <p>Any kindly guru's able to advise ? </p>
  
  <p>TIA
  David</p>
  
  <p>Update: I can set up testa.mydomain and testb.mydomain as subdomains via virtual hosts if that would help any.</p>