Forum Discussion

smiley_dba_1116's avatar
smiley_dba_1116
Icon for Nimbostratus rankNimbostratus
Aug 02, 2012
Solved

Redirect while preserving the locale

Can this happen. For example, if someone goes to abc.com/ca-en, it gets redirects to def.com/ca-en, basically preserving the uri. Or if someone goes to abc.com/fa-en, it automatically gets redirected to def.com/fa-en. I know I can create an iRule that takes the header and statically change it to a different site, but was wondering if we could leave an open ended ui at the end so that whenever there is a string, it will get redirected with the original uri untouched.
  • when HTTP_REQUEST {  if { [string tolower [HTTP::host]] equals "abc.com"} {    HTTP::redirect "http://def.com[HTTP::uri]"  }}

1 Reply

  • when HTTP_REQUEST {  if { [string tolower [HTTP::host]] equals "abc.com"} {    HTTP::redirect "http://def.com[HTTP::uri]"  }}