Forum Discussion

smilanko_261688's avatar
Jun 08, 2016

Edit the url before forwarding to an application

Here is a picture of my current access policy

What I am trying to do is edit the http request uri to forward client requests to a particular uri, no matter on what uri they already selected. Ex:

    Client enters url: https://10.10.10.10/cool/app/admin

    F5 rewrites to:    https://10.10.10.10/cool/home

my redirect_to_url action is an irule event, that looks like the following:

`when ACCESS_POLICY_AGENT_EVENT { 
        log " before it was [HTTP::host][HTTP::uri]"
        HTTP::uri /cool/home
        log " after it was [HTTP::host][HTTP::uri]"
    }`

However, the issue i am having is that the url is never rewritten at the right stage. my logoutput shows the following:

`before it was 10.10.20.191/renderer/agent_irule_event_form.eui `

`after it was 10.10.20.191/cool/home `

While this seems to work, the final uri is set to that of the original: cool/app/admin

What else must I do to ensure that uri rewriting is as close as possible to the final request?

  • Hi,

    You can reassign the redirect url variable like this with a variable block

    session.policy.result.redirect.url -> return "/cool/home"

    There is no need to use iRule event with ACCESS_POLICY_AGENT_EVENT

  • Hi,

    You can reassign the redirect url variable like this with a variable block

    session.policy.result.redirect.url -> return "/cool/home"

    There is no need to use iRule event with ACCESS_POLICY_AGENT_EVENT

  • Hi,

    You can reassign the redirect url variable like this with a variable block

    session.policy.result.redirect.url -> return "/cool/home"

    There is no need to use iRule event with ACCESS_POLICY_AGENT_EVENT