Forum Discussion
Justin_Haggerty
Nimbostratus
Jun 14, 2007rewrite issue
Say our app behind our bigip answers up to www.xyz.com from the web. the server behind the bigip's hostname is actually www.abc.com. My current setup is working except for instances when people brow...
Jun 18, 2007
What's happening is that the backend webserver is sending a 301 or 302 based redirect to the browser. The redirect is in the HTTP response header named Location. For your situation, all you'll need to do is catch 301 or 302 responses in the Response and replace abc.com with xyz.com in the response value. Something like this should work for you.
when HTTP_RESPONSE {
switch [HTTP::status] {
301 -
302 {
HTTP::header Location [string map {abc.com xyz.com} [HTTP::header Location]]
}
}
}Basically this iRule will look in the response for all 301 and 302 status codes and if one is found, then set the Location header to the old location header with the strings "abc.com" replaced with "xyz.com".
-Joe
