Forum Discussion
Nams_119859
Nimbostratus
Apr 11, 2013url check starts_with number to avoid looping
Hello, Below is my iRule that redirects an incoming url to a versioned url, by using the verison number in the header. In order to avoid infinite looping I am looking for a way to check "uri...
Kevin_Stewart
Employee
Apr 12, 2013The not operator is definitely supported in 9.x and above - it's a native construct of the TCL language.
I'd try something like this instead:
when HTTP_REQUEST {
if { ( [HTTP::header exists Version] ) and not ( [HTTP::uri] starts_with "/[HTTP::header Version]" ) } {
HTTP::respond 302 Location "http://[HTTP::host]/[HTTP::header Version][HTTP::uri]"
}
}
Your if conditional should start with the exists clause before trying to look for its value.
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