WordPress地址(URL)修改后打不开网站的解决方法
原创
©著作权归作者所有:来自51CTO博客作者zdb呀的原创作品,请联系作者获取转载授权,否则将追究法律责任
乖,下次别改了
在后台的设置里,WordPress地址(URL)是不能随便更改的,只有站点地址(URL)可以随意动。如果更改了WordPress地址(URL),主页面可能就丢失了。
解决方法
登录到服务器的mysql中改回来
- 用Xshell或宝塔登录Linux终端
- 登录mysql
mysql -u账号 -p密码
show databases;
后续操作如下:
mysql> select * from wp_options limit 1;
+-----------+-------------+--------------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+--------------------------+----------+
| 1 | siteurl | https://www.zdbya.com/wp | yes |
+-----------+-------------+--------------------------+----------+
1 row in set (0.00 sec)
mysql> UPDATE wp_options SET option_value="https://www.zdbya.com" WHERE option_name="siteurl";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select * from wp_options limit 1;
+-----------+-------------+-----------------------+----------+
| option_id | option_name | option_value | autoload |
+-----------+-------------+-----------------------+----------+
| 1 | siteurl | https://www.zdbya.com | yes |
+-----------+-------------+-----------------------+----------+
1 row in set (0.00 sec)