我使用的是Wordpress 4.9+,我认为默认情况下它是通过REST api启用的。我的永久链接设置为Month and Name
我正在为我的网站使用猎狐犬反应主题。
现在,我的rest api应该可以在
http://example.com/wp-json/wp/v2/posts
http://example.com/index.php/wp-json/wp/v2/posts
/index.php
前缀我已经用Lamp服务器手动部署了aws ubuntu micro中的所有内容。Wordpress文件位于根文件夹中(/var/www/html/
)
此外,我还使用以下步骤尝试了mod\\u重写模块
a2enmod rewrite
sudo service apache2 restart
这是我的.htaccess
文件# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress