Forum Discussion

Jay_Allison_400's avatar
Jay_Allison_400
Icon for Nimbostratus rankNimbostratus
May 22, 2007

URI replace help

quite simply i'm trying to replace certain characters in a URI path with other characters, this was my first stab at it, doesn't seem to be working, any suggestions?

 

 

when HTTP_REQUEST {

 

URI::path [string map {~ ~ZZ % ~} [HTTP::uri]]

 

}

 

 

Tried a few other variations including backslashes and this

 

 

when HTTP_REQUEST {

 

URI::path [string map {~ ~ZZ % ~} URI::path]

 

}

 

 

haven't hit on one one that has worked yet

 

2 Replies

  • Try replacing the uri command with the path command in your string map, then append the query when you set your new uri:

     

     

    HTTP::uri [string map {\~ \~ZZ \% \~} [HTTP::path]][HTTP::query]
  • So I got this to work fine

     

     

    when HTTP_REQUEST {

     

    HTTP::uri [string map {\~ \~ZZ \% \~} [HTTP::uri]]

     

    }

     

     

    but i really only want to affect the URI::path