Forum Discussion
Wildcard iRule or Policy redirect v13.0
Im trying to utilize a simple redirect policy or iRule so if someone enters mycompany.org/whatever, where "whatever" is a wildcard entry, it will redirect to https://mycompany.org/Target. I am not a coder by any means and not iRule savvy. The below redirect works if I type in mycompany.org/whatever. It will redirect to mycompany.org/Target but I cant figure out what to replace in the initial "if" line arguments to accomplish this.. thank you for your help.
when HTTP_REQUEST {
if {[HTTP::path] contains "/whatever"}{
log local0. "redirecting client [IP::client_addr]" HTTP::redirect "https://[HTTP::host]/Target"
}
}
- Stanislas_Piro2
Cumulonimbus
Hi,
The problem is what do you mean by whatever? Do you mean every uri but /target ?
when HTTP_REQUEST { if {!([HTTP::path] starts_with "/Target")}{ log local0. "redirecting client [IP::client_addr]" HTTP::redirect "/Target" } }
Recent Discussions
Related Content
* 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