Forum Discussion
Scooter_372595
Nimbostratus
Sep 21, 2018Access Control based on URI and Referer
Hi
I have a situation where I need an Irule to control access to a site I control.
The rules I need are:
a) To allow access based on a uri, eg https://mysite.com/scooter/scooterspagers/* ...
volodh_214395
Nimbostratus
Sep 30, 2018You may use something like this iRule to Allow access to site based on an approved referer header in the request-
when HTTP_REQUEST {
if { ([HTTP::header exists "Referer"]) and
([URI::host [HTTP::header value Referer]] eq "approved-referer1.xxx") } {
Allow Request to go throutht...
}
elseif { ([HTTP::header exists "Referer"]) and
([URI::host [HTTP::header value Referer]] eq "approved-referer2.xxx") } {
Allow Request to go throutht...
} else {
HTTP::redirect https://www.xxx.com
}
}
I'm using redirect to some web page if connection is not from approved referer1 or referer2 but it can be modified to another action. I hope it helps.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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