jbergeron_10592
Jan 24, 2008Nimbostratus
Unable to make this work - Help Please
Good Morning -
Where am I going wrong? After struggling through this for the past 3 days, I am at my wits end. We are trying to convert our 4.5 rules to 9.4 and to this point have been completely unsuccessful. If anyone out there could help me, it would be much appreciated!
Here are the two rules I am trying to convert (and my feable attempts as well):
XYZ Redirect -
if (not (http_host == "www.xyz.com")) {
if (http_host == "mobile.xyz.com") {
redirect to "http://www.xyz.com/mobile"
}
else {
if (http_uri matches_regex "xyzfreeconversion.asp" or http_uri matches_regex "getconversion.asp" or http_uri matches_regex "whoami.asp") {
use pool LAX_ORIGIN_SERVERS
}
else {
redirect to "http://www.xyz.com/%u"
}
}
}
else {
use pool LAX_ORIGIN_SERVERS
}
My attempt -
when HTTP_REQUEST {
if {not [HTTP::host] == "www.xyz.com" } {
if { [HTTP::host] == "mobile.xyz.com" } {
HTTP::redirect "http://www.xyz.com/mobile"
}
else {
if { [http_uri] matches_regex "xyzfreeconversion.asp" or [http_uri] matches_regex "getconversion.asp" or [http_uri] matches_regex "whoami.asp" } {
pool LAX_ORIGIN_SERVERS
}
else {
HTTP::redirect "http://www.xyz.com/%u"
}
}
}
else {
pool LAX_ORIGIN_SERVERS
}
}
Second Rule -
if (not (http_host == "www.xyzfree.net")) {
if (http_host == "www.xyzfree.com" or http_host == "www.freexyz.com" or http_host == "www.freexyz.net") {
redirect to "http://www.xyz.com/"
}
else {
redirect to "http://www.xyzfree.net/%u"
}
}
else {
use pool xyzFree
}
My attempt -
when HTTP_REQUEST {
if {not [HTTP::host] == "www.xyzfree.net" } {
if { [HTTP::host] == "www.xyzfree.com" or [HTTP::host] == "www.freexyz.com" or [HTTP::host] == "www.freexyz.net" } {
HTTP::redirect "http://www.xyz.com/"
}
else {
HTTP::redirect "http://www.xyzfree.net/%u"
}
}
else {
pool xyzFree
}
if {not [HTTP::host] == "www.xyz.com" } {
}
}
Thanks in advance for your assistance!
JB