BuccaneerDave_2
Feb 20, 2015Nimbostratus
trouble getting redirect irule to work
Hello,
I need to have traffic from:
- hostA.xyzcompanyresources.com/*
redirect to:
- stageamericas.internal.xyzcompanyonline.com/pages/legacyredirection.aspx?legacyurl=hostA.xyzcompanyresources.com/*
I have been trying this:
when RULE_INIT {
set ::org "O=xyzcompany"
log "desired host.xyzcompanyresources.com_irule initialized"
}
when HTTP_REQUEST {
set destination_path "pages/legacyredirection.aspx?legacyurl="
set destination_host "stageamericas.internal.xyzcompanyonline.com/"
Check if requested host starts with desired host.xyzcompanyresources.com
if {([string tolower [HTTP::host]] starts_with $::communities_host_list)} {
set content [string tolower [HTTP::uri]]
set redirect_to "${destination_host}${destination_path}[HTTP::host]${redirect_uri}"
if {$redirect_uri ne ""}{
HTTP::redirect https://$redirect_to
}
}
}
it worked - came in the next day and they say it doesn't work anymore
my data group list is called communities_host_list
it contains : hostA.xyzcompanyresources.com
ltm is v10.2.4
thanks