http::header
2 Topicshttp rewrite irule -- help!!
We have a requirement for a http rewrite but its driving me mad (as a newbie to irules and even after trawling through forums and docs) trying to get this right, and its been going on for weeks. Customer Requirement: 1) browse to intially to http site. 2) This gets changed to HTTPS 3) HTTPs request is made by client to same location 4) Browser of client stays as www.abc.com/t/www/zzz but on the middleman (F5) host is rewritten to www.xyz.com (so client doesnt receive 302 redirect but instead receives 200 ok). The 200 response will actually come from this location (https://www.xyz.com/www.abc.com/t/www/zzz) but the URL in the user browser will still remain as https://www.abc.com/t/www/zzz For example GET http://www.abc.com/t/www/zzz HTTP/1.1 Host: www.abc.com HTTP/1.0 301 Moved Permanently location: https://www.abc.com/t/www/zzz CONNECT https://www.abc.com/t/www/zzz HTTP/1.1 HTTP/1.1 200 Connection Established so on the Virtual server we have the following iRule on HTTP VS: (initial http request) when HTTP_REQUEST { if { [HTTP::host] contains "www.abc." and [HTTP::uri] starts_with "/t/" } { HTTP::respond 301 location "https://[HTTP::host][HTTP::uri]" } } Then iRule on HTTPS VS: (Https request) when HTTP_REQUEST { if { [HTTP::header host] contains "www.abc." and [HTTP::uri] starts_with "/t/" } { HTTP::uri "/[HTTP::host][HTTP::uri]" HTTP::header replace host "www.xyz.com" } } I was hoping the replace command on the second iRule would be transparent to the end user but we always seem to be getting the 302. Can you advise if this is possible doing it this way or is there another way I can achieve the above?319Views0likes1Comment