Forum Discussion
Updating iRule doesn't reflect immediately?
Hi,
I am new to F5 and iRules world and I was trying some very basic iRule (copied below) that should redirect traffic to some website.
when HTTP_REQUEST {
if {([string tolower [HTTP::host]] equals "myservice.api.abcd.com")} {
HTTP::redirect "https://google.com"
}
}
I am glad this worked but now when I try an example like below or even if I comment out the redirect with , it still redirects :(
when HTTP_REQUEST {
if {([string tolower [HTTP::host]] equals "myservice.api.abcd.com")} {
HTTP::respond 200 content "
<html><head>
<style type=\"text/css\">
a { text-decoration:none }
a:visited { text-decoration:none; }
a:active { text-decoration:none; }
a:hover { text-decoration:none; }
</style>
</head>
<body link=\"blue\" alink=\"blue\" vlink=\"blue\">
<body>
<H2>helloz</H2>
</body></html>
"
}
}
Does it take a while to actually reflect these changes or come in effect or am I doing something wrong? Please help.
Thank you.
5 Replies
- dd007_132137
Nimbostratus
I am sorry for the formatting of this post that seems messed up. It looked ok with the preview while typing it out though. - JRahm
Admin
only new connections will see the changed iRule. If you have an existing browser window, close it (all iterations) and restart and you should see the change.
- Michael_Yates
Nimbostratus
Hi dd007,
When a client establishes a connect to a Virtual Server a "copy" of the currently applied iRules are tied to the clients connection. Once you disconnect that connection and establish a new connection you should see the changes.
There is another thread that adds additional detail here:
Hope this helps.
- dd007_132137
Nimbostratus
Great. Thanks a lot for such prompt replies.
- Scott, I think I already updated the formatting. Looks like you combined the two code blocks into one. Oh well...
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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