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...
hooleylist
May 26, 2011Cirrostratus
Hi Anish,
You could either check the Referer header on the www.xyz.com.xx virtual server. Or you could append the original host and URI to the redirect as a query string parameter:
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]]"
}
}
Aaron
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