Forum Discussion
javier_diaz_379
Nimbostratus
Sep 16, 2011how to lower a part of the URI?
Lets say I have www.foo.com/Bar/Xxxxx
I need an irule to only lower the firs part of the URI. In the case I need a 301 redirect to www.foo.com/bar/Xxxxx
How can I do that?
nitass
Employee
Sep 16, 2011please feel free to revise.
[root@orchid:Active] config b virtual bar80 list
virtual bar80 {
destination 172.28.17.88:http
ip protocol tcp
rules myrule1
profiles
http
tcp
}
[root@orchid:Active] config b rule myrule1 list
rule myrule1 {
when HTTP_REQUEST {
scan [HTTP::uri] {/%[^/]%s} para1 para2
HTTP::redirect "http://[HTTP::host]/[string tolower $para1]$para2"
}
}
[root@orchid:Active] config curl -I http://www.foo.com/Bar/Xxxxxx
HTTP/1.0 302 Found
Location: http://www.foo.com/bar/Xxxxxx
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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