Forum Discussion
Conditional redirection seeing the url ?
Original plan was to have it as follows abc.xyz.com/stage abc.xyz.com/dev abc.xyz.com/
The web services folks could not create a page with /dev and /stage
when HTTP_REQUEST { Check the requested path with wildcard matching switch -glob [HTTP::path] { "/stage" { /stage URI pool app-stage-pool } "/dev" { /dev URI pool app-dev-pool } default { non-/project URI pool app-prod-pool } }}
now
I want to have a single vip have 3 dns names
abcdev.xyz.com 1.1.1.1 abcstage.xyz.com 1.1.1.1 abc.xyz.com1.1.1.1
when HTTP_REQUEST { Check the requested path with wildcard matching switch -glob [HTTP::uri] { "abcstage" { /stage URI pool app-stage-pool } "abcdev" { modelndev URI pool app-dev-pool } default { non-/project URI pool app-prod-pool } }}
When I try to access the site with dev or stage it still redirects to the default pool. I read some where to change [HTTP::path] to [HTTP::uri]. Is this correct or I need something [HTTP::???]
2 Replies
- Chris_Akker_129Historic F5 Account
Hi Sanjay, you need to switch on the HTTP HOST name, not the URI. The Host is the fqdn, the URI is the path starting with the first forward slash / (after the host.domain.com:port).
Something like:
switch
HTTP::host=abc.xyz.com
Pool prod-pool
HTTP::host=abcdev.xyz.com
Pool dev-pool
HTTP::host=abcstage.xyz.com
Pool stage-poolLooks for examples on "Universal HTTP host redirect" in CodeShare.
-Chris.
- Sanjay_Bhandari
Nimbostratus
Hi Chris,
Thank you for the answer. I tried exactly what you have suggested and it worked just fine.
Sanjay
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