Forum Discussion
mb_shankr_22532
Oct 04, 2015Nimbostratus
need help to create an irule to append an uri and redirect with conditions...
Hi all, need ur help pls. I have an URL: abc.test.com, pointing to http vip with mapped pool-1111. I also have another pool-2222 created with same members but different ports. pool-2222 is not mapped...
Hannes_Rapp
Oct 05, 2015Nimbostratus
Hello,
If you issue a command
curl -I PoolMemberIP:PoolMemberPort/test2
from F5, you will see that the 404 error comes from the Pool Member as the page /test2 was not found. Try the same with /test1 page, and you will see the difference. Therefore, the HTTP 404 error you're mentioning is not related to F5 or this iRule. Make sure the related pages exist in the backend servers (your pool members).
Now in regards to making the iRule slimmer. We can use the user-entered HTTP path as our only conditional trigger since "abc.test.com" is your only host serviced from this particular Virtual Server.
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/" {
HTTP::path "/test1"
pool pool-1111
}
"/test1" -
"/test1/" {
pool pool-1111
}
"/test2" -
"/test2/" {
pool pool-2222
} default {
pool MyDefaultPool
}
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects