Forum Discussion
cymru81
Altocumulus
Dec 01, 2020irule uri redirect help
Hi Im looking for help with an irule to achieve the following: if someone visits https://www.site.com/abc/def or https://www.site.com/abc/def/ it redirects them to https://www.domain.com - we h...
Dec 01, 2020
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 }
}
}
}cymru81
Altocumulus
Dec 02, 2020Hi 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 ?
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