Forum Discussion

Bill_Stromatos_'s avatar
Bill_Stromatos_
Icon for Nimbostratus rankNimbostratus
Sep 21, 2009

Rewrite Question

I am trying to figure out the whole TCL thing, I am attempting to do an http redirect. I have a user that whats to use a simpler string to query our service desk application.

 

 

Incoming request is http://change.corp.intranet/c1111

 

 

Here is the TCL script I have now.

 

 

when HTTP_REQUEST {

 

HTTP::redirect "https://servicedesk.corp.intranet/CAisd/pdmweb.exe?OP=SEARCH+FACTORY=chg+SKIPLIST=1+QBE.EQ.chg_ref_num=[HTTP::uri]"

 

}

 

 

 

What I am seeing is an extra \ being added just before the [HTTP::uri] so it looks like this in the system.

 

 

https://servicedesk.corp.intranet/CAisd/pdmweb.exe?OP=SEARCH+FACTORY=chg+SKIPLIST=1+QBE.EQ.chg_ref_num=/c1111

 

 

What can I do to eliminate the extra / from being added to the redirect?

 

 

Thanks!
  • You can write it up as

     
     when HTTP_REQUEST { 
       if {[HTTP::host] eq "change.corp.intranet" } { 
             http::redirect "https://servicedesk.corp.intranet/CAisd/pdmweb.exe?OP=SEARCH+FACTORY=chg+SKIPLIST=1+QBE.EQ.chg_ref_num=[URI::basename [HTTP::uri]]" 
          } 
     } 
     

    You can find more info about URI by

    Click here

    I hope this helps

    CB