Forum Discussion
MW1
Cirrus
Jan 08, 2009irule newbie - pointer please!
Hi all,
I'm very new to the irules and have alot to learn so apologies for asking something that I presume is very simple.
I need to restrict access to three URI's these are...
James_Quinby_46
Jan 08, 2009Historic F5 Account
Matt -
This will do the trick:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/user/*" -
"/home/*" -
"/admin/*" {
pool apache
}
default {
discard
}
}
}
You'll want to change the name of the pool up there from 'apache' to whatever is appropriate. The two key bits in here are the 'switch' and 'string tolower'.
There's more info on switch here:
http://devcentral.f5.com/Default.aspx?tabid=63&articleType=ArticleView&articleId=244
...and on Tcl's string manipulation options here:
http://www.tcl.tk/man/tcl8.5/TclCmd/string.htmM49
One consideration might be the display of a 'sorry' page of some kind rather than just discarding the request silently.
(updated - tightened up the matching a little)
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