Can you do a split test with .htaccess ?

Status
Not open for further replies.

directresponse

New member
Jul 7, 2007
717
3
0
www.revenuesurge.com
I'm looking to do a split test using an .htaccess file. I'd like to be able to list a few urls in the file, and have the server split the visitors evenly among the different urls.

If you can't do it with .htacess, what would you recommend using? PPC won't work since the site relies completely on direct typeins.

Thanks.
 


I can't imagine how you'd do it with .htaccess, what did you have in mind?

I'd just use a simple counter with a database backend. Each time someone comes, the counter goes up. When the counter is odd, display one thing (or redirect), if the counter is even, display something else.
 
This wasn't what i wanted exactly Kurt, but its working.

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{TIME_SEC} ^[0-1]?[0-9]$
RewriteRule ^(.*)$ http://www1.domain.com/$1 [R,L]

RewriteCond %{TIME_SEC} ^[2-3][0-9]$
RewriteRule ^(.*)$ http://www2.domain.com/$1 [R,L]

RewriteCond %{TIME_SEC} ^[4-5][0-9]$
RewriteRule ^(.*)$ http://www3.domain.com/$1 [R,L]
 
That likely won't disperse the traffic very evenly. It would be much more accurate to use a method similar to what I suggested - but thanks for sharing the code.
 
I mean, given the variable it's using, shouldn't it be a pretty damn even distrubution? Sure the amount visiting the different pages is going to fluctuate a lot, but over a decent time period, it should be steady.
 
So far over a 10 hour period its pretty even. I actually divided it up into 5 second increments so I can test more pages at once.

Also remember, even if its not exactly equal, all you need to know is what page is converting the best given the amount of traffic it receives.

By splitting it up every few seconds, I'd say you're distributing the traffic accurately vs. if you changed your test site ever few days or hours.

It might not be perfect, but I can test up to 60 pages / URLs at once with this method. ( 1 per second)
 
That's pretty neat. I'm thinking of some other uses for it as well. Even setting up a "new idea a second (or minute)" website would be pretty easy.

There is some digg fodder :)
 
So far over a 10 hour period its pretty even. I actually divided it up into 5 second increments so I can test more pages at once.

Also remember, even if its not exactly equal, all you need to know is what page is converting the best given the amount of traffic it receives.

By splitting it up every few seconds, I'd say you're distributing the traffic accurately vs. if you changed your test site ever few days or hours.

It might not be perfect, but I can test up to 60 pages / URLs at once with this method. ( 1 per second)
Well, if it works for you then go for it. But this method is horrible for SEO since your index is getting re-written to several places. You're really doing yourself a disservice by not using a simple counter, switch, and database setup.
 
Hey Kurt,

I definately realize that. Thanks though.

My site in particular automatically redirects to various affiliate programs. The site is getting direct traffic only, so SEO isn't an issue in this particular case.
 
Status
Not open for further replies.