Forum Discussion
Bob_10976
May 20, 2011Nimbostratus
Add a Trailing Slash to the URL
Hello all,
I'm needing to covert an ISAPI rule that adds a trailing slash to the end of a url to an iRule, however the tricky part here is i'll need to add in a few exceptions URLs.
For exampl...
Vova_200520
Altostratus
This is how I do it on v11 (protocol var is from another iRule):
set uri_base [URI::basename [HTTP::path]]
if {$uri_base equals ""} {
The URI::basename is /folder/
} elseif {$uri_base contains "."} {
The URI::basename is *.* file
} else {
HTTP::path "[HTTP::path]/"
HTTP::respond 301 "Location" "${protocol}://[HTTP::host][HTTP::path]"
return
}
Kai_Wilke
Jan 27, 2017MVP
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