Forum Discussion
tikshoret
Nimbostratus
Feb 18, 2015redircert traffic to a specific resource using HTTP:HEADER
Hi all,
maybe you can help me save lots of time
in APM version 11.3.0 i need to redirect traffic to a webtop resource base on HTTP Header.
i mean that after the user authenticate i need to check if t...
Michael_Jenkins
Cirrostratus
Feb 18, 2015You should be able to do this with an iRule. This is similar to what we've done.
when HTTP_REQUEST {
if { [ACCESS::policy result] equals "allow" } {
if { [HTTP::header exists "HEADER_NAME_1"] } {
Use ([HTTP::header value "HEADER_NAME_2"] equals "WHAT_YOU'RE_LOOKING_FOR") if you need to check value instead of existence
This will send a redirect to the user to go to the webtop page. You'll just need to specify the webtop name in the URL
HTTP::respond 302 Location "/vdesk/webtop.eui?webtop=/Common/WEBTOP_NAME_1&webtop_type=webtop_full"
return
} elseif { [HTTP::header exists "HEADER_NAME_2"] } {
Use ([HTTP::header value "HEADER_NAME_2"] equals "WHAT_YOU'RE_LOOKING_FOR") if you need to check value instead of existence
This will send a redirect to the user to go to the webtop page. You'll just need to specify the webtop name in the URL
HTTP::respond 302 Location "/vdesk/webtop.eui?webtop=/Common/WEBTOP_NAME_2&webtop_type=webtop_full"
return
}
}
}
This will work if the client is already logged in and submits new http request. However, if you're trying to grab the header for right after they authenticate, that's a little more complicated. If you need help with that instead, let me know and I'll help with something a little more robust.
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