Forum Discussion
Dbow_21284
Nimbostratus
May 18, 2010Rewrite Host Header iRule on VS that changes to HOST Header on same VS
Hello guys,
I have a situation where our developers have a sight running on HTTPS that needs to rewrite the host header to a new host header, but DNS points it to the same VS on my LTM. I...
Michael_Yates
Nimbostratus
May 18, 2010Your second iRule should work if you put quotes around the redirect:
when HTTP_REQUEST {
if {[HTTP::host] equals "mydomain.net" } {
HTTP::redirect "https://sub.mydomain.net"
}
}
You could also use a string map replacement:
when HTTP_REQUEST {
if {[HTTP::host] equals "mydomain.net" } {
set host [string map {mydomain.net sub.mydomain.net} [HTTP::host]]
HTTP::redirect "https://$host[HTTP::uri]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
