Forum Discussion

Abed_AL-R_26070's avatar
Abed_AL-R_26070
Icon for Nimbostratus rankNimbostratus
Jul 12, 2018

URI rewrite

Hello

We're trying to rewrite a specific word in URI

we're using this irule:

    "/lms/sso*" -
    "/lms/rest/ext/oauth2/token*" {
        pool PLMS_Pool
        HTTP::path "/lmsserver"
        log local0. "setting Path to [HTTP::path] selecting pool PLMS_Pool"

The problem is that this irule is rewriting the whole URI. for example : from to

But we need the URI to be rewritten this way:

how can we do that ?

2 Replies

  • "/lms/sso*" -
    "/lms/rest/ext/oauth2/token*" {
        pool PLMS_Pool
        set newPath "[string map {"/lms" "/lmsserver"} [HTTP::path]]"
        HTTP::path $newPath
        log local0. "setting Path to [HTTP::path] selecting pool PLMS_Pool"
    
  • Hi, you can do this by using these commands:

    "/lms/sso*" -
    "/lms/rest/ext/oauth2/token*" {
        pool PLMS_Pool
        set newPath [string map {"/lms" "/lmsserver"} [HTTP::path]]
        HTTP::path $newPath
        log local0. "setting Path to [HTTP::path] selecting pool PLMS_Pool"