Remap the context/path of the URL

hi All,

please help me with iRule that will remap my URL like that: from to

so basically i want to get rid if first folder from the URL.

Regards

Hello,

If the /service_name/ is not changing, you can use the following command to do it

when HTTP_REQUEST {

    if { [string tolower [HTTP::path]] starts_with "/service_name/" } {
            log local0. "Old path: [HTTP::path]"
            HTTP::path [string map -nocase { /service_name/ / } [HTTP::path] ]
            log local0. "New path: [HTTP::path]"
       }
}

Hope it helps

Waiting for your feedback

Regards