reldar_76465
Sep 14, 2011Nimbostratus
Allowing access by referrer
Hi,
I have a client who wants to exclusively connect to a web site we created for them. we agreed to do this by identifying the referrer they are coming to our site with.
As they are coming from an https site, I added SSL to our site as well so I can capture the referrer (linking from https to http drops the referrer).
I setup the following rule for this:
when HTTP_REQUEST {
switch -glob [HTTP::path] {
"*/handlers/*" { }
default {
switch -glob [HTTP::header "Referer"] {
"https://www.example.com/*" {
HTTP::redirect "https://www.oursite.com"
}
"www.oursite.com/*" { }
"" { HTTP::respond 403 content "" }
}
}
}
}
the first part with the /handlers/ in the path is because our site is loading itself to load a component in it, this is how I solved this part.
I need a redirect because I want the address to change when going to our site.
this iRule is installed on the virtual server of the https site.
The problem: the redirect is going into a loop. any ideas?
Thanks.