Forum Discussion
Tosin_Omojola
Altostratus
Oct 21, 2016Grant Access To Users Based on Referer Header Value
I want to grant access to users based on a referrer value and to redirect them to login if the referrer is invalid. This is not meant to be a security fix though, it is just to ensure users access th...
Tosin_Omojola
Altostratus
Oct 25, 2016This is the final solution that worked:
I created another VS 10.10.1.60 ( and a subdomain that points to the IP) and added this iRule to it:
when HTTP_REQUEST {
set referrer_host [URI::host [HTTP::header value Referer]]
if { ($referrer_host ne "") and ($referrer_host eq "click.sbank.com") } {
if { [string tolower [HTTP::uri]] ends_with "/eod" } {
HTTP::redirect "http://pam.banks.com/eod"
} elseif { [string tolower [HTTP::uri]] ends_with "/" }{
HTTP::redirect "http://pam.bank.com"
}
} else { HTTP::redirect "http://click.bank.com/index.php?resp_id=MLG"}
}
Then, on the main VS hosting the resource pam.banks.com, the normal iRule remains.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] ends_with "/eod" } {
HTTP::redirect "http://10.10.1.51:9001/forms/frmservlet?config=ref&serveruserparams=NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256&otherparams=P_WST_LAN_IND=1+P_BANKS_APP_URL=http://10.10.1.51:9001/banks"
} elseif { [string tolower [HTTP::uri]] ends_with "/" }{
HTTP::redirect "http://pam.bank.com:9001/forms/frmservlet?config=ref&serveruserparams=NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256&otherparams=P_WST_LAN_IND=1+P_BANKS_APP_URL=http://10.10.1.57:9001/banks"
}
}
That delivers the desired solution...
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
