Forum Discussion

Keegan_49855's avatar
Keegan_49855
Icon for Nimbostratus rankNimbostratus
Nov 05, 2008

URL Rewrite to lowercase letters

DevCentral,

 

 

I'd like help writing a URI rewrite clause that will find any capitolized characters and rewrite them to lowercase befroe redirecting the users using an LTM iRule. Alternatively, if there is a way to remove case-sensitivity from the iRule processing that would be usable as well.

4 Replies

  • Just use the string tolower command.

     
     [string tolower [HTTP::uri]] 
     

    Denny
  • I think IIS/.net is (or can be?) case sensitive for parameters, so it might be better to just rewrite the path to lowercase:

     
     when HTTP_REQUEST { 
      
         Set the path to lowercase when sending the request to the pool 
        HTTP::path [string tolower [HTTP::path]] 
     } 
     

    Aaron
  • Hello, Is there any way to do lowercase for specific url....For ex:- I want to develope an irule for "http://aspace.myblock.com". If any user type this url in lower or upper case is should redirect in lowercase only.....

     

  • Hello guys, Ihad come with a irule which is working properly..

     

    when HTTP_REQUEST { if { [HTTP::host] equals "www.joe.com" and [HTTP::uri] starts_with "/net/myjoe" } { HTTP::redirect "http://[HTTP::host][string tolower [HTTP::uri]]" } }