samigo_81875
Sep 03, 2013Nimbostratus
Search replace uri
Hi,
I want to search replace using regex
/content/learning//production
TO
/content/learning/production
Tried below but the regex doesn't work
if { [URI::decode [string tolower [HTTP::uri]]] matches_regex "/content/learning/(.*)/production" } {
set replaceURI [string map [list "learning/(.*)/production" "learning/production" ] [HTTP::uri]]
log local0. "REPLACE --> $replaceURI"
HTTP::respond 307 noserver Location "https://myserver.com$replaceURI"
}
Appreciate your help