Wordpress Single Page SSL
Ok, we have all seen this question a million times, but I am looking for an updated answer.
How can we have a single page encrypted with SSL on a Wordpress install? Even further, how can we make that single page commun开发者_StackOverflowicate with the server via SSL?
Note: You cannot use plugins to accomplish this. I have seen what is out there, and personally think all of them are inefficient when it comes to accomplishing this. The best solution I have seen thus far is using an if statement in the wp-config.php file at page load. But does this solve the AJAX issue?
I'm old school, so I would probably do it with a .htaccess rule that redirects to the https version. As far has having it submit as https, that a matter of having the form's action=something
do the right thing.
All of this assumes that you do have an SSL cert properly set up on the server.
The best way to accomplish this seems to be in the wp-config.php file using:
if( !empty($_SERVER['HTTPS']) ) {
define( 'WP_SITEURL', 'https://yourdomain.com' );
define( 'WP_HOME', 'https://yourdomain.com' );
}
If someone has a better way, I would love to hear it!
精彩评论