Forum Discussion
matt1985_299432
Nimbostratus
Sep 25, 2017Redirect with URI rewrite setting lowercase URI and removing trailing /
Hi,
I am after some assistance. Essentially I have the requirement to change the URI which is passed to the server. i.e. client requests /content/content server gets /site/path/content/content...
Henrik_Gyllkran
Nimbostratus
Sep 25, 2017How about this:
when HTTP_REQUEST {
set sitepath [string tolower [HTTP::uri]]
if { $sitepath ne [HTTP::uri] }{
The lower case URI differs from HTTP::uri
i.e. the HTTP::uri contains upper case characters
HTTP::redirect $sitepath
} elseif {[HTTP::uri] starts_with "/" } {
HTTP::uri "/site/path$sitepath"
}
if { [HTTP::uri] ends_with "/" } {
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