Forum Discussion

Austin_Geraci_1's avatar
Austin_Geraci_1
Icon for Nimbostratus rankNimbostratus
Mar 13, 2007

Redirect Problem

I just want to do a basic redirection;

 

 

www.mydomain.com

 

 

www.mydomain.com/directory1/directory2

 

 

When I use the syntax below I get;

 

 

www.mydomain.com/www.mydomain.com/directory1/directory2

 

 

How Can I get rid of that initial uri??

 

 

Thanks!

 

 

 

 

when HTTP_REQUEST {

 

if { [HTTP::uri] eq "/" } {

 

HTTP::redirect "www.mydomain.com/directory1/directory2/"

 

}

 

}

 

 

3 Replies

  • If you don't include the protocol in the redirect the browser assumes appends the new redirect value to the URI is just requested. If you add http:// or https:// to the redirect it should work fine:

    
    when HTTP_REQUEST {
       if { [HTTP::uri] eq "/" } {
          HTTP::redirect "http://www.mydomain.com/directory1/directory2/"
       }
    }

    Aaron
  • Great, I actually found some doc on this last night, i appreciate your quick response!

     

     

    Are there any specific books on iRules? Or am I just going to find TCL books? Either way, can you point me to some recommended literature?? Or is DevCentral as good as it gets right now??

     

     

    Thanks!
  • That's good to hear.

     

     

    There aren't any books on iRules. You can get more information on iRules from a few resources:

     

     

    The iRule wiki on DC (Click here)

     

    The LTM configuration guides on AskF5 (Click here)

     

    The TCL manual for standard TCL commands/syntax (Click here)

     

    And of course the posts in this forum, the codeshare, blogs and guides on DC.

     

     

    Aaron