Serve Https Urls on Https Pages

I recently had to dig up some of my old code which ensures https urls are served up on https pages. The function occured to me as being pretty clean, so much so that I thought I should share it with the world :-).

First the function that serves up the https:

Then you just wrap it in the conditional to check for https page:

I re-used this the other day to serve https links from Amazon S3, but you can use it anywhere you need to serve https urls on https pages.

Posted in Code Snippets and tagged , .

Leave a Reply

Your email address will not be published. Required fields are marked *