Forum Discussion
brownie6969_121
May 31, 2012Nimbostratus
redirect irule
our old application url that pointed to the F5 vip was mybicrt.company.com. The new code is mybicrt.company.com/analytics. i created the following that achieves that part of ithttps://mybicrt.company.com/saw.dll?Dashboard&PortlPath/shared/Executive/_portal/Executiveand we need them to redirect tohttps://mybicrt.company.com/analytics/saw.dll?Dashboard&PortlPath/shared/Executive/_portal/Executive
when HTTP_REQUEST {
if { [HTTP::path] equals "/" } {
HTTP::redirect "/analytics/"
log local0. "redirect"
}
}
now the problem is that users have links to dashboards saved that look like this
basically the irule we have setup stops at analytics and I need a way to add /analytics after mybicrt.compan.com but keep the rest of the url there. Also there are a ton of dashboard links that are all different.
is this possible.
Thanks
Andrew
- Eric_St__JohnEmployeeThis iRule is assuming that all requests should begin with /analytics If the images are stored in a location other than /analytics you will have to account for that in the iRule. Are all of the images contained within a single location? If so, please provide an example of one of the image locations.
- Michael_YatesNimbostratusOK. Try this...
First iRule: when HTTP_REQUEST { switch -glob [string tolower [HTTP::path]] { "/" { HTTP::respond 301 Location "http://www.google.com" } "*/saw.dll*" { HTTP::uri "/analytics[HTTP::uri]" log local0. "Saw Event: URI - [HTTP::uri]" } } } Second iRule for proof that the first is working: when HTTP_REQUEST { log local0. "Second iRule HTTP::uri Value: [HTTP::uri]" }
- brownie6969_121Nimbostratusit took awhile estjohn but it started working. We test a ton of links and we are good to go.
- brownie6969_121NimbostratusHey estjohn,
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