Forum Discussion
Simon_Blakely
Aug 25, 2020Employee
Well, you have a problem with the syntax of the if conditional, so this breaks the parsing of the TCL and the syntax highlighting.
Also, your HTTP::redirect target is wrong - you will end up with a space in the location, which is not legal.
As always, start with some logging ...
when HTTP_REQUEST {
log local0. "path is [string tolower [HTTP::path]]"
if { ([string tolower [HTTP::path]] starts_with "/en-gb") } {
log local0. " uri is [string tolower [HTTP::uri]], path from 2nd element is [string tolower [URI::path [HTTP::uri] 2]]"
HTTP::redirect "https://1234.com/london/en-gb/apps/tickets[string tolower [URI::path [HTTP::uri] 2]]"
}
}