Solution:
1. Modify the code
1. Open the root directory file of the website \wp-includes\functions.phpand find the code require( ABSPATH . WPINC . ‘/option.php’ );around line 8.
Add the following code below:
add_filter(‘script_loader_src’, ‘agnostic_script_loader_src’, 20,2); function agnostic_script_loader_src($src, $handle) { return preg_replace(‘/^(http|https):/’, ”, $src); }
add_filter(‘style_loader_src’, ‘agnostic_style_loader_src’, 20,2); function agnostic_style_loader_src($src, $handle) { return preg_replace(‘/^(http|https):/’, ”, $src); }
2. Open the website root directory\wp-config.php file and find the code
Add the following code below:
*
* @package WordPress
*/
$_SERVER[‘HTTPS’] = ‘on’;
define(‘FORCE_SSL_LOGIN’, true);
define(‘FORCE_SSL_ADMIN’, true);
After completing the above two steps, you can access wordpress httpsthe backend of the website normally and log in to the WordPress backend.
2. Backstage modification
Click 设置-常规-常规Options to
WordPress URL
Site address (URL)
insert image description here
Then you also need to make sure that you change the “full URL address of the file” to the https protocol through the “Multimedia” menu in “Settings”. If the full URL address of the file was the default before, then you don’t need to modify it.
insert image description here
At this time, there is a small yellow exclamation mark on the https website lock (some of the content inside is not safe, such as images). There is an error in the https certificate. The image link address of the website article content page may still start with http://, or the external link may not be https.
3. Modify the database
update wp_posts set post_content = replace(post_content, ‘http://example.com’,’https://example.com’);
reference:
Author of this article : Bin Zaijun
About the blogger : Comments and private messages will be replied to as soon as possible. Or you can send me a private message directly.
Copyright statement : All articles in this blog adopt the BY-NC-SA license agreement unless otherwise stated . Please indicate the source for reprinting!
Support the blogger : If you think the article is helpful to you, you can click [ Recommend ] in the lower right corner of the article . Your encouragement is the blogger’s greatest motivation!