Forum Discussion

jmolchin_47123's avatar
jmolchin_47123
Icon for Nimbostratus rankNimbostratus
Nov 07, 2013

URL Redirect

Want to rewrite the source URL. Is the syntax correct?

 

when HTTP_REQUEST { if { "[HTTP::host]" equals “http://port80.port.com”} { HTTP::redirect "https://port80.port.com:8040/OA_HTML/AppsLocalLogin.jsp" }}

 

4 Replies

  • Pretty close:

    when HTTP_REQUEST {     
        if { [string tolower [HTTP::host]] equals “port80.port.com” } {          
            HTTP::redirect "https://port80.port.com:8040/OA_HTML/AppsLocalLogin.jsp" 
        }        
    }
    
  • Something is still wrong in line two. I'm getting the following..

     

    01070151:3: Rule [/Common/http-to-8040] error: line 2: [parse error: PARSE syntax 71 {syntax error in expression " [string tolower [HTTP::host]] equals “port80.port.com...": unexpected operator &}] [{ [string tolower [HTTP::host]] equals “port80.port.com” }]

     

  • Your problem is due to quotes.

     

    Replace them with real quotes, same than those before and after your https url and it will work.