Forum Discussion

Rodrigo_Mori_13's avatar
Mar 23, 2018

irules URL redirect

Hello people

 

I have an application running apache.

 

The app responds by URL http://app1example.com/example/url.pl

 

I need to create a redirect in F5, which to the digital URL http://app1example.com, it does the redirect to the URL http://app1example.com/example/url.pl

 

I made the irules as follows:

 

when HTTP_REQUEST { if {[HTTP :: path] eq "/"} { HTTP :: redirect "; } }

 

But it's not working. What can it be ?

 

4 Replies

  • oguzy's avatar
    oguzy
    Icon for Cirrostratus rankCirrostratus

    Hi Rodrigo,

    When you try to create this irule, you should get an error like [undefined procedure: HTTP][HTTP :: path]. The same issue happens also for HTTP :: redirect. You just discard the blanks after and before colons, then it should work.

    when HTTP_REQUEST {  
       if {[HTTP::path] eq "/"} {     
          HTTP::redirect "http://app1example.com/example/url.pl";   
       }
    }
    
  • Hi Rodrigo,

    When you try to create this irule, you should get an error like [undefined procedure: HTTP][HTTP :: path]. The same issue happens also for HTTP :: redirect. You just discard the blanks after and before colons, then it should work.

    when HTTP_REQUEST {  
       if {[HTTP::path] eq "/"} {     
          HTTP::redirect "http://app1example.com/example/url.pl";   
       }
    }