Forum Discussion
Redirect rewrite to remove explicit port
We have an app server that is behaving strangely and I need to try to fix it at the F5.
The server is sending back a 302 moved redirect with the location formatted like this:
https://rwqdn:80/uri
Since it is https, redirect rewrite in the http profile does not do anything with it.
Can I use an iRule similar to theses below:
https://devcentral.f5.com/articles/rewriting-redirects.UiC5Dn8srsU
https://devcentral.f5.com/wiki/irules.rewritehttpredirecthostname.ashx
For the purposes of the built in functions is the :80 part of the host name? Can this be accomplishes somewhere other than iRule?
Thanks for any input-
Mike
1 Reply
- Kevin_Stewart
Employee
A few ways to do this, but here's one example:
when HTTP_RESPONSE { if { [HTTP::is_redirect] } { HTTP::header replace Location [lindex [split [HTTP::header Location] ":"] 0] } }
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