Forum Discussion

kend's avatar
kend
Icon for Altostratus rankAltostratus
Sep 10, 2013

URL Redirect iRule Question

Can anyone tell me if the action below is possible using an iRule or some other method on the LTM?

 

User connects to www1.abc.com. The LTM redirects this to abc.corp.com. But, the user still needs to see www1.abc.com in their browser bar even thogh they have been redirected to abc.corp.com.

 

15 Replies

  • kend's avatar
    kend
    Icon for Altostratus rankAltostratus

    The reason for the redirect is that www1.abc.com is owned by a company that we purchased and we are trying to migrate the users off of the web server without too much disruption to the users. www1.abc.com is in that company's IP block and abc.corp.com is in our IP block. That is why we are redirecting.

     

  • RickM's avatar
    RickM
    Icon for Nimbostratus rankNimbostratus

    Sending a redirect tells the browser to go ask someone else. You'll then see that host in the browser's bar. If you want www1 to appear in the bar, you'll have to accept requests and send replies from www1 instead of redirecting it somewhere else.

     

  • kend's avatar
    kend
    Icon for Altostratus rankAltostratus

    Yes, I understand that. But www1.abc.com needs to still resolve to the existing public IP until we can migrate the DNS over to our IP. So, in that interim, we wanted to keep www1.abc.com in the browser bar but have the connection actually be to abc.corp.com on the LTM.

     

  • RickM's avatar
    RickM
    Icon for Nimbostratus rankNimbostratus

    Kevin Stewart had a good answer for that, but maybe the stream/proxypass stuff distracted you.

     

    To re-state his answer:

     

    virtual: www1.abc.com

     

    pool: contains abc.corp.com server

     

    no redirects. Browse the site as www1.corp.com. Is anything broken? Can it be fixed on the back-end, within the web application? No? Then you need to try to use stream or proxypass to rewrite URLs within the http conversation so that the app works properly.

     

  • The problem is this:

     

    www1.corp.com resolves to a public IP address and a server that (I assume) sits somewhere else (at least it doesn't go through the LTM).

     

    Your VIP has a separate public IP address. Because the users are external to your environment, the only real control you have is via DNS and address resolution. www1.corp.com resolves to one physical address and your VIP resolves to another, and you can't have www1.corp.com resolve to your VIP unless you're actually taking it over. You simply cannot have the browser show www1.corp.com in the address bar but be going to your VIP (a different URL). You could:

     

    1. Flip DNS to point to your VIP and have the traffic pass through the LTM to get to the original server (least intrusive method).

       

    2. Have the original server redirect to a URL that is only subtlety different.

       

    3. Or simply have the original server redirect to a NEW (and improved) URL.