Forum Discussion
greg_chew_11034
Nimbostratus
Sep 01, 2005http::redirect and http::close and not closing the session.
Hey all.
I am trying to do a redirect to www.foo.com/test.
HTTP/1.0 302 Found
Location: http://www.foo.com/browse/home.html
Server: BIG-IP
Connection: Keep-Alive
...
greg_chew_11034
Nimbostratus
Sep 01, 2005rule foo_uris_rule_v2 {
when HTTP_REQUEST {
set host [string tolower [getfield [HTTP::host] ":" 1]]
set uri [string tolower [HTTP::uri]]
set matchstring [substr [substr $uri 1 "?"] 0 "/" ]
if { $matchstring == "" }
{
set matchstring $host$uri
}
else
{
set matchstring $host/$matchstring
}
set redstring [findclass $matchstring $::foo_uris_list " " ]
set query_src [findstr [HTTP::uri] "?src=" 5 "&" ]
if {$query_src == ""}
{
set query_src [findstr [HTTP::uri] "&src=" 5 "&" ]
}
log local0. "query_src = $query_src"
set query_trk_src [findstr [HTTP::uri] "trk_src=" 8 " " ]
log local0. "query_trk_src = $query_trk_src"
if { $query_src != "" }
{
set redstring $redstring&src=$query_src
}
if { $query_trk_src != "" }
{
set redstring $redstring&trk_src=$query_trk_src
}
if {$redstring eq ""}
{
if { $host != "www.foo.com" and $host != "foo.com"}
{
set element [findclass "foo.com/" $::foo_uris_list " " ]
log local0. "Defaulting subdomain to foo.com"
}
}
if {$redstring != ""} {
log local0. "redirecting to $redstring"
HTTP::close
HTTP::redirect $redstring
HTTP::close
event disable all
}
}
}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
