WordPress Rest API路由在本地主机显示404错误

我已经在WordPress 4.8中创建了一个主题。当我尝试连接Rest API时, 在本地显示404错误, 但是在我的域上, 它工作正常。

我已经导航到/ etc / apache2 / sites-enabled并打开000-default

所有的AllowOverride变量都设置为None, 我将其替换为All。

但是仍然不能在我的本地主机上工作。


#1


在localhost中添加主机名, 然后尝试通过主机名访问API

要更改主机名, 请转到/ etc目录

并在文本编辑器中打开主机文件, 并在下面添加行

domain.com 127.0.0.1

并保存它, 然后重新启动apache服务

它正在为我工​​作, 希望这会对你有所帮助。


#2


检查权限, 并尝试对你的WordPress文件夹使用chmod -R 777

来源:

https://www.srcmini02.com/66757.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_40327.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?