I want to force a secure connection on some of my pages (ones with forms), but I don’t want the whole site to work with ssl (slows it down)
Is there a way to configure specific pages to require ssl?
I want to force a secure connection on some of my pages (ones with forms), but I don’t want the whole site to work with ssl (slows it down)
Is there a way to configure specific pages to require ssl?
You must be logged in to post a comment.
Use the admin-ssl plugin. For stuff outside of wp, use rewriite rule in apache
New workflow, since the Admin SSL plugin is not supported.
use the Plugin WP https
See the settings
If you want SSL for
wp-admin
, add this to thewp-config.php
:If you want also SSL for the log in page, add this to the
wp-config.php
Add the follow line to the
.htaccess
; remove the default of WPIf you set a specific page/post to SSL in front-end, then use the following plugin or set the option in the editor of the post/page; only if you have active this possibility of the plugin WP https. see also Gist 4081291 for a sample plugin
Without Plugin WordPress HTTPS
or a smaller version, but not with fallbacks, if the url is wrong
For WordPress version 3.0 and above, the admin-ssl plugin does not work. In order to get SSL to work, you need to take two steps:
You should be all set after that.
Try the Better WP Security Plugin. Along with a bunch of helpful tweaks to secure your site, it has some settings that allow you to force ssl to the login page, or the entire back-end if you choose, and to selected pages on the front end per content via a selection box added to the visual editor. Very easy to use.
Of course, you do have to have SSL set-up on your server first, meaning you either have to install a self-signed certificate (not recommended) or pay for a certificate from a 3rd party authority and install it on your server.
I had multiple problems with your solutions (but it helped me). I’ll put my solutions here for the following case :
.First i only used this WP extension : “SSL Insecure Content Fixer” who can handle WPMU, and the “mixed content” error (Since “WordPress Https” is deprecated and not working for me)
.Secondely, the is_ssl() function wasn’t working with nginx proxy so i used this one :
.Also “is_page()” wasn’t working so this is my final code (for redirecting the specific pages” to https)
Both of the plugins mentioned above seem to be outdated or at least haven’t been maintained ina while. The WordPress-https plugin seems to be the best option and will force ssl on the entire site or just on certain pages.
Below would be the best “WordPress” way to do it, i have fully commented it for you to explain what its doing.
Non commented version for neatness 🙂 (same exact code)