WordPress.org

Support

Support » Plugins and Hacks » WordPress HTTPS (SSL) » [Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?

[Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?

  • GenoGod

    @genogod

    I’ve found this code on the FAQ page but there wasn’t much information.

    function custom_force_ssl( $force_ssl, $post_id ) {
        if ( $post_id == 5 ) {
            return true
        }
        return $force_ssl;
    }
    add_filter('force_ssl' , 'custom_force_ssl', 10, 2);

    I’m not great at PHP but from what I can tell, that’s just to secure one page.

    So instead I added

    force_ssl == true;

    to the header.php file in my theme folder but it still seems it isn’t catching.

    What am I missing?

    Secure site: https://floridaga.net
    Insecure page: http://floridaga.net/members/occupyflorida/

    How the heck do I lock down the entire site??

    http://wordpress.org/extend/plugins/wordpress-https/

Viewing 1 replies (of 1 total)
  • Plugin Author Mike Ems

    @mvied

    Hey GenoGod,

    So you put this?

    function custom_force_ssl( $force_ssl, $post_id ) {
        if ( $force_ssl == true ) {
            return true
        }
        return $force_ssl;
    }
    add_filter('force_ssl' , 'custom_force_ssl', 10, 2);

    If so, that won’t do anything except return true when $force_ssl is already true.

    You would use this to make every page Force SSL:

    function custom_force_ssl( $force_ssl, $post_id ) {
        $force_ssl = true;
        return $force_ssl;
    }
    add_filter('force_ssl' , 'custom_force_ssl', 10, 2);

    You place that code block in the functions.php of your theme. If it doesn’t exist, create it. Using this code is essentially the same as setting your whole site to HTTPS. You may want to consider doing that instead.

    Thanks,
    Mike

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress HTTPS (SSL)] force_ssl on ALL pages?’ is closed to new replies.
Skip to toolbar