Forum Discussion
irule for the redirection
We configured BIG-IP LTM with webcenter below is the virtual
server for the same.
Aeadebab
When I type aeadebab it should append uri /webcenter or /console and
open the desired login page.
Below is the iRule we created for the same but it is not working.
when HTTP_REQUEST
if {[HTTP::host] equals
"aeadebab"} {
{[HTTP::uri] "/webcenter" }
}
}
Please through some light on this.
Thanks,
Rajendra.
5 Replies
- The_Bhattman
Nimbostratus
Hi Rajendra,
What about trying the following:when HTTP_REQUEST { if {[HTTP::host] eq "aeadebab.adp.ae" } { HTTP::redirect "http:://[HTTP::host]/webcenter" } }
Bhattman - rajendra_106871
Nimbostratus
Hi Bro,It is not working.
I Mean it is not redirecting to the specified URI.
It is taking up to
aeadebab.adp.ae.Thanks,
Rajendra.
- rajendra_106871
Nimbostratus
Dear Friends,can some one through some light on this issue.
Thanks,
Rajendra
- koenning_107182
Nimbostratus
Hi Rajendra,
glad to help here. Could you share the current sanatized virtual server config and irule?
Also, to specify the desired behavior, you want users which are connecting to
http://aeadebab.adp.ae to be redirected to http://aeadebab.adp.ae/webcenter ? But the remaining request should be untouched ?
If so, try this one:
when HTTP_REQUEST {
if {[HTTP::host] eq "aeadebab.adp.ae" and [HTTP::uri] eq "/" } {
HTTP::redirect "http:://[HTTP::host]/webcenter"
}
}
Thanks,
Christian - Michael_Yates
Nimbostratus
Hi rajendra,
You could skip the [HTTP::host] value compare if it the desired hostname "aeadebab.adp.ae" is the only one pointed to the Virtual Server and then just handle the redirects.
If there are multiple hostnames pointed to that Virtual Server, then you will need to include it.
This iRule will append "/webcenter" to any new connections automatically and is set to append the full URL for any requests beginning in "/console*".
You can add as many conditions as you like to the switch statement and then add the default pool name that the traffic should be routed to if none of these conditions are met (or change the pool direct to a redirect to another page).when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/" { HTTP::redirect "/webcenter" } "/console*" { HTTP::redirect "/console.full.location.url" } default { pool pool.name } } }
Hope this helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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