Forum Discussion

Pirlo's avatar
Pirlo
Icon for Nimbostratus rankNimbostratus
Aug 21, 2009

URI Redirect

Usually my research of past posts yield whatever answers I need. But in this case I need a second set of eyes.

 

 

 

HTTP requests will come in as 2 different formats.

 

 

1. http://domain.com/application

 

2. http://domain.com/joeuser

 

 

If a request matches "application" i need to ignore it. But the CAVEAT is the redirect I am sending back contains the "application" URI. Logically that means the next HTTP request from that user SHOULD BE IGNORED I THINK

 

If anything else comes in the URI path, then redirect to URI path and append the end of the redirect with what the original URI request was.

 

 

So whether the HTTP URI is /joeuser or /Devcentralrocks - I need it to append that to the end.

 

 

 

And this is my syntax

 

 

when HTTP_REQUEST {

 

if { not ([HTTP::uri] starts_with "/application") } {

 

HTTP::redirect "https://domain.com/application/jsp/initial/GMCLanding.jsp?id=[HTTP::uri]"

 

}

 

}

 

 

 

 

Am I overcomplicating or thinking to much into this?

3 Replies

  • That looks fine per the description you've provided. Have you tried using it?

     

     

    Aaron
  • Pirlo's avatar
    Pirlo
    Icon for Nimbostratus rankNimbostratus
    I am stuck with a application team that has no QA or test environment.

     

    I created a host file entry on my box to resolve the actual domain. And then ran tcpdumps to see the http level ingress and egress traffic.

     

    User Initiates >>> port 80 VIP >>> Clent Redirection with URI appends on return >>> User return traffic >>> Port 443 VIP >>> then server side into the abyss.

     

    With no test or QA I was wanting some feedback if it looked sound or not.

     

    So what I learned is that the IRULE Editor is real!!! I remember the buzz a year or so ago but never tracked it down. Irule editor says its OK.

     

    Thanks for taking the time to respond.
  • If you don't have a test environment, you can create a test virtual server which points to the production pool. With a hosts file entry pointing to the test VS address, you can test without affecting the production virtual server.

     

     

    Aaron