Forum Discussion

simpsjy_181842's avatar
simpsjy_181842
Icon for Nimbostratus rankNimbostratus
Sep 23, 2016

Need help redirecting a mixed case URI

I am trying to redirect http://onestop.uc.edu/classes/ViewClassOfferings1.html to http://onestop.uc.edu/classes/ViewClassOfferings.html. But because of the mixed cased page name, Tolower and Toupper don't work. Any help would be appreciated.

 

1 Reply

  • Hi Simpsjy,

    if you're required to evaluate incomming HTTP requests with a [string tolower] syntax, then you have to make sure that your rule set is also defined with tolower formated syntax...

    when HTTP_REQUEST {
        if { [string tolower [HTTP::host]] equals "onestop.uc.edu" } then {
            if { [string tolower [HTTP::path]] equals "/classes/viewclassofferings1.html" } then {
                HTTP::redirect "http://onestop.uc.edu/classes/ViewClassOfferings.html"
            }           
        }       
    }
    

    Cheers, Kai