Redirect 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 so this appears to work OK I am using IRULE for the request and the response is being re-written with a rewrite profile (stream works too).
The site server side is all lower case I then had a request to change any case to lower as its sent to the server and also remove the trailing '/'. So the logic I have below works fine for this however if you request '/content/cOntent/' this is whats displayed in the browser address bar however the requirements are to display '/content/content'
So I am assuming a redirect is needed to achieve this however i have been have problems making the redirect work but still sending the additional path to the server. The working IRULE without the redirect is below. Is it possible I can get some assistance on how to combine a redirect with server URI rewrite?
when HTTP_REQUEST {
if {[string tolower [HTTP::uri]] starts_with "/" } {
set sitepath [string tolower [HTTP::uri]]
HTTP::uri "/site/path$sitepath"
}
if { [HTTP::uri] ends_with "/" } {
HTTP::uri [string trimright [HTTP::uri] "/"]
}
}
Thanks in Advance.