Forum Discussion
Brian_Moore_603
Nimbostratus
Jul 28, 2008iRule Redirect and then a Rewrite back to client
Is there any known way to do a iRule redirect (80 to 443), then once all that has been done on the way back to the client present a new URL... for example, client goes to http://www.abc.com, get to the f5 an iRule happens that takes them to https, which in this case is a VIP, the VIP makes the load balance call and on the way back to the client another iRule happens that does some sort of rewrite for the URL back to the client.
I have the HTTP to HTTPS iRule figured out what I can't seem to do is the back to the client part.
I am sure that someone has already been down this road so forgive me upfront for asking folks to repeat... any help would be very appreciated.
BMoore
3 Replies
- hoolio
Cirrostratus
Hi,
Can you explain what you'd like the client to see in the address bar for the protocol (http versus https) along with what requests/responses should be sent to the pool members? The part I'm not sure about is the rewriting of the URL back to the client.
In general, you can issue a redirect from an iRule which will cause the browser to update the address bar with the redirect location and make a request to the new location. You can rewrite the application's response content using a stream profile and iRule. You can rewrite the application's response headers (like the Location header) using an iRule or an HTTP profile.
Aaron - Brian_Moore_603
Nimbostratus
So in this case let me try to explain it this way... The client goes to http:\\www.abc.com, comes into the f5 we do a redirect to https and at the sametime we send it to a different URL in this case https:\\www.xyz.com/domainname=abc (we are doing this with an iRule as well. So when the response goes back to the client they will see https:\\www.xyz.com/domainname=abc we would rather have the address bar at the client show something like http:\\www.abc.com, think of it as hiding the stuff going on in the background (the Wizard in The Wizard Of OZ comes to mind)....
melloyellowmoore - hoolio
Cirrostratus
You can use the ProxyPass iRule (Click here) from the codeshare to proxy one site for another.
Else, as a simpler method, you could rewrite the host using 'HTTP::header replace Host newhost.example.com' and the URI with HTTP::uri "/newuri".
If the application includes absolute references to the requested host or modified URI in response headers or content you'd need to rewrite these using HTTP::header replace Location "http://newlocation.example.com" and a stream profile for the payload. Check this post for more info (Click here).
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
