Forum Discussion
Misty_Spillers
Nimbostratus
Oct 04, 2011Omiting a portion of a redirect
This seems like it would be easy but just can't quite find the answer.
One of our customers used to be hosted under our main web site now they have moved the site to a vanity domain. I'm try...
nitass
Employee
Oct 04, 2011sorry i think this may be easier.
[root@tulip:Active] config b virtual bar list
virtual bar {
destination 172.28.17.66:http
ip protocol tcp
rules myrule
profiles
http
tcp
}
[root@tulip:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] ends_with "oursite.com" and [string tolower [HTTP::uri]] starts_with "/theirsite"} {
HTTP::redirect "http://www.theirsite.com[string range [HTTP::uri] 10 end]"
}
}
}
[root@tulip:Active] config curl -I http://www.oursite.com/theirsite/test/about.shtml
HTTP/1.0 302 Found
Location: http://www.theirsite.com/test/about.shtml
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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