Forum Discussion
mfrench_267209
Nimbostratus
Dec 16, 2016Rewriting the HOST and part of the URI
Here's the goal:
should load the website from:
I've successfully replaced the domain/host using the following code:
if {($r_host equals "www.marketing-url.com")} then {
...
Vijay_E
Cirrus
Dec 16, 2016You can do a redirect:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.marketing-url.com") and ( [HTTP::uri] eq "/" ) } {
HTTP::respond 301 Location "http://www.not-so-friendly-domain.com/path-to-website/"
}
}
If you just want to replace the host and uri values and pass it to the server in pool:
when HTTP_REQUEST {
if { ([HTTP::host] eq "www.marketing-url.com") and ( [HTTP::uri] eq "/" ) } {
HTTP::host "www.not-so-friendly-domain.com"
HTTP::uri "/path-to-website/"
}
}
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