Forum Discussion
GerardoF83_3196
Nimbostratus
May 04, 2017URL Redirect Parse
Hi Guys
I'm totally new at this, so I'm trying the following and I'm not sure if an iRule will do it
I need to redirect as below
http://abc.qwe.com/ghj/qwe/12345
to
http://mnb.lkj.com/asd/qaz/wsx/edc/12345
So it's a totally new URL and the only thing in common is last number. Also if user goes to host (http://abc.qwe.com or http://abc.qwe.com/ghj) it should be redirected to new host (http://mnb.lkj.com)
Can I get this done with an iRule or I need Data Group or maybe a policy?
Thanks in advance!
- JG
Cumulonimbus
Here's one [untested] :
when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "abc.qwe.com" } { switch -glob -- [HTTP::path] { "/ghj/qwe/*" { HTTP::redirect http://mnb.lkj.com/asd/qaz/wsx/edc/[getfield [HTTP::path] "/" 4] } "/" - "/ghj/" { HTTP::redirect http://mnb.lkj.com } } } }
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