Forum Discussion
FMA
Nimbostratus
Mar 26, 2018Replace Host part in HTTP::Location
Hello, guys.
I'm trying to find a way to perform manipulation with HTTP::header Location.
1. Web-browser requests https://abc.com
2. Web-server replies with HTTP/301 Location: https://xyz.com/{$UR...
Stanislas_Piro2
Cumulonimbus
Mar 26, 2018Hi,
I recommend to replace absolute URI to relative URI. This rewrite rule may have been useless if the server had responded with relative URI.
when HTTP_RESPONSE {
if { [HTTP::header exists Location] && ([URI::host [HTTP::header value Location]] equals "xyz.com")} {
HTTP::header replace Location [string map {https://xyz.com/ /} [HTTP::header value Location]]
}
}
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