Forum Discussion
Phil_102636
Nimbostratus
Oct 05, 2012need help to get uri to work regardless of any extra characters
I have an irule that uses a data class to look for a keyword and if found redirects to another URL.
This part works fine but if for some reason any extra characters are put into the URL it fails...
nitass
Employee
Oct 10, 2012what about this one?
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:443
ip protocol 6
rules myrule
profiles {
clientssl {
clientside
}
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set my_uri [string tolower [HTTP::uri]]
if {[class match -- $my_uri contains www_vanity_url_redirection]} {
set vanity_path [class match -value $my_uri contains www_vanity_url_redirection]
HTTP::redirect $vanity_path
}
}
}
[root@ve10:Active] config b class www_vanity_url_redirection list
class www_vanity_url_redirection {
"/test" { "https://www.someotherplace.com" }
}
[root@ve10:Active] config curl -Ik https://172.28.19.79/test
HTTP/1.0 302 Found
Location: https://www.someotherplace.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -Ik https://172.28.19.79/testy
HTTP/1.0 302 Found
Location: https://www.someotherplace.com
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
