Forum Discussion
irule uri redirect help
Hi cymru81,
You should use starts_with instead of ends_with.
When using starts_with, /abc/def/x path matches with condition.
If you don't want redirect for /abc/def/x, you can use this iRule:
when HTTP_REQUEST {
if { [HTTP::host] equals "www.site.com" } {
switch [HTTP::path] {
"/abc/def" -
"/abc/def/" { HTTP::redirect https://www.domain.com }
}
}
}- cymru81Dec 02, 2020
Altocumulus
Hi eaa
Thanks for responding, unfortunately that still doesnt work when changing to starts_with
We still want visitors to be able to navigate to /abc/ but with this irule applied its redirecting them to www.domain.com ?
- Dec 02, 2020
Hi,
Only /abc/def and /abc/def/ match this iRule. /abc/ does not match.
- cymru81Dec 02, 2020
Altocumulus
could there be something else in my original rule causing this as if i go to www.site.com/abc it blanket redirects to www.domain.com ?
- jaikumar_f5Dec 02, 2020
Noctilucent
We always should look at possibilities, to confirm this, I'd suggest to put loggings in the Irule block and see where this redirection is getting triggered.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
