Forum Discussion
joelvs_45274
Nimbostratus
Sep 14, 2007Redirect HTTP traffic without modifying url
Hello,
I am repeatedly getting requests from my developers to have blah.domain.com display a page that is at www.domain.com/uri without changing the original url. They want the original url to remain blah.domain.com in the browser.
I am running version 9.4 and have tried to do this various ways without success. Can anyone give me some pointers on the best way to do this. It may very well be that I am just making this a lot harder than it needs to be.
- Let's assume your external hostname is "blah.domain.com" and your internal servers are configured with a hostname of "www.domain.com", then you can use simple host name header rewriting to do the trick.
when HTTP_REQUEST { if { [HTTP::host] eq "blah.domain.com" } { HTTP::header replace "Host" "www.domain.com" } }
when HTTP_REQUEST { if { [HTTP::host] eq "blah.domain.com" } { HTTP::header replace "Host" "www.domain.com" HTTP::uri "/fixedvalue" } }
- Kirk_Bauer_1018
Nimbostratus
The only downside to Joe's suggestions are redirects. For example, let's say that the user types in blah.domain.com/support and the Host header is changed so the web server sees www.domain.com/support. Let's assume support is a directory. The web server will now redirect the browser to http://www.domain.com/support/. So you also need to modify the URI in the redirects so that the client sees http://blah.domain.com/support/. - joelvs_45274
Nimbostratus
ProxyPass worked great for what i needed in 9.x, is there an easy way to do the same thing in 4.x?
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