Forum Discussion
Nams_119859
Nimbostratus
13 years agourl 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
13 years agoThe 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.
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