Forum Discussion
dan_6764
Nimbostratus
Jan 13, 2009HTTP redirect maintaining original URL
Hi,
I have a simple irule that works fine for what I need. A request comes in (say to www.mypage.co.uk), if the LB pool has no active nodes the client request is redirected to a " sorry" page....
hoolio
Cirrostratus
Jan 13, 2009If you want to redirect to the host or URI that the client made a request to, you'd need to save the host or URI in HTTP_REQUEST for every request and then reference it in LB_FAILED:
when HTTP_REQUEST {
Save the host header value
set host [HTTP::host]
Save the URI (not sure you want to do anything with the URI though)
set uri [HTTP::uri]
}
when LB_FAILED {
Send 302 redirect with the host header value from the request
HTTP::respond 302 Location "http://$host/sorry/"
}
Aaron
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
