Forum Discussion
Need assistance rewriting a hostname and appending a uri.
- Feb 10, 2014
Your HTTP_RESPONSE is incorrect and unnecessary, it's trying to replace the HTTP header called lemons.com with lemons.com if a Host header existed in the response, or killing the TCP connection with a RST and causing a blank page if the Host header didn't exist in the response. Have a look in /var/log/ltm for TCL Errors to determine what's happening.
Case insensitive:
when HTTP_REQUEST { switch [string tolower [HTTP::uri]] { "/" - "/tree.html" { HTTP::uri "/fruit/TREE.html" } } HTTP::header replace Host "lemons.com" }
Case sensitive:
when HTTP_REQUEST { switch [HTTP::uri] { "/" - "/TREE.HTML" { HTTP::uri "/fruit/TREE.html" } } HTTP::header replace Host "lemons.com" }
Your HTTP_RESPONSE is incorrect and unnecessary, it's trying to replace the HTTP header called lemons.com with lemons.com if a Host header existed in the response, or killing the TCP connection with a RST and causing a blank page if the Host header didn't exist in the response. Have a look in /var/log/ltm for TCL Errors to determine what's happening.
Case insensitive:
when HTTP_REQUEST {
switch [string tolower [HTTP::uri]] {
"/" -
"/tree.html" {
HTTP::uri "/fruit/TREE.html"
}
}
HTTP::header replace Host "lemons.com"
}
Case sensitive:
when HTTP_REQUEST {
switch [HTTP::uri] {
"/" -
"/TREE.HTML" {
HTTP::uri "/fruit/TREE.html"
}
}
HTTP::header replace Host "lemons.com"
}
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