WordPress.org

Ready to get started?Download WordPress

Forums

SSL only for one wordpress page? (2 posts)

  1. Seth C
    Member
    Posted 3 years ago #

    Hi,

    I have a contact form on my site that I want to secure with SSL. I already purchased it and was able to get it working with my entire site, however I still haven't found a way to only get it on the contact. Does anyone know how to do this?

    Thanks

  2. westondeboer
    Member
    Posted 3 years ago #

    your going to have to create a custom template for contact instructions can be found here:
    http://codex.wordpress.org/Pages#Page_Templates

    and at the top of that template file put this.

    // If page requires SSL, and we're not in SSL mode,
    // redirect to the SSL version of the page
    if($requireSSL && $_SERVER['SERVER_PORT'] != 443) {
       header("HTTP/1.1 301 Moved Permanently");
       header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
       exit();
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags