0

I have recently enabled my WordPress website to use an SSL Cert for administration/login pages. I am using the plugin W3 Total Cache with my Content Delivery network. I have noticed that when I am viewing all posts and click on the preview link, it sends me to a still secured web-page that is NON-relevant to the admin pages. This causes issues with mixed content being received from my CDN (insecure) and my web-server (secure).

Is there a RewriteRule I could use that would fix this or have I missed a setting that should not be causing this to happen?

I do not want to use HTTPS on ANY front-end pages, except for the login page. Even when I am previewing posts, as this is unnecessary and causes issues.

Any help?

3

WordPress has a number of implicit assumptions with regards to using SSL. Specifically, if you are using force_ssl_admin, and the "front" of your site has the same domain as the "back" does, then it assumes that your entire site is actually accessible either via http or https.

This happens in a few different places. Most notably, the Theme Customizer intentionally loads the preview window (the front end view of your site) using SSL when force_ssl_admin is on and the domain of the site matches. The Preview link on the posts screen will be relative and thus will go to an SSL page too.

So, the short answer is that this is by design and it probably will not be fixed by WordPress core anytime soon. It is expected that your site will work over SSL if you're using SSL anywhere, and so it tries to do it that way. If you have anything else on your site actively preventing the front-end from working over SSL, then it will be broken. And many in the community would say that, yes, it is supposed to do that.

You're creating the problem yourself, essentially, by the arbitrary action of disallowing SSL on the front-end. You don't have to actually force SSL on the front-end, but to actively disallow it can lead to security risks. How we define the "front" and "back" end of WordPress is somewhat arbitrary to begin with, and if you really want security, then it has to be capable of loading any page on the whole site with SSL, not just the stuff in wp-admin.

If your CDN is the problem here because they have no https capability, consider a different CDN that will support HTTPS, or maybe change the code to serve from the CDN only over http connections and to use the local versions of files for https ones. That's a short term fix though. A number of CDNs let you point a domain name you control at them, and then you can set up SSL on that domain name. So if you have a certificate for example.com, you could point cdn.example.com at them, then they could use your cert for securing that connection. Or whatever, different CDN's have different ways to support HTTPS.

In the long run, the whole of the web is moving more towards 100% SSL all-the-time. Newer protocols like SPDY (supported in most major browsers) can dramatically boost transfer speeds, and they only really work on SSL connections to begin with. With more and more "hacked" sites, and the recent NSA revelations, and everything else, unencrypted connections are rapidly falling out of favor. So most advice you'll get nowadays will be to just bite the bullet and go forced-SSL over the whole site.

  • Thanks for the tip! Got SSL support from my CDN. Problem solved. – Brandon White Mar 22 '14 at 4:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.