Forum Discussion
Rewriting 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 {
HTTP::header replace host "not-so-friendly-domain.com"
}
But my attempts at modifying the URI or Path have not been working. Can anyone recommend a strategy for loading a website from another server & path without changing the URL? It's OK (and preferable) to display the filename after the domain, just not the original '/path-to-website/'.
Thanks for any help!
1 Reply
- Vijay_E
Cirrus
You 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
* 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