Forum Discussion

conradberg_1034's avatar
conradberg_1034
Icon for Nimbostratus rankNimbostratus
Jan 28, 2010

stripping the beginning / from uri

I need an I rule that will only take affect if the is no "." in the uri, take a url like this:

 

http://test.com/test and make hit the server like this:

 

http://test.com/Default.aspx?=test

 

 

This almost works:

 

when HTTP_REQUEST {

 

if { not ([HTTP::uri] contains ".") } {

 

HTTP::uri "/Default.aspx?=[HTTP::uri]"

 

 

}

 

}

 

but I end up with this:

 

http://test.com/Default.aspx?=/test

 

 

I need to replace Default.aspx?=/ with Default.aspx?=

 

 

What is the simplest solution for this?

1 Reply

  • Hi Conrad,

    Here is something that might work

      
      when HTTP_REQUEST {  
         if {[HTTP::uri] ne "." } {  
          set uri_string [string tolower [string range [HTTP::path] 1 end]]  
          HTTP::uri "/Defaut.aspx?=$uri_string"  
          }  
      }  
      

    Bhattman