Forum Discussion
Jon_46044
Nimbostratus
Oct 02, 2007Simple iRule Help (Header strip and insert)
We're attempting to utilize a current software hack load balance for our company website (I'm well aware a set of LTMs can Loadbalance, but for current management issues, we have to leave the site as it is...)
Currently, a user logs in and based on the division of the site they're logging into, they get directed to a specific server... such as...
base site, www.x.com, log in, redirect to www29.x.com.
We want to strip the www29 from the URL using an irule, but notate the server number in the header/cookie, to keep persistance to that server for the users (session info is cached on a server basis, not site basis).
This is the error message we're getting currently:
01070151:3: Rule [Server_Hash] error: line 1: [wrong args] [when HTTP_RESPONSE{] line 4: [command is not valid in the current scope] [regexp.com} [HTTP::host] domain server] line 4: [command is not valid in the current scope] [HTTP::host] line 7: [command is not valid in the current scope] [persist hash $server] line 10: [command is not valid in the current scope] [HTTP::redirect http://www.studyisland.com/[HTTP::uri]] line 10:
[command is not valid in the current scope] [HTTP::uri] line 11: [command is not valid in the current scope] [}]
Our iRule:
when HTTP_RESPONSE{
get HTTP information
regexp {\.[\w]+)\.com} [HTTP::host] domain server
set persistance
persist hash $server
redirect client
HTTP::redirect "http://www.x.com/[HTTP::uri]"
}
Anyone have a suggestion as to what we're doing wrong here?
Thanks!
- Patrick_Chang_7Historic F5 AccountI think you need a space between the HTTP_RESPONSE and the {.
- Jon_46044
Nimbostratus
That space did fix the main error, but obviously, we're still confused as to how to write the iRule... thoughts?
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