iRule subdirectory to hostname with URI

I am using subdirectories,

I would like to go from:

subdirectory “/catpics” to redirect to "; which is easy, but I want anything following /catpics to go as well.

ex: http(s)://myhost.com/catpics/baddog to go to ";

or http(s)://myhost.com/catpics/baddog/puppies to go to ";

I do not want it to go to "; - that would be easy

How do I eliminate the “catpics” from [HTTP::uri]

Thanks!

You could use “string range”. please see iRules 101 - 14 - TCL String Commands Part 2 for an explanation.

As catpics is a fixed length then something like

set newuri [string range $uri 8 end]

might work.

Hope this helps,

N