Forum Discussion
Anderson__Eric_
Nimbostratus
Jun 29, 2007Trailing / in URI
We're new to the F5 devices and coming up to speed, painfully. One issue we're having is we have a public URL that is accessed by our users and customers.
The issue at hand is if anyone d...
dennypayne
Employee
Jun 29, 2007Not sure if concat is valid, but you could just redirect them after the initial logic and add the trailing slash like this:
when HTTP_REQUEST {
Get URI and convert to lowercase
set uri [string tolower [HTTP::uri]]
Log the lowercase URI
log local0. "lowercase uri: $uri"
Find out if there is a period in the URL stopping when it sees a ?
if { [findstr $uri "." 0 "?"] eq "." }{
do nothing -- not ending in a virutal directory, URI syntax is good.
log local0. "URI is not a directory"
}
elseif { not ($uri ends_with "/") }{
HTTP::redirect http://[HTTP::host][HTTP::uri]/
}
}(might need to double-check my brackets there)
That way if they bookmark the page it should end up with the slash in it.
Denny
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
