Forum Discussion
Stanislas_Piro2
Sep 25, 2017Cumulonimbus
Hi,
you can try this code:
when HTTP_REQUEST {
Convert path to lowercase and remove first and last /. prepend a / (to prevent "/" removed)
use path instead of uri to prevent query string blocking path transformation.
the general behavior when converting to lower case is to keep query string case
set new_path "/[string trim [string tolower [HTTP::path]] "/"]"
Add /site/path if starting with /content
if {$new_path starts_with "/content/"} { set new_path "/site/path$new_uri" }
Append query string if exists
if {[HTTP::query] ne ""} {set new_uri $new_path?[HTTP::query]} else {set new_uri $new_path}
if { $new_uri ne [HTTP::uri] } {
if the new path is different to request path, redirect to new uri
HTTP::redirect $new_uri
}
}