Forum Discussion
Puneet_73909
Nimbostratus
Jun 26, 2009Wildcard redirection
Hi I am trying to write an irule but unable to do so. SEEK HELP
This one works:
when HTTP_REQUEST {
if {([string tolower [HTTP::path]] ends_with "/doc")} {
HTTP::redirect "http://[HTTP::host]/nmhomepage.jsp"}}
I want if user type www.xyz.com/doc/blablah then it redirects to
HTTP::redirect "http://[HTTP::host]/nmhomepage.jsp"
Please help me to write an redirect rule.
Puneet
- The_Bhattman
Nimbostratus
Hi Puneet,when HTTP_REQUEST { if {([HTTP::host] eq "www.xyz.com) and ([HTTP::uri] eq "/doc/blahblah") } { HTTP::redirect "http://[HTTP::host]/nmhomepage.jsp" } }
- Puneet_73909
Nimbostratus
CM, - hoolio
Cirrostratus
You can use starts_with for a logical wildcard at the end of /doc*: - Puneet_73909
Nimbostratus
Thanks first one worked...:-)
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