Forum Discussion
Leslie_South_55
Nimbostratus
Nov 18, 2006Logging with HTTP::redirect
I have a simple working iRule to redirect based on URI = /, send to http://yada.com/1/2/3
My issue is with the logging (I know...it's working and going where I want it to but I need to be able to ...
Nov 19, 2006
A HTTP::redirect doesn't affect any of the current variables (HTTP::host or HTTP::uri), it just sends a HTTP redirect reply to the browser. By using these variables in your log statement, you will be accessing the values of the current original request (which isn't what you want). Why don't you just hard code the whole value in the log.
when HTTP_REQUEST {
log local0. "Uri is [HTTP::uri]"
if { [HTTP::uri] equals "/" } {
log local0. "redirecting to http://www.yada.com/1/2/3/"
HTTP::redirect "http://www.yada.com/1/2/3/"
}
}
-Joe
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
