Forum Discussion
trx_94323
Nimbostratus
Feb 05, 2013Are global variables shared between all HTTP requests?
Hello Community,
Does each http request have it's own global variable or do they share one global variable?
Example)
HTTP Request 1 comes in and set's a global variable to "ABC"
HTTP Request 2 comes in and set's the global variable to "ZAC" before HTTP Request 1 finishes.
Is HTTP Request 1 global variable still "ABC" or is it "ZAC"?
Hope this make sense.
Thanks in advance.
Regards,
TRX
4 Replies
- hoolio
Cirrostratus
Hi Joe, - Joe_Pipitone
Nimbostratus
The problem with combining all of the redirect statements into the switch is - see my comment towards the bottom of the script - another subdomain rewrite. If I combine this one with the others above, the redirect only half works. It rewrites the url but does not pass along the uri query string as part of the full url. Unless I use the http::path, it won't work. - Joe_Pipitone
Nimbostratus
Can anyone help with syntax of exiting the HTTP_REQUEST? Or point me in the right direction as far as where to find big-ip docs for this syntax? - hoolio
Cirrostratus
Hi Joe,switch -glob [string tolower [HTTP::uri]] { ...other checks... "/info.aspx" - "/info.aspx\?*" { HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]" } }
if {[HTTP::uri] starts_with "/admin" } { HTTP::redirect "http://legacy.domain.com[HTTP::uri]" } elseif {[string tolower [HTTP::host]] eq "www.domain.com"}{ HTTP::redirect "http://domain.com[HTTP::uri]" }
- Joe_Pipitone
Nimbostratus
For example, this code below will not carry over the query if i change HTTP::path to HTTP::uri. It simply rewrites to default.aspx with no query appended.switch [string tolower [HTTP::path]] { "/info.aspx" { HTTP::redirect "http://subdomain.ourdomain.com/default.aspx?[HTTP::query]" } }
- Joe_Pipitone
Nimbostratus
Wow - your trickery works like a charm - thank you very very very much for the help, I can finally put this to bed!
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