Forum Discussion
mika
Cirrus
Jul 28, 2020redirect path irule f5
Hello! I have three hosts ( www.abc.com /.www.aze.fr / www.qsd.fr ) with the same path and i want redirect all the paths to a new path for all hosts My irule: when HTTP_REQUEST { if { [HT...
Jul 28, 2020
Hi mika,
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] ne "/fin_participations.html" } {
HTTP::redirect "http://www.abc.com/fin_participations.html"
}
}- mikaJul 28, 2020
Cirrus
thank you for your reply, but I cannot apply this rule because I have another url with the same hosts that I don't want to redirect to this page, i want redirect just some path not all.
- Jul 28, 2020
You can use switch statement or datagroup.
Switch:
when HTTP_REQUEST { switch -glob [HTTP::path] { "/abcd*" - "/yyyyyyy*" - "/xxxxxx*" - "/zzzzzz*" { HTTP::redirect "http://[HTTP::host]/fin_participations.html" } } }Datagroup:
Create a string datagroup.
/abcd /yyyyyyy /xxxxxx /zzzzzzDatagroup irule:
when HTTP_REQUEST { if { class match [HTTP::path] contains dg-name } { HTTP::redirect "http://[HTTP::host]/fin_participations.html" } } } - mikaJul 28, 2020
Cirrus
I don't know, but it doesn't work :( :(
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
