Forum Discussion
Anish_Srivastav
May 25, 2011Nimbostratus
301 redirect tracking
We have a situation where we want to redirect all users hitting a virtual server to another virtual server and be able to track those redirects.
For e.g.
If a user requests ], we want to be able to redirect to ], which is easily achievable through an iRule, however is it possible to be able to pass a server variable or another method to the request so, that we are able to track somehow that the user initially requested ] and was then redirected to ?
Regards,
Anish
- hooleylistCirrostratusHi Anish,
when HTTP_REQUEST { Redirect all requests to a new URL with the host appended to the redirect If there is no query string already append the url parameter to the path with a ? if {[HTTP::query] eq ""}{ HTTP::redirect "http://www.xyz.com.xx[HTTP::uri]?url=[HTTP::host][URI::encode [HTTP::uri]]" } else { There was a query string already so append the url parameter to the existing query string with a & HTTP::redirect "http://www.xyz.com.xx[HTTP::uri]&url=[HTTP::host][URI::encode [HTTP::uri]]" } }
- Anish_SrivastavNimbostratusThanks Hoolio
- hooleylistCirrostratusYou won't be able to set a cookie as the client is requesting to one domain and being redirected to a new domain. If the referer isn't set for this scenario, I think a query string parameter is your best option.
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