Forum Discussion
seth_83421
Nimbostratus
Sep 04, 2009How to restrict access to a URL from a different URL
I'm a newbie to iRules, and would like some help please!
I'm wondering how I can restrict access to (for example) www.seagulls.com so it can only be accessed from www.birdwatch.com.
...
Sep 04, 2009
You are heading in the right direction. Your iRule just checks if there is a Referer header. If you want to restrict from a single site, you'll have to check agains the value of the Referer header.
when HTTP_REQUEST {
if { ([HTTP::header "Referer"] ne "www.birdwatch.com") } {
HTTP::respond 200 Content "SORRY, You Can't access this page directly";
}
}
This assumes you have the "seagulls_pool" set as the default pool for the virtual. If not, then add an "else" to the if clause and do the pool assignment there.
-Joe
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