Forum Discussion

Merlin_kv_17750's avatar
Merlin_kv_17750
Icon for Nimbostratus rankNimbostratus
Jun 17, 2015
Solved

Redirect without path rewriting

Hello,

 

A company wants to use local link accessing public resource, but after redirect url path shouldn't change to external and stay local. Another words, it is possible dynamically rewrite public url into local, so users work with remote site as with local?

 

  • Yep, it can be done

    when HTTP_REQUEST {
    
      if { ( [HTTP::host] == "fqdn.clientside.int" ) && ( [HTTP::path] == "/" ) }{
        HTTP::host "www.foo.com"  Rewrite the HTTP Host header value, before routing the request to a pool-member.
        HTTP::path "/blabla"  Rewrite the request path (Use if path masking is needed).
      }
    }
    

6 Replies

  • Yep, it can be done

    when HTTP_REQUEST {
    
      if { ( [HTTP::host] == "fqdn.clientside.int" ) && ( [HTTP::path] == "/" ) }{
        HTTP::host "www.foo.com"  Rewrite the HTTP Host header value, before routing the request to a pool-member.
        HTTP::path "/blabla"  Rewrite the request path (Use if path masking is needed).
      }
    }
    
    • Hannes_Rapp's avatar
      Hannes_Rapp
      Icon for Nimbostratus rankNimbostratus
      This solution is a feasible option if the public webside is an applet, or a HTML website with relative hyperlinks only. If it's a HTML website which includes full links (containing original Host value), it will not be enough.
  • Yep, it can be done

    when HTTP_REQUEST {
    
      if { ( [HTTP::host] == "fqdn.clientside.int" ) && ( [HTTP::path] == "/" ) }{
        HTTP::host "www.foo.com"  Rewrite the HTTP Host header value, before routing the request to a pool-member.
        HTTP::path "/blabla"  Rewrite the request path (Use if path masking is needed).
      }
    }
    
    • Hannes_Rapp_162's avatar
      Hannes_Rapp_162
      Icon for Nacreous rankNacreous
      This solution is a feasible option if the public webside is an applet, or a HTML website with relative hyperlinks only. If it's a HTML website which includes full links (containing original Host value), it will not be enough.