Forum Discussion
SS11
Nimbostratus
Feb 19, 2019Redirect based on host and wildcard URI
The following logic need to implement;
User access link:
http://test.com/eai_enu/start.swe?
Expected:
https://test2iis.com/siebel/app/eai/enu?
if URI contains in the user li...
jaikumar_f5
Noctilucent
Feb 19, 2019Hi SS,
Your way:when HTTP_REQUEST {
set capture_string [getfield [HTTP::uri] "/" 2]]
set 1st_part [getfield $capture_string "_" 1 ]
set 2nd_part [getfield $capture_string "_" 2 ]
if { $2nd_part equals "enu" } {
HTTP::respond 301 Location "https://test2iis.com/siebel/app/$1st_part/$2nd_part?"
}
}
the Other way:
when HTTP_REQUEST {
if { [set redirection_to [class match -value [HTTP::uri] starts_with REDIRECTION_LIST]] ne "" } then
{
HTTP::respond 301 Location "https://test2iis.com$redirection_to?"
}
}
ltm data-group internal REDIRECTION_LIST {
records {
/eai_enu {
data /siebel/app/eai/enu
}
/eaimob_enu {
data /siebel/app/eaimob/enu
}
}
}
type string
}
Edited: equals to starts_with after Andy's post.
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