Forum Discussion
Write an irule or a policy to allow specific URIs
Hi Guys,
I'm quite new to F5. We have a requirement for allow only 4 specific URIs and block any other URI. What would be the best way to do it. Would it be using an irule or using a LTM policy? Are you able to provide an example irule or LTM policy for this please?
6 Replies
- Faruk_AYDIN
Altostratus
use this iRule:
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] "/uri1*" - "/uri2*" - "/uri3*" - "/uri4" { #do nothing } default { #drop others drop } }
- wick54
Nimbostratus
Thanks, I will try this, if URI contains Uppercase characters, do i need to change to it lower case in iRule? would that be matched?
- youssef1
Cumulonimbus
Hi,
I think usign an irule for your need will give you a lot more flexibility you can answer a blocking page to the user, a drop, a reset ...
Anyway find an example with ltm policy (with reset)... if you want more flexibility (blocage page in ifile for example use an irule):
regards
- wick54
Nimbostratus
If URI contains Uppercase characters, do i need to change to it lower case in LTM policy? would that be matched?
- youssef1
Cumulonimbus
It would be match. By default it's not case sensitive.
If you want to enable "case sensitive" you can do IT in options menu (in ltm policy in right)...
- wick54
Nimbostratus
Thanks for the clarification
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