Forum Discussion
Yann_Desmarest_
Nacreous
Hello,
The switch condition are taken in the order, so you can define a /dir1* but after /dir1/dir2* for example.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::path]] {
"/dir1/dir2*" {
HTTP::respond 301 Location "http://www.domain2.com"
}
"/dir1*" {
HTTP::respond 301 Location "http://www.domain1.com"
}
}
}
ShinRyuX
Mar 29, 2016Nimbostratus
Hello,
That solution would work but this iRule is actually a simplified version of my current iRule where I have over 100 redirect links along with uri parameters extracted from original URL. I would have to re-order the conditions in ways to prevent any conflicts from occuring.
Is there anything that can be done without re-arraging the order? I tried few things like putting "dir1?" or even "dir1[ ?]" but they dont satisfy both conditinos i want.
Thank You