Forum Discussion
dexter_22020
Nimbostratus
Apr 09, 2009url rewrite with class
Hi,
Newbie on irules here, need help.
class file contains:
/test http://domain.com/main.html
/foo http://domain.com/foo.html
...
... ...
Colin_Walker_12
Apr 13, 2009Historic F5 Account
You don't need the starts_with operator inside findclass to make this work. Just populate the class like this:
test /main.html
foo /foo.html
Then in your iRule grab the first portion of the URI before doing the comparison.
So something like:
when HTTP_REQUEST {
Grab the portion of the URI after the first / and before the second /
set part [getfield [string tolower [HTTP::uri]] "/" 2]
set newURI [findclass $part $::yourClass " "]
if { $newURI ne "" } {
HTTP::uri $newURI
}
}
Colin
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
