Forum Discussion

jostar_7866's avatar
jostar_7866
Icon for Nimbostratus rankNimbostratus
Oct 27, 2014

Is there a way to rewrite/translate the links with the contents of a web page?

We are using APM to publish SharePoint externally (using the url Https://sharepoint.company.com), however there are links within the SharePoint content/pages which reference our internal URL (Http://sharepoint). Is there a way for the F5 to translate the content of these links to the external URL, as we were able to within Microsoft's ISA product?

 

1 Reply

  • This a is part of the irule we use for SP2013 with APM. Assign an stream profile to the virtual server and an irule similar to the one shown below

    Greets Michael

    when HTTP_REQUEST_RELEASE {
    
            Disable the stream filter for all requests by default
           STREAM::disable
    
            LTM does not uncompress response content, so if the server has compression enabled
            and it cannot be disabled on the server, we can prevent the server from 
            sending a compressed response by removing the compression offerings from the client
           HTTP::header remove "Accept-Encoding"
    
           if {[info exists stream_expr]}{ unset stream_expr }
    
                 This we want replace 
                set stream_expr "@http://sharepoint@https://sharepoint.company.com@"                            
                 make sure we have a var to crosscheck before we enable the rewrite in the response
                set SPresponse 1     
        } 
    }
    
    when HTTP_RESPONSE {
    
        nable the rewrite to fix the hostnames
       if {[info exists SPresponse]}{
    
            Check if response type is ...
           if {[HTTP::header value Content-Type] contains "application/json" || [HTTP::header value Content-Type] contains "text/html" || [HTTP::header value Content-Type] contains "text/xml"}{           
    
               if {[info exists stream_expr]} { 
                 STREAM::expression $stream_expr 
                 STREAM::enable
    
               }
           }
       }
    }