Forum Discussion
URL/URI Rewrite
Hello,
I'm trying to create an iRule to shape traffic to different servers in the web farm. For an example:
www.abc.com
if "www.abc.com/1"
then goes to first pool member. "www.abc.com/2"
then goes to second pool member.
The second scenario I need is:
if "www.abc.com" then rewrites to "www.abc.com/test" ---> server pool A if "www.abc.com/test1" then ---> server pool B if "www.abc.com/test2" then ---> server pool C
Thanks!
3 Replies
- Kevin_Davies_40
Nacreous
when HTTP_REQUEST { switch [HTTP::uri] { "/test1" { pool A } "/test2" { pool B } "/test3" { pool C } } } - nitass
Employee
if "www.abc.com/1" then goes to first pool member.
"www.abc.com/2" then goes to second pool member.you can use HTTP::uri command to check uri (e.g. /1, /2) and then send traffic to specific pool member using node or pool (pool ... member ...) command.
HTTP::uri
https://devcentral.f5.com/wiki/irules.http__uri.ashxnode
https://devcentral.f5.com/wiki/iRules.node.ashxpool
https://devcentral.f5.com/wiki/iRules.pool.ashxif "www.abc.com" then rewrites to "www.abc.com/test" ---> server pool A
if "www.abc.com/test1" then ---> server pool B
if "www.abc.com/test2" then ---> server pool CHTTP::uri command is also used to rewrite uri (e.g. / to /test).
- cjbarr1234
Altostratus
Thanks everyone. THis has been very helpful and the resolution is complete.
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