Tried searching for this but my google-fu is lacking today.
So I have 2 versions of site, in
/var/www/vhosts/testa.mydomain.com/httpdocs and
/var/www/vhosts/testb.mydomain.com/httpdocs
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.
Googling last week I saw suggestions on doing this time based (even & 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.
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.
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.
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.
Any kindly guru's able to advise ?
TIA David
Update: I can set up testa.mydomain and testb.mydomain as subdomains via virtual hosts if that would help any.
Option 1 (Redirects) add one of these to both domains
Place on even number site (testb.mydomain.com)
RewriteEngine On
RewriteCond %{REMOTE_ADDR} [13579]$
RewriteRule .* http://testa.mydomain.com/$1 [R=301,L]
Place on odd number site (testa.mydomain.com)
RewriteEngine On
RewriteCond %{REMOTE_ADDR} [02468]$
RewriteRule .* http://testb.mydomain.com/$1 [R=301,L]
Option 2 (subfolders NOT subdomains)
RewriteEngine On
#direct to EVEN SITE
RewriteCond %{REMOTE_ADDR} [02468]$
RewriteRule (.*) /testa.mydomain.com/$1 [L]
#direct to ODD SITE
RewriteCond %{REMOTE_ADDR} [13579]$
RewriteRule (.*) /testb.mydomain.com/$1 [L]