Hi, I need to conduct experiments on my website for which I have created four different versions of the website. Now, I have these arranged in four different folders. Now when a request is made for my website I need to serve any one of these four versions randomly so I need help on how to do this. Also, when I'm on one of the versions I need to make sure that the session id is tracked and user stays on the same particular folder. Now, I need to know how to do this at the apache level using rewrite conditions, etc because if I create an index page and then redirect to any of the folders then I change my existing URL structure which confuses the search engine bots and I lose a big chunk of my traffic. So I need to do this in a way that is invisible to the users and search engines (at the apache level). So, could anyone help me in this respect. I would be very grateful.
You could also use PHP to randomly include one version of the page. What is your current website looking like? (in term of organization folder/extension) If it's not currently in .php, You could create a rewrite for .html to .php for example. But I'd suggest you actually do a 301 redirect (which search engines should take as the new urls for the old documents) rewrite rule to a new extension-less format of urls (which is more practical when switching format). Then you could make all urls with another rewrite use the same file (I use .php files personally). You can then use this script file to load various content in the same template (like I do) AND add extra part which will load a design and different text versions at random and display them.
Thanks, but could a solution be possible in which apache serves a page from the one of the folders randomly because I already have the folders corresponding to the versions ready. So if I know how to modify apache config files in this respect my website would be up and running in no time.
You can't randomize with apache. You'll need a script for this. That wouldn't be hard to do actually. An array of names, a random function and poof, it loads a particular design and place a cookie to remember to use the same design on next page instead of random.