Forum Discussion

gh0std0g_79292's avatar
gh0std0g_79292
Icon for Nimbostratus rankNimbostratus
Feb 26, 2012

http response - change location

i'm sure this is straightforward, but i'm brand new to f5...

 

 

users on the internet will go to external.domain.com

 

 

 

my iRule has a header replacement statement to replace it with internal.domain.com

 

 

 

now i need to change the server response, because in it, it responds with a location of internal.domain.com which the external user cannot resolve.

 

 

 

so i simply need to know the syntax and logic to change the http location in the response from internal to external... should this be iRule or stream profile? i've tried both to no avail...

 

 

 

thanks

 

  • Location, so you're talking about 301 or 302 responses only? Or do you need to actually change body content?

    If it's just the redirects this should work, or something close to it anyway.

    when HTTP_RESPONSE {
      switch -glob [HTTP::status] {
       "30*" {
        HTTP::header replace Location [string map -nocase {internal.domain.com external.domain.com} [HTTP::header value Location]] 
       }  
      }
     }