Forum Discussion
Best method to rewrite Request and Response URI, preserve URI data, and with no client redirect
Hey Brad, Thank you for the response! So I applied the irule to site2. The 303 is coming from the server and is not being re-written on the outbound portion of the irule. Also the user indicated he had to add hit /123/ vs just /123, so modified the rule slightly.
So in the packet capture I see /123 come in and being re-written to /321, but I don't see the reciprocal.
Current iRule: when HTTP_REQUEST { HTTP::header insert "SetContextURI" "http://[HTTP::host][HTTP::path]" HTTP::path [string map {/123 /321/PRServlet} [HTTP::path]] Disable the stream filter for all requests STREAM::disable LTM does not uncompress response content, so if the server has compression enabled and it cannot be disabled on the server, we can prevent the server from sending a compressed response by removing the compression offerings from the client HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { STREAM::expression {@/321/PRServlet@/123@} Enable the stream filter for this response only STREAM::enable }
Samples from the packet capture External - Original Request GET /123/ HTTP/1.1\r\n
Internal - What was sent to the server GET /321/PRServlet/ HTTP/1.1\r\n
Internal - Response from the server */!STANDARD?
External - Response sent to the requesting device */!STANDARD?
External - Next request from the requesting device GET /321/PRServlet/-j04puREN5KesgWh7fQGTaX18YQyXIPY*/!STANDARD? HTTP/1.1\r\n
Internal - What was sent to the server GET /321/PRServlet/-j04puREN5KesgWh7fQGTaX18YQyXIPY*/!STANDARD? HTTP/1.1\r\n
Recent Discussions
Related Content
* 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