20-Oct-2015 10:57
How do I write an iRule for the following 301 redirect?
301 Redirect: https://investor.tradeking.com/Modules/NewAccount/newAccount.php ----> https://application.tradeking.com/?ola=tks
Redirect w/ Query example: https://investor.tradeking.com/Modules/NewAccount/newAccount.php?ADTRK=ACJwhatever&siteid=123456 ----> https://application.tradeking.com/?ola=tks&ADTRK=ACJwhatever&siteid=123456
20-Oct-2015
11:48
- last edited on
05-Jun-2023
14:26
by
JimmyPackets
Hi,
like this I think:
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "Modules/NewAccount/newAccount.php" }{
set params [getfield [HTTP::uri] "?" 2]
set newdestination "https://application.tradeking.com/?ola=tks&$params"
HTTP::respond 301 Location "$newdestination"
}
}
20-Oct-2015
11:55
- last edited on
02-Jun-2023
15:52
by
JimmyPackets
more readable...
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "Modules/NewAccount/newAccount.php" }{
set params [getfield [HTTP::uri] "?" 2]
set newdestination "https://application.tradeking.com/?ola=tks&$params"
HTTP::respond 301 Location "$newdestination"
}
}
20-Oct-2015 12:29