Forum Discussion
Pav_70755
Nimbostratus
Oct 26, 2010HTTP Re-Direct and keep original URL in address bar
I have the following simple re-direct in place
}
elseif { [HTTP::host] == "www.domain.com }{
HTTP::redirect "http://www.abc.com/subject"
I basically want the address bar to keep ...
hoolio
Cirrostratus
Nov 02, 2010Hi Pav,
If you want to preserve the URL in the address bar, you don't want to send a redirect back to the client. Instead, you'll need to rewrite the HTTP host header and/or URI and possibly select a different pool if the virtual server's default pool doesn't serve content for the separate hostname. Here's a first try at what you're looking for:
when HTTP_REQUEST {
Check if requested host is domain.com or www.domain.com
switch [string tolower [HTTP::host]] {
"www.domain.com" -
"domain.com" {
Matched the hostname, so rewrite the host header
HTTP::header replace Host "www.abc.com"
Select different pool for this request?
pool www.abc.com_http_pool
}
}
}
If (or more likely, when) this doesn't work, can you use a browser plugin like HttpFox for Firefox or Fiddler for IE, to track what's happening?
Thanks, Aaron
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