We use a CMS, Fuel, built on Codeigniter, and use the redirect function often. I was wondering if there is a way to use probability with this function so that half (or whatever amount we set) the time it redirects to one page and half the time to another.
In general we will create a page with a redirect that looks like this:
<?=redirect('https://subdomian.onanotherserver.com/asdf')?>
We would love to make it looks similar:
<?=probabilityRedirect(0.5, 'https://subdomian.onanotherserver.com/asdf', 'https://subdomian.onanotherserver.com/jkl')?>
What would be the best way to go about this? Can we build off the redirect or just write a new function?
You can just include it inside a rand 50/50 condition,