I want to create two IIS rewrite rules, such that rule A will run on 50% of the requests, and B on the other 50%. There is no builtin random property in the IIS rewrite module AFAIK. I want to achieve it without developing my own rewrite module extension.
I prefer the random to be as "true" as possible (as far as pseudo-random algorithms can be random of course).
I thought about two possibilities:
- Get the current timestamp and use the parity of the timestamp. Is there such server variable available? I didn't find it.
- Use the parity of the last part of the client IP (REMOTE_ADDR).
Are one of these options feasible? How can I implement them with rewrite rules? Is there a better solution?