Forum Discussion

Thomas_McLean_1's avatar
Thomas_McLean_1
Icon for Nimbostratus rankNimbostratus
Nov 25, 2014

iRule URI redirect

Hi all,

 

This has probably been asked 100 times but I can't find anything definitive.

 

I've had a request from one of our service groups that require us masking the URI of a URL. So basically what we need to do is change www.abc.com/Connect/Service.main to www.abc.com.

 

I've been made aware that we cannot do this on the server as it would have to be replicated throughout the web server farm.

 

Does anyone know of a simple iRule that could mask the URL and the end user would only ever see www.abc.com

 

Any help would be appreciated as I am very new to iRules.

 

Thanks,

 

Tam.

 

3 Replies

  • Tam, Do you want the user/client to enter in www.abc.com but the server will see www.abc.com/Connect/Service.main?

     

    Leonardo

     

  • The iRule below will send incoming user request of "www.abc.com" to "www.abc.com/Connect/Service.main" in the back-end server. User will only see the www.abc.com in the web-browser location bar.

    Please note that by using this approach you can only map a single hidden URI to an exact location of "www.abc.com".

    when HTTP_REQUEST {
      if { (([HTTP::host] == "www.abc.com") && ([HTTP::uri] == "/" )) }{
        HTTP::uri "/Connect/Service.main"
      }
    }
    
  • Leonardo,

     

    Yes exactly that but the user will never see the appending /blabla but just the root URL www.abc.com

     

    Hannes,

     

    Thanks, I will look into that iRule and implement it and reply tomorrow when I get to work.

     

    Thanks again for your efforts everyone.

     

    Tam.