Forum Discussion

ebowers_25830's avatar
ebowers_25830
Icon for Nimbostratus rankNimbostratus
Jul 08, 2013

URL rewite but keep uri is some cases

Sorry if this has been covered before but the seaches I have done have not returend any examples that I can use.

 

I am trying to redirect a url like www.xyx.com/log.nsf to connect-us.xyz.com/log.nsf

 

 

It can be anything after the "/" we want to keep

 

but if nothing after "/"then a redirect to https://connect-us.xyz.com

 

 

Should be simple but I have not gotten this one right yet

 

Thank you

 

 

Ed

 

5 Replies

  • Try this:

    
    when HTTP_REQUEST {
         if { [string tolower [HTTP::host]] equals "www.xyz.com" } {
              "https://connect-us.xyz.com[HTTP::uri]"
         }
    }
    

    Though the browser doesn't show it, there's ALWAYS a URI - even if it's just "/".

  • Was not able to get desired result

     

    The url remains as www.

     

     

    We are using F5 to IIS to a domino web page( IIS is the http stack for domino in this case).

     

    A couple of interacting isapi filters also comming into play here.

     

    If we can trigger the url line displayyed and sent as part of the header, we hope to allow IIS to folward via a asp redirect in cases nothing is sent after the /

     

    but if /log.nsf or any other .nsf is sent then the asp redirect will not inter act.

     

     

     

    Also looking at modifiy asp file to handle proper redirection.in place of using Irule

     

  • Crud, mistyped the iRule example:

    
    when HTTP_REQUEST {
         if { [string tolower [HTTP::host]] equals "www.xyz.com" } {
              HTTP::redirect "https://connect-us.xyz.com[HTTP::uri]"
         }
    }
    
  • Or do you mean:

    
    when HTTP_REQUEST {
         if { ( [string tolower [HTTP::host]] equals "www.xyz.com" ) and ( [HTTP::uri] equals "/" ) } {
              HTTP::redirect "https://connect-us.xyz.com"
         }
    }