Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in creating iRule to deny a specific URL and allow all others.

ravi_atc
Nimbostratus
Nimbostratus

Hi All,

I am new to F5 devices, no experience in creating iRules at all.

The application is hosted (www.example.com) and the traffic is being load balanced using Virtual Servers.

I have a requirement to block a specific URL/path i.e. https://www.example.com/admin/ for all the incoming requests and allow all other paths on this URL.

This can be done using iRule but i am not sure on the iRule syntax to be used.

Any help would be highly appreciated.

2 REPLIES 2

Hi @ravi_atc , you can try below irule syntax.

 

When HTTP_REQUEST { if { ([HTTP::host] eq "www.example.com") and (([string tolower [HTTP::uri]] eq "/admin")) } { reject } }

You can also achieve it using LTM policy.

 

Hope it helps!

 

Hi Mayur,

Thank you for the help, since we are in a production environment, i will recommend the given code to the team, will let you know once it gets implemented.