Forum Discussion
Pierce_Fortin
Nimbostratus
Nov 28, 2017Best way to rewrite HTTP/ HTTPS response to change URL?
We have a white-label application which doesn't support being hosted inside subdirectories, IE: The application can live at foo.com/ not foo.com/bar. We have a new business requirement for a client w...
Andy_McGrath
Cumulonimbus
Nov 29, 2017The key to this is saving info from the Request so you can use it in the Response. Things like the HTTP Host and requested URI are lost on response, example:
when HTTP_REQUEST {
set host [HTTP::host]
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
if {$uri starts_with "/stuff" &&
[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@foo.com@foo.com/bar@}
STREAM::enable
}
}
Not complete iRule but hope it helps.
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
