Forum Discussion
URL hostname rewrite
Sure can. If you just want to change the host header sent to your backend server while maintaing the support.mycompany.com to your end users, just use the HTTP::header command to change the host header. Something like this should work
when HTTP_REQUEST {
if { [HTTP::host] eq "support.mycompany.com" } {
HTTP::header replace "Host" "server1.mycompany.com"
}
}
The "if" check on the host is only in case you are multi-hosting this iRule. If you want to unconditionally change the host value sent back to the server, you can just use the HTTP::header replace command by itself.
Keep in mind though that if you pass a host value to the back end app server, that some app servers may generate page links based on the passed in host header. If your app did this, you'd have to have a DNS entry for server1.mycompany.com that goes to your VIP.
If you want to do a redirect (which is not what it sounds like you want, you can do a simple redirect
when HTTP_REQUEST {
if { [HTTP::host] eq "support.mycompany.com" } {
HTTP::redirect "http://server1.mycompany.com[HTTP::uri]"
}
}
Hope this helps...
-Joe
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