Forum Discussion
s3s1277_111291
Nimbostratus
Apr 02, 2012question on iRule
I've created a simple iRule to match a string in URI, and redirect to different URL. But it is appending extra '/' after the hostname in the URL. Any idea why?
Here is the rule:
...
Michael_Yates
Nimbostratus
Apr 02, 2012Hi s3s1277,
If you want to see what Sashi is talking about add the following to your iRule. You are adding in the "/" in some part of the iRule that is deplayed. The [HTTP::uri] value starts with and includes the "/" (see the log example below).
Apr 2 15:31:32 local/tmm1 info tmm1[4831]: Rule Z.iRule.Development : Matched and redireting to http://xxxxxx/string1234
Apr 2 15:31:32 local/tmm1 info tmm1[4831]: Rule Z.iRule.Development : HTTP::host Value: website.com
Apr 2 15:31:32 local/tmm1 info tmm1[4831]: Rule Z.iRule.Development : HTTP::uri Value: /string1234
when HTTP_REQUEST {
if { [HTTP::uri] contains "/string1234" } {
log local0. "Matched and redireting to http://xxxxxx[HTTP::uri]"
log local0. "HTTP::host Value: [HTTP::host]"
log local0. "HTTP::uri Value: [HTTP::uri]"
HTTP::redirect "http://xxxxxx[HTTP::uri]"
}
}
Hope this helps.
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
