WordPress.org

Support

Support » Plugins and Hacks » SSL Insecure Content Fixer » [Resolved] Menu redirecting to 'http' home page as 'https'

[Resolved] Menu redirecting to 'http' home page as 'https'

  • Hi,

    It’s really a great plugin. Thanks for it.
    I have an issue with the wordpress menu. I’ve made a single page ssl secured. But when I redirect to Home page through Menu from the secured page, it treats the home page as secured which I don’t want.
    How to keep the home page with ‘http’ protocol?

    Thanks & regards,
    Akshay

    https://wordpress.org/plugins/ssl-insecure-content-fixer/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    Got the answer after searching a lot.
    From this link
    Here’s the code:

    function force_ssl()
    {
        // Specify ID of page to be viewed on SSL connection
        if (is_page(2324) && !is_ssl () )
        {
          header('HTTP/1.1 301 Moved Permanently');
          header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);
          exit();
        }
        // All other pages must not be https
        else if (!is_page(2324) && is_ssl() )
        {
            header('Location: http://' . $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
            exit();
        }
    }
    add_action('template_redirect', 'force_ssl');

    Plugin Author webaware

    @webaware

    Good work 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Menu redirecting to 'http' home page as 'https'’ is closed to new replies.
Skip to toolbar