Forum Discussion
darrenclegg_199
Sep 09, 2011Nimbostratus
Access restriction to certain URLs
I have a simple iRule to only allow certain URLs access(see below)
when HTTP_REQUEST
{ if { not ([string tolower [HTTP::host]] eq "www.domain.com") }{
drop
HTTP::respond 20...
nitass
Oct 19, 2012Employee
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [class match -- [string tolower [HTTP::uri]] starts_with redirect_class] } {
HTTP::redirect "http://[getfield [HTTP::host] ":" 1]/"
}
}
}
[root@ve10:Active] config b class redirect_class list
class redirect_class {
{
"/123"
"/abc"
"/xyz"
}
}
[root@ve10:Active] config curl -I http://172.28.19.79/abc/something
HTTP/1.0 302 Found
Location: http://172.28.19.79/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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