Forum Discussion
Akber_157730
Nimbostratus
May 27, 2014http redirect using iRule
Hello Guys,
This is my first query on iRule :)
**_My Requirement is : when some body access the http://abc.com/test/test.htm is should get redirected to new server & new URL which is http...
Kevin_Stewart
Employee
May 27, 2014Your iRule looks correct.
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::uri]] starts_with Test-Redirect] } {
pool [class match -value [string tolower [HTTP::uri]] starts_with Test-Redirect]
} else {
pool abc-pool
}
}
** not sure if the space between "Test-" and "Redirect" was intentional, but there cannot be a space in the name. Otherwise, if it's as simple as a single URI check, you could probably skip the data group lookup.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/test" } {
pool pqr-pool
} else {
pool abc-pool
}
}
I'd also recommend applying a OneConnect profile here.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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