admin管理员组文章数量:1321440
I've migrated a site from a live server to a localhost using the WP Migrate DB plugin. I've done this process a couple of times before and it's all been fine. This time however I've migrated a site from an https: connection and I can't get into the site on my localhost. It gives me the following error:
This site can’t provide a secure connection
localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
I'm guessing that in the back end of Wordpress I need to change something either in the database, or in the Dashboard > Settings > General tab.
At the moment I can't get into the site though, so I would think i'll have to do it via the database?
Any help or assistance would be awesome. I don't quite know where to start.
Paul.
I've migrated a site from a live server to a localhost using the WP Migrate DB plugin. I've done this process a couple of times before and it's all been fine. This time however I've migrated a site from an https: connection and I can't get into the site on my localhost. It gives me the following error:
This site can’t provide a secure connection
localhost sent an invalid response.
ERR_SSL_PROTOCOL_ERROR
I'm guessing that in the back end of Wordpress I need to change something either in the database, or in the Dashboard > Settings > General tab.
At the moment I can't get into the site though, so I would think i'll have to do it via the database?
Any help or assistance would be awesome. I don't quite know where to start.
Paul.
Share Improve this question edited Jun 30, 2017 at 0:48 Johansson 15.4k11 gold badges43 silver badges79 bronze badges asked Jun 29, 2017 at 23:52 pjk_okpjk_ok 9082 gold badges15 silver badges36 bronze badges5 Answers
Reset to default 7This is because the site_url
and homeurl
of your original installation are set to HTTPS in the database, so you can't access your website on localhost unless you:
- Change these values to non-ssl
- Install a SSL certificate on localhost
I will only explain the first case since installing a certificate is out of this community's scope.
To do this, you have 2 options.
Directly edit the downloaded SQL file
Open the MySQL export that you just downloaded from your server. Search for wp_options
and you will find a line in your database like this:
INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES
The 2 lines below this one are siteurl
and homeurl
. Change both of their values to http://localhost/
. Pay attention to quotes and commas! So, the 3 first line will look like this:
INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES
(1, 'siteurl', 'http://localhost/', 'yes'),
(2, 'home', 'http://localhost', 'yes'),
Then upload your SQL file. That's it.
Update the values by PHPMyAdmin
If you have PHPMyAdmin installed on your localhost, or you have enough knowledge to directly update the tables via command line, the proceed with this method.
Login to your database by PHPMyAdmin. From the left navigation menu, choose the proper database. Now, select the wp_options
table from the right section.
Again, the two beginning values will be siteurl
and homeurl
, which you can simply update to http://localhost/
without worrying about making a mistake by editing the original SQL file.
In the wp_options table, you will find two rows that have the site URL. Change those two values.
Your media and other links to internal pages might have to adjusted, though. That's why I let the great WP Clone plugin (https://wordpress/plugins/wp-clone-by-wp-academy/ ) do all the work for me. You just install the plugin on the source system, back it up, then install the plugin on the target system, and restore.
Great plugin, takes all the work out of moving (cloning) a site. I sometimes have to do the restore twice (the first fails for a mysterious reason), but the retry works just fine. All data, users, content, etc moved very nicely.
For my part, it was different from the other answers. My database was set correctly to http://localhost
but I had a plugin installed to manage SSL (Really Simple SSL).
So I renamed the folder /wp-content/plugins/really-simple-ssl
to something different and it worked.
And to access /wp-admin
without SSL, you need to change your /wp-config.php
file and set FORCE_SSL_ADMIN
to false
.
I have faced this problem. what i did is that-
- remove wp-security plugin
- remove wp-config defien force SSL
- removed browser cache
- changed wp-option table site_url and home URL
- updated .htaccess with wp default .htacess
Nothing works.
Finally what I did is that-
Removing .htaccess permanently works fine for me.
Hope this will help someone to get rid of this problem.
That you can do quickly with these 2 constants offered by WordPress.
Your add it to the start of the wp-config.php
file and after the opening of the <?php
tags.
define ('WP_HOME', 'http://localhost/wordpress-folder-name' );
define ('WP_SITEURL', 'http://localhost/wordpress-folder-name' );
本文标签: databaseHow to migrate a HTTPS WordPress installation to localhost
版权声明:本文标题:database - How to migrate a HTTPS WordPress installation to localhost? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742101649a2420827.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论