Forum Discussion

ibrahim_37929's avatar
ibrahim_37929
Icon for Nimbostratus rankNimbostratus
Feb 02, 2017

Masking http response with an i rule

Hi When a http request comes to my application server and if the http address is invalid, some informations about application server technology coluld be seen by the users. So I want to hide application server informations for invalid addresses. For example, if "Techxyz" message is seen in response page, I want to write "Your address is invalid" instead of "Techxyz" message. How can I solve the problem with an i rule? Please give me an i rule example

 

1 Reply

  • Hi Ibrahim,

     

    assuming your "invalid" requests result in a non 200 OK Status Code (most likely 404), you could try this small iRule:

     

    when HTTP_RESPONSE {
        if {[HTTP::status] == 404}{
            HTTP::respond 200 content "Invalid AddressYour address is invalid" noserver
        }
    }
    

    Ciao Stefan 🙂