Category Archives: ab-testing

Change Apache’s document root dynamically – simple A/B testing solution

I want to implement simplest possible split testing (A/B). Currently I have something like this

/public_web
  index.php    # this selects random version and redirects with all GET params 
    /A
      /vendor
      /web/
        /index.php
    /B
      /web/
        /index.php
    /C
      /web/
        /index.php

I want to be able to just copy a directory with all files to create another version for testing.

Currently it's working fine with few exception - the URLs and security.

The document root normally would be /A/web so public url is i.e. www.site.com, but in order to run split tests like I want to, I need to put document root to /public/web so the url of the site is actually www.site.com/A/web ( and /B/web and C/web etc )

So I'm looking for a way to change Apache's document root ( or it can be nginx ) dynamically. Is that possible? Can I write simple script to make choices which folder should be document root for each session?

I have a gut feel that it's not possible because it would need to keep session, but maybe some sort of load balancer software that keeps session can do it?

The A/B script is ultra simple select random version from list of available directories and use it as document root.

I know that there are other ways of running split testing, but I'm just interested if it's possible do it like stated above.

Many thanks

Server side AB testing, using different code version

I have to do A/B testing on multiple sub domains of a big PHP site. Each sub domain is a project in itself, has its own code base with versions. The way AB testing has to work is that when user launches the sub-domain, he should be validated as test user and if success then a different version of the site should be loaded/displayed.

Example the base version of particular sub-domain is v2.0.5 but as test user he should see v3.0.1. When testing is over he should be back to v2.0.5. There should not be any URL change. At anytime there will be multiple tests running on different sub-domains and on same sub-domain too.

How can this be done? Can any command be executed via apache config that can result in picking up different code versions?

Condition: All apache log files should work as they, with solution implemented messages should display in logs files as normal

Server side AB testing, using different code version

I have to do A/B testing on multiple sub domains of a big PHP site. Each sub domain is a project in itself, has its own code base with versions. The way AB testing has to work is that when user launches the sub-domain, he should be validated as test user and if success then a different version of the site should be loaded/displayed.

Example the base version of particular sub-domain is v2.0.5 but as test user he should see v3.0.1. When testing is over he should be back to v2.0.5. There should not be any URL change. At anytime there will be multiple tests running on different sub-domains and on same sub-domain too.

How can this be done? Can any command be executed via apache config that can result in picking up different code versions?

Condition: All apache log files should work as they, with solution implemented messages should display in logs files as normal