Forum Discussion

MikeBrockbank_3's avatar
MikeBrockbank_3
Icon for Nimbostratus rankNimbostratus
Oct 15, 2018

Need to Remove Slash at the End of a Redirect

I need to add to this iRule so that it will remove the slash that might be placed at the end of the uri (Android version of the app is adding a slash and breaking the app. iOS version does not add slash and works fine).

 

when HTTP_REQUEST { if { [HTTP::uri] starts_with "/HELP/storage" } { set newpath [HTTP::host][string map {"/HELP/" "/"} [HTTP::uri]] HTTP::redirect "https://$newpath" } }

 

1 Reply

  • Hi

    Have you tried tidying up the path before sending it on to the servers, doing something like this

     if {[HTTP::uri] ends_with "your_path/"} {
     HTTP::uri [string trimright [HTTP::uri] /] 
    }