Forum Discussion

F5_LB_Eng's avatar
F5_LB_Eng
Icon for Cirrostratus rankCirrostratus
Oct 18, 2011

redirect to 403 - Access Forbidden irule

Hi All,

 

 

i need urgent help on creating one irule .

 

 

the requirement is below

 

 

if the request is coming with the url prodabc.in.svcs.ad.com/console or /em

 

we need to redirect to 403 - Access Forbidden

 

 

i am not good irule ,could any please help on this request.

 

 

Thanks

 

  • Something like this should work:

    
    when HTTP_REQUEST {
    if { ([HTTP::uri] starts_with "/console") or ([HTTP::uri] starts_with "/em")}{
    HTTP::respond 403
    }
    }
    
  • And reference this page for more info:

     

     

    http://devcentral.f5.com/wiki/iRules.HTTP__respond.ashx
  • Brain,

     

     

    we can use contains instead of starts_with...

     

     

    Regards

     

    Prasanna
  • we can use contains instead of starts_with... yes, you can.

     

     

    anyway, if url is prodabc.in.svcs.ad.com/console, HTTP::host is uri is prodabc.in.svcs.ad.com and HTTP::uri is /console.