Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Created February 29, 2012 14:12
Show Gist options
  • Save thom4parisot/1941132 to your computer and use it in GitHub Desktop.
Save thom4parisot/1941132 to your computer and use it in GitHub Desktop.
WordPress + AlwaysData + HTTPS = #win
<?php
add_action('init', 'alwaysdata_ssl');
/**
* Enables proper HTTPS detection with WordPress and Alwaysdata
*/
function alwaysdata_ssl()
{
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
{
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment