Landing URI iRule HTTP redirection
Hi all,
I'm working on a small iRule be executed if a user has tried to hit the root uri for a remote access site I am setting up (eg. http://host.co.uk/). The expected behaviour is, if someone hits the root I have a logon page set up with radio buttons to select different domains which have different Landing URI's. The user will select the radio button and a session variable is generate (session.last.logon.domain) which contains the landing URI for that domain. After this the iRule is triggered and they are redirected to the correct uri (eg. https://host.co.uk/blah).
This question has a very similar scenario to myself, but mine is a lot simpler I think since I am only concerned with the redirection and the Landing URI VPE object which is before this performs the required logic to filter out the legitimate requests, meaning the iRule has no need to analyze the URI, since the iRule trigger will be the 'fallback' of the Landing URI object.
Here is my current iRule...
when ACCESS_POLICY_AGENT_EVENT {
set path [ACCESS::session data get session.logon.last.domain]
ACCESS::session remove
HTTP::redirect "https://host.co.uk/$path/"
}
The current behaviour when I go down the path to trigger this iRule is that it seems to go back to the landing page "/my.logon" with a dead screen. Pretty much what you'd expect when "ACCESS::session remove" is triggered, but the redirection is not occurring.
Any ideas?
Managed to solve the issue without the iRule or Variable assignment to session.server.landinguri.
All I needed to do was created a Redirect ending and it performs the redirect to the beginning of the policy with the desired uri appended to the end and closes the existing session.
Perfect!