Forum Discussion
Routing Traffic to Old/New Site using a Cookie
Hi All
I am looking for some advice, we are looking at commision a new site (both sites traffic is served via the F5s). Traffic to the old site will still needs to be servered intially based on small ratio (we are going to use the F5 GTM to handle this) and returning visitors who see the new site should only see the new site once visited.
I was thinking the best way to handle this would be to insert a specific cookie for the new site with an cookie expiry and then look for the cookie on returning visits.
I have the irule below which I put together from examples I have found on the dev forum to check for the cookie and route to the pool hosting the new site:
when HTTP_REQUEST { log local0. "Cookie: [HTTP::cookie value "TESTCOOKIE"]" Try to select a pool based on the http cookie containing pool information if { [HTTP::cookie value "TESTCOOKIE"] ne "" }{ switch [HTTP::cookie value "TESTCOOKIE"] { "2" { pool NEW-WEBSITE log local0. "NEW-WEBSITE" } default { pool OLD-WEBSITE log local0. "OLD-WEBSITE" } } }
Any feedback or advice would be appreciated.
Thanks
2 Replies
- Arnaud_Lemaire
Employee
sounds good exept a missing curly brace at the end :)
- Annsar_Akhtar
Nimbostratus
Thanks for feedback, copy and paste error from me :)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com