Wordpress SSL


In case you ever need it this how you can make wordpress (or any other site for that matter) respond to being viewed as https:

In the header include or start of page, turn on buffering:

// start output buffering for https link checking in application_bottom.php
ob_start();

In the footer include or at end of the page:

// Filter certain content for http reference on https pages
$page = ob_get_contents();
ob_end_clean();

if ($_SERVER["HTTPS"] != “on”)?echo $page:else echo; preg_replace(’/((?:<link|<script|<img|SWFobject)[^>\)]+?)http:\/\//’,'$1https://’,$page);

Not much to it but it works.

, ,

  1. No comments yet.
(will not be published)
Security Code:

  1. No trackbacks yet.