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 www.domain.com when displaying www.abc.com/subject
Any help much appreciated.
Thanks
Pav
14 Replies
- Pav_70755
Nimbostratus
Hi Aaron,
The re-direct I rule I have set up is as followsUn-comment the following lines if the site uses SSL when CLIENT_ACCEPTED { TCP::collect 5 } when CLIENT_DATA { if { [matchclass [TCP::payload] starts_with $::http_methods] } { SSL::disable } } when HTTP_REQUEST { if { [TCP::local_port] eq "80" } { persist source_addr 1800 HTTP::fallback http://support.abc.com/ Un-comment the next 3 lines for redirects and expand out with elseif's if needed if { [HTTP::host] == "www.abc1.com" } { HTTP::redirect "http://url1.com" } elseif { [HTTP::host] == "www.abc2.com" } { HTTP::redirect "http://host2.com" } elseif { [HTTP::host] == "www.domain3.com" } { HTTP::redirect "http://www.url4.com" } else { pool Web_Farm_Front Un-comment the net line if using redirects } } elseif { [TCP::local_port] eq "443" } { HTTP::header insert "BPL-SSL" "On" pool Web_Farm_Front } else { set srvr [findclass [TCP::local_port] $::Individual_Servers " "] if { $srvr ne "" } { node $srvr 80 } else { } } } }
So do I need to set up a separate pool to use for the header re-write rule?
Thanks
Pav - hoolio
Cirrostratus
Hi Pav,
If all of the servers in the single pool answer for both host names you don't need separate pools.
Aaron - Pav_70755
Nimbostratus
HI Aaron yep thats right although the rule doesnt appear to be working as im getting the invalid hostname error.
Do you have any other ideas or rules I could use?
Thanks again for all your help. - hoolio
Cirrostratus
Hi Pav,
I'd still suggest looking at these questions to figure out what you need to do on LTM to get this to work:
Do all servers in the pool have the same host header set in the web server virtual host definition? Is that what you've put in the iRule in replacement of www.abc.com?
Put another way, if you make a request directly to the pool members, what host name(s) do you have to use to get a valid response from the server?
Aaron
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
