Guys,
At present, our clients are going to request the URL https://www.oldsite.com/supportus/.pdf. We want to forward this request to https://www.mysite.com/nextgen/new/sales/.pdf.
However, the main request here is to keep the redirect URL hidden from the end customer.
With some suggestion we received here is the iRule in place for this request:
when HTTP_REQUEST { if { [HTTP::uri] starts_with “/supportus/” } { HTTP::header replace “Host” ";; log local0. “New host: [HTTP::host]” set uri [string range [HTTP::uri] 11 end] HTTP::uri “/nextgen/new/sales/$uri” log local0. “Final URI: [HTTP::uri]” } }
Now this iRule seems to work fine but the client fails to receive the page. The debug logs which mention:
log local0. “New host: [HTTP::host]” log local0. “Final URI: [HTTP::uri]”
shows the correct host and uri being set.
What could be breaking this? Do we need a HTTP_RESPONSE event as well? If yes, how should that be structured?
Thanks !!!