Forum Discussion
abachman_72712
Nimbostratus
Aug 12, 2009Redirect to URL
Attempting to script an iRule a redirect statement for a URL, but I cannot get the iRule statement to take. We would like users to type in the browser http://testsite, and have them redirected to ht...
abachman_72712
Nimbostratus
Aug 12, 2009The last few lines of the previous iRule were removed, and should not have been there. Here is the real syntax of the iRule being applied.
when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } {
persist add uie [HTTP::cookie "JSESSIONID"]
set add_persist 0
}
}
when HTTP_REQUEST {
if { [TCP::local_port] == 80 }{
HTTP::redirect http://testsite/test/sitedoc.do
}
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"]
} else {
set jsess [findstr [HTTP::uri] "jsessionid" 11 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}
{
}
}
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
