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