Forum Discussion

Richard_Jones_1's avatar
Richard_Jones_1
Icon for Nimbostratus rankNimbostratus
Nov 01, 2005

Replacing http with https in html content

Hello All,

 

 

I am trying to fix links in an html file sent to a user.

 

 

The user connects to https://smart.company.com:8008 and logs in.

 

After logging in, the html file the user receives has the link to the .css file and other links in the html document point to http://smart.company.com:8008/...

 

 

We can see the text in the html page, but the graphics are missing, because the css and image url's are incorrect.

 

 

I have tried using a Stream profile with http and https in the fields, but I don't see any change in the html the user receives.

 

 

I then tried to use the Credit Card example for scrubbing and replacing text, but again no change in seen.

 

 

I then tried to use TCP::payload and replace, which failed as well.

 

 

Is one of these the correct way to approach this problem, or should I take another look at it?

 

 

Thanks!!

 

 

-Richard

 

 

Here is the html I am trying to change:

 

 

 

 

 

 

 

 

 

 

 

 

 

  • I figured it out. The web server was zipping the html before sending it. The Big-IP couldn't see into the zipped data to change http to https. I used an HTTP::header remove Accept-Encoding statement in an HTTP_REQUEST action to stop the web server from zipping the data. Now the Big-IP can see the html, and a stream profile changes the http to https. Works beautifully now....
  • bl0ndie_127134's avatar
    bl0ndie_127134
    Historic F5 Account
    Be sure to use the 'response rechunk' http profile option to ensure that the chunked server data is handled properly.
  • Hello there rjones!

     

     

    Could you send me the HTTP::header remove Accept-Encoding statement that you used? I am having problems with my .css files trying to change from http to https.

     

     

    Thanks in advanced.

     

     

    Rom
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Hi Rom

    I'll hazard a guess it was:
    when HTTP_REQUEST {
      HTTP::header remove Accept-Encoding
    }

    If you don't have other logic that requires an iRule, you could instead customize your http profile & set the value of "Request Header Erase" to "Accept-Encoding"

    HTH

    /deb