Forum Discussion

Pete_Paiva_7147's avatar
Pete_Paiva_7147
Icon for Nimbostratus rankNimbostratus
Apr 02, 2013

Insertion of character into URL

 

Need some help creating an iRule to add a "," into the URL, if possible

 

 

URL before example:

 

https://www.mysite.com/folder/share/parameter?test=subfolder=folder2

 

 

URL after example: (insert a comma after = and before subfoler)

 

https://www.mysite.com/folder/share/parameter?test=,subfolder=folder2

 

 

 

 

2 Replies

  • Hello,

     

    Depends on your wishes you can redirect client on fixed URI

     

     

    if { [HTTP::query] contains "test=subfolder" } {

     

    HTTP::redirect [string map {"test=subfolder" "test=,subfolder"} [HTTP::uri]]

     

    }

     

     

    or you can add comma in to query before sending request to backend

     

     

    if { [HTTP::query] contains "test=subfolder" } {

     

    set fixed_query [string map {"test=subfolder" "test=,subfolder"} [HTTP::uri]]

     

    HTTP::uri $fixed_query

     

    }