Forum Discussion
alvaro_martinez
Nimbostratus
Sep 21, 2006HTTP Redirect header localtion + uri
Hi,
I have the next reply from web server
HTTP/1.1 302 Moved Temporarily
Set-Cookie: BIGipServerACC-80=674006794.20480.0000; expires=Thu, 21-Sep-2006 11:05:27 GMT; path=/
Date: Thu, 21 Sep 2006 08:20:32 GMT
Location: http://1.2.3.4:8060/mf/MFAgent66x0.SIS?r=yes
Content-Type: text/html
Transfer-Encoding: chunked
I want to change only the IP address of Location header but I want to add the same uri to Location header.
I can to build this rule that I have found in forums but I don´t know if the syntax are correct
when HTTP_REQUEST {
set my_loc "http://xxx.xxx.xxx.xxx[HTTP::uri]"
TCP::respond "HTTP/1.1 302 Found\r\nLocation: $my_loc\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
TCP::close
}
Can you help me with any solutions or rule?
Regards
- hoolio
Cirrostratus
Hello,when HTTP_RESPONSE { if { [HTTP::status] contains "302" && [string tolower [HTTP::header Location]] contains "host_to_replace" }{ log local0. "Original Location: [HTTP::header Location]" log local0. "New Location: [string map -nocase {"host_to_replace" "new_host"} [HTTP::header Location]]" HTTP::header replace Location [string map -nocase {"host_to_replace" "new_host"} [HTTP::header Location]] log local0. "Replaced Location with: [HTTP::header Location]" } }
- alvaro_martinez
Nimbostratus
Hi - hoolio
Cirrostratus
Hi,when HTTP_RESPONSE { if { [HTTP::is_redirect] && [string tolower [HTTP::header Location]] contains "host_to_replace:8060" }{ HTTP::header replace Location [string map -nocase {"host_to_replace:8060" "new_host"} [HTTP::header Location]] } }
- Gustavo_Lazarte
Nimbostratus
Thanks ver much The las solutions do not change the location value and do not leave any logs. I look like I am not even starting and incident with the iRule. - hoolio
Cirrostratus
Hi glazarte, - Gustavo_Lazarte
Nimbostratus
Thanks for the help it worked
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects