Wordpress JsonAPI - /wp-json/ was not found on this server

I am using the following plugin Json Rest API.

To test the plugin the documentation states that I should just use:

$ curl -i http://testpress-maxximus.rhcloud.com/wp-json/
HTTP/1.1 404 Not Found
Date: Sat, 24 May 2014 07:01:21 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 303
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /wp-json/ was not found on this server.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at testpress-maxximus.rhcloud.com Port 8
0</address>
</body></html>

As you can see nothing is found by the URL. Any recommendations if there is a problem with the API or wordpress?

I appreciate your reply

Answers


The current version of REST api for sites with pretty permalinks not enabled, the url

    yoursite.com/?rest_route=/ 

will work .


The WordPress JSON API depends on pretty permalinks, make sure you have them enabled for the site.


In my case, I got this error after installing/configuring apache2 on my local linux machine. I finally found the error to be cause by the rewrite module not being enabled which I fixed using,

sudo a2enmod rewrite

as well as ensuring that my apache2.conf file (located in the folder /etc/apache2) has its<Directory> directive 'AllowOverride' set to all rather than none, from

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory>

to

<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

then I restarted apache2 service and the problem was resolved.


I have faced this issue several times . The solution is this :

Login into your wordpress site : example.com/wp-admin

Then click on settings

Then click on permalinks

Then set permalinks to "post-name"


If you have correctly installed the plugin, be sure to flush the rewrite rules.

This can be accomplished with the wp-cli: http://wp-cli.org/commands/rewrite/flush/


I was running WP on a local dev environment in a subdomain of localhost (eg mysite.localhost:8888)

The solution for me was to update the virtual host config in httpd-vhosts.conf to set directory options, similarly to Aurovrata's answer:

<VirtualHost *:8888>    
    ServerName mysite.localhost    
    DocumentRoot "/Users/myusername/mysite"    
    <Directory /Users/myusername/mysite>
        Options Indexes FollowSymLinks
        AllowOverride All        
    </Directory>
</VirtualHost>

Sometimes the solution is crazy and easy! Go to the permalink settings by moving to Admin -> Settings -> Permalinks...then just hit Save Changes without doing anything else! This refreshes the memory of WordPress.

Why is that? For a situation I had before, I had changed the main website URL so I had to refresh the permalinks as well.


Need Your Help

Error running 'bundle install' using Ruby 1.9.3

bundler gemfile ruby-1.9.3

I'm going through the second edition of Ruby on Rails Tutorial (http://ruby.railstutorial.org/). I'm following each step, so I'm using Ruby 1.9.3 and when I run 'bundle install' inside my Rails pro...

Django: track down causes of DeprecationWarning

django warnings deprecated

I've upgraded to Django 1.4 and now when I run my development server I get the following warning: