Forum Moderators: phranque
If even IP addresses can be redirected to one page and odd IP addresses redirected to the other, it solves things pretty nicely without using any tracking information. Unless someone uses a different computer, they'll always see the same page as the first time.
Can mod_rewrite accomplish this? What would the statements be?
Thanks in advance!
So, I'd recommend that you base the selection on the third, not the fourth, octet of the IP address.
See Apache mod_rewrite:
# Extract final digit of third Remote_Addr octet
RewriteCond %{REMOTE_ADDR} ^([0-9]+\.){2}[0-9]*([0-9])\.[0-9]+$
# IF final digit is odd
RewriteCond %2 ^[13579]$
# Then rewrite page.html to page-B.html
RewriteRule ^page\.html$ /page-B.html [L]
# ELSE rewrite page.html to page-A.html
RewriteRule ^page\.html$ /page-A.html [L]
Jim