Forum Discussion
irule to modify hostname in http request and http response
The irule will work correctly for requests - the Host header will be changed correctly.
However, you do not need to modify a host header in a response, as Host is a request header and not a response header. What you do need to do is modify any references within the response to correct the host (for example, the Location header in a HTTP 302 Redirect response may contain the hostname). Cookies may also contain a domain attribute that needs to be corrected to ensure that the client returns the cookies appropriately.
So using the Rewrite profile is a better approach - otherwise you will probably need to us a STREAM irule to carry out textual substitution of the domain names, which the rewrite profile automates.
Thanks Blakely. I will try using the rewrite profile. So, can I still use the iRule for requests and use the rewrite profile for responses. Or do you recommend using rewrite profile for both requests and responses. Thanks again.
- sandy16Jan 11, 2025
Altostratus
Hi KG, I am in the same boat. just checking what was the best way of getting this done?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
