Forum Discussion
Rajesh_74831
Nimbostratus
Nov 12, 2014Want to remove "/" at the end of uri
Hi All,
We wanted to create an irule which should remove "/" from the uri.
Something like if user tries /">http://abc.com/xxxx/ it should be redirected to http://abc.com/xxxx .
I tried...
shaggy
Nimbostratus
Nov 12, 2014I think "string trimright" is what you need instead of "string map"
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] ends_with "/" } {
HTTP::redirect http://[HTTP::host][string trimright [HTTP::uri] "/"]
}
}
note - this currently also matches a lone "/", so http://abc.com/ will be redirected to http://abc.com
Do you want to redirect the user to the new URI or pass the modified URI to the pool member?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
