[Plugin: WordPress HTTPS (SSL)] REQUEST: Filter home_url to change HTTPS to HTTP
-
Hi Mike,
I’m using Version 3.0.4 of your plugin in a shared SSL environment, and everything is working fine for me, except for one minor issue. You actually addressed this issue already in Version 2.0.4, but some handy older functionality got lost when the plugin was totally rewritten.
When the login page is secured with SSL, the default behavior of wp-login.php causes the back-to-website link to use HTTPS instead of HTTP. This effectively breaks the link in environments with a shared SSL certificate, because shared SSL does not recognize the site’s custom URL. This behavior is hard-coded into the WordPress home_url function; it uses HTTPS on pages secured by SSL, unless the optional scheme parameter overrides the page’s protocol. Since wp-login.php doesn’t use the scheme parameter when it calls home_url, we get this (often undesirable) default behavior.
You addressed this in Version 2.0.4 of your plugin by filtering the home_url function with a string-replacement function that changes HTTPS to HTTP. I’ve created a very simple plugin of my own that does this for me:
<?php /* Plugin Name: Force HTTP Description: Force back-to-website link in wp-login.php to use HTTP when secured by SSL. Inspired by WordPress HTTPS plugin Version 2.0.4. Thanks, Mike Ems! Version: 1.0 Author: F.W. Chapman Solutions Author URI: https://www.fwchapman.com/ License: Use at your own risk! You're welcome. :) */ add_filter( 'home_url', 'force_http' ); function force_http( $string ) { return str_replace( 'https://', 'https://', $string ); } ?>
Would you be willing to add this functionality back to your updated plugin? It’s way too handy to do without!
Thanks very much,
Fred
P.S. My current request is a continuation of a discussion we started a month ago here and continued here.
https://www.ads-software.com/extend/plugins/wordpress-https/
- The topic ‘[Plugin: WordPress HTTPS (SSL)] REQUEST: Filter home_url to change HTTPS to HTTP’ is closed to new replies.