28-Jul-2020 08:19
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 {
[HTTP::path] contains "/abcd"
or [HTTP::path] contains "/yyyyyyy"
or [HTTP::path] contains "/xxxxxx"
or [HTTP::path] contains "/zzzzzz"
...
}
{
HTTP::redirect "/fin_participations.html"
}
}
But my irule it's not good, have you suggestions to achieve my goal please!!
Thank you ^_^
28-Jul-2020 08:39
Hi mika,
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] ne "/fin_participations.html" } {
HTTP::redirect "http://www.abc.com/fin_participations.html"
}
}
28-Jul-2020 09:39
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.
28-Jul-2020 10:46
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
/zzzzzz
Datagroup irule:
when HTTP_REQUEST {
if { class match [HTTP::path] contains dg-name } {
HTTP::redirect "http://[HTTP::host]/fin_participations.html" }
}
}
28-Jul-2020 12:00
I don't know, but it doesn't work 😞 😞
28-Jul-2020 20:58
LTM policy will be better option to use here.
Mayur
03-Aug-2020 05:44
Hello, thank u for your reply, i created a datagroup which contains all path, and i used
LTM Policy refer attached image but i have the same probleme.
Best regards