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...
Pierce_Fortin
Nimbostratus
Nov 28, 2017I think I found part of the answer,
when HTTP_REQUEST {
STREAM::disable
HTTP::header remove "Accept-Encoding"
}
when HTTP_RESPONSE {
if {[HTTP::header value Content-Type] contains "text"}{
STREAM::expression {@foo.com@foo.com/bar@}
STREAM::enable
}
}
But, I only want the script to run when the HTTP_RESPONSE is a response to a specific set of domains. I'm also unsure how I can not do the STREAM expression when the URL is already foo.com/bar, IE: foo.com/stuff should rewrite to foo.com/bar/stuff but foo.com/bar/other should not rewrite to foo.com/bar/bar/other
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
