Forum Discussion
Brian_Mayer_841
Nimbostratus
Mar 04, 2008Host header replace not working....
Hey all,
We're trying to replace the host portion of URLs for one of our virtual servers if they match a certain host string. I found the example below and applied it to the virtual server - but it's not working.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.example.com"} {
HTTP::header replace "Host" "example.company.com"
}
}
If I go to the URL using www.example.com, the HTTP request is simply forwarded to the site and the host portion remains www.example.com - not example.company.com.
Any ideas where to start troubleshooting?
Thanks,
B
- Nicolas_Menant
Employee
when HTTP_REQUEST { - Brian_Mayer_841
Nimbostratus
I see lots of these in the LTM log, but I still see the original www.example.com in the browser URL: - Nicolas_Menant
Employee
HTTP_request manipulate HTTP data that is being sent to the server - Brian_Mayer_841
Nimbostratus
Would a URL redirect work too? I'm sure it's less efficient since the clients would be redirected to the correct URL... - Nicolas_Menant
Employee
If your web server can provide http code based on the HTTP host yes.
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