Forum Discussion
Irule with URI redirect works but keeps sending to old link
I have a working irule that does a URI redirect to another site but if by chance someone has the old link it continues to send it to the original URL if they put some other characters in it, like for tracking purposes from old code.
Below is what I have with a data class. I figured there might be a way to redirect regardless of any tracking link that might be cached somewhere on the net.
Thanks for any advice or help.
Data Group name = uri-redirect
Data Group = /stuff: = https:/someplace.com
Irule
Determine if you are trying to go to a site that has a URL
which looks at "uri-direct "data class and does not find anything in the "other-variables" Data Class. The problem is there must be old links out there so when they go to the old uri and put in a random characters’ it does not redirect.
if {([class match [string tolower [HTTP::uri]] eq uri-redirect]) and not ([class match [string tolower [HTTP::header User-Agent]] contains other-variables])}{
HTTP::redirect [class match -value [string tolower [HTTP::uri]] eq uri-redirect]
} else {
Do nothing
- Kevin_Stewart
Employee
Are you talking about extra characters "/stuff"?
Recent Discussions
Related Content
* 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