Forum Discussion
rcd_125923
Nimbostratus
Aug 07, 2014URL Replace iRule
Hi,
I am hosting a website behind my LB, with URL replacement requirement as below:
https://www.somesite.com/SearchResult.aspx/?search=
Should redirect to
https://somesite...
nitass
Employee
Aug 10, 2014https://www.somesite.com/SearchResult.aspx/?search=
Should redirect to https://somesite.com/somejsppage.jsp?kw=is part of the sample url missing?
anyway, is it something like this?
// config
[root@ve11a:Active:In Sync] config tmsh list ltm virtual bar
ltm virtual bar {
destination 172.28.24.10:80
ip-protocol tcp
mask 255.255.255.255
pool foo
profiles {
http { }
tcp { }
}
rules {
qux
}
source 0.0.0.0/0
source-address-translation {
type automap
}
vs-index 60
}
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
if { [HTTP::host] eq "www.somesite.com" } {
if { [HTTP::uri] starts_with "/SearchResult.aspx/?search=" } {
HTTP::redirect "http://somesite.com/somejsppage.jsp?kw=[URI::query [HTTP::uri] search]"
}
}
}
}
// test
[root@ve11a:Active:In Sync] config curl -I http://172.28.24.10/SearchResult.aspx/?search=something -H "Host: www.somesite.com"
HTTP/1.0 302 Found
Location: http://somesite.com/somejsppage.jsp?kw=something
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