2015年7月4日 星期六

Arrange CloudFlare’s free Versatile SSL in your WordPress website

I have been which means to play with CloudFlare’s free SSL options for some time, and I lastly obtained round to offer it a attempt. It took me a short while to get to some extent the place the whole lot labored correctly, however I feel I lastly figured every part out!

If you wish to use CloudFlare’s free Versatile SSL in your WordPress website, listed here are some directions that would assist you!

  1. I set each my website tackle and WordPress handle to make use of HTTPS underneath Settings > Basic in my dashboard.
  2. I enabled Administration over SSL ([reference](http://ift.tt/15h1tIs)) by including the next to `wp-config.php`:
    /**
     * Admin over SSL
     */
    outline('FORCE_SSL_ADMIN', true);
    
  3. I set the port to 443 by including the next to wp-config.php:
    /**
     * Set port to 443
     */
    $_SERVER['SERVER_PORT'] = 443;
    
  4. I put in and activated [the CloudFlare plugin](http://ift.tt/1jMRcbx).
  5. I arrange CloudFlare on my website by creating the location on [CloudFlare.com](http://ift.tt/riXWJs) and updating my DNS.
  6. In my CLoudFlare settings, I created a [Page Rule to redirect all traffic from HTTP to HTTPS](http://ift.tt/1JM40KP).
  7. Every part then appeared to work correctly, however I ran right into a redirect loop drawback when making an attempt to entry my dashboard. The error was [documented on CloudFlare’s website](http://ift.tt/1JEJKNP), they usually steered utilizing their plugin to repair the difficulty, however it did not work on my finish. So I added this to my `wp-config.php` file:
    /**
     * Clear up the redirect loop problem when redirecting all visitors to HTTPS in CloudFlare
     * @see http://ift.tt/1JEJKNS
     * @see http://ift.tt/1JM3ZGJ
     */
    if ( isset( $_SERVER['HTTP_CF_VISITOR'] ) && strpos( $_SERVER['HTTP_CF_VISITOR'], 'https' ) !== false ) 
            $_SERVER['HTTPS'] = 'on';
    
    

    This comes straight from [another plugin I found in the WordPress plugin repository](http://ift.tt/1JEJKNS), so you possibly can use that plugin as nicely should you choose.

  8. I added the next line to a performance plugin to pressure Jetpack’s Photon module to serve photographs over SSL, and thus keep away from combined content material

    The post Arrange CloudFlare’s free Versatile SSL in your WordPress website appeared first on DICKLEUNG DESIGN 2014.

沒有留言: