Forum Discussion
MikeBrockbank_3
Nimbostratus
Oct 15, 2018Need 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
- iaine
Nacreous
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] /] }
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects