Forum Discussion
Sean_Lagerholm_
Nimbostratus
Jun 07, 2006Simple http redirect???
Help, I'm having difficulty with fulfilling a requirement :
The customer wants to type in some url and then gets redirected.
The customer doesn't want to see the redirect in their brow...
Deb_Allen_18
Jun 08, 2006Historic F5 Account
Tom -
Your code actually will accomplish a backend re-write, transparent to the browser.
Lagerholm -
You'd probably also want to change the Host: header to the new hostname:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/"} {
HTTP::uri /stuff
}
HTTP::header replace Host: anothersite.com
}and if you want to prepend /stuff to every URI, something like this would work:when HTTP_REQUEST {
if { [string length [HTTP::uri]] > 1 } {
HTTP::uri /stuff[HTTP::uri]
} else {
HTTP::uri /stuff
}
HTTP::header replace Host: anothersite.com
}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
