Forum Discussion
Tony_Lee_73702
Nimbostratus
Oct 13, 2005HTTP rewrite for lots of URLs
Hi all,
I've got a pair of 3400s running 9.0.5. I've created a HTTP-based VS load balancing traffic against a handful of IIS servers.
I'm in a web hosting environment and I've g...
Oct 28, 2005
All you need to do is replace the 192.168.1.1 with the host name. You'll also need to put in a check for the uri to avoid an infinite loop.
Ignoring what we've discussed in the previous posts, you could do the mapping you requested with this code
when HTTP_REQUEST {
if { [string equal -nocase [HTTP::host] "www.foo.com"] and
not ([string tolower [HTTP::uri]] starts_with "/foo") } {
HTTP::redirect "http://[HTTP::host]/foo[HTTP::uri]"
}
}
I added in the "not starts with "/foo" to avoid the infinite loop.
http://www.foo.com -> http://www.foo.com/foo
http://www.foo.com/foo -> http://www.foo.com/foo/foo
http://www.foo.com/foo/foo -> http://www.foo.com/foo/foo/foo
...
-Joe
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