Replace URI (wildcard) with null
Ive been searching around the last couple days and haven't been able to find a good solution to this yet. I tried to accomplish it with sting map so I wouldn't have to use regex but it doesn't seem to support wildcards. I am new to writing an irule in regex and want to see if they community could assist with this rule and had a better idea how to write it.
My iRule is as follows:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] contains "\/@v=" } {
set uri [HTTP::uri]
regsub [\/@v=.*@" $uri "" url2]
HTTP::uri $url2
}
}
When web requests come in as mydomain.com/foo/@v=-1654270807@/bar/123/foo123/pic.jpg I need to strip out /@v=-0123456789@ so my webserver can handle the request. What I am finding difficult to solve is the number 0123456789 can be any number. Any ideas on how I could accomplish this? I would prefer not to use redirects also.