• Resolved manish21

    (@manish21)


    Wordpress version 4.9.8

    I am running on localhost using apache server.
    Tried the following
    Permalink Settings : Post Name
    Enabled in Apache webserver
    LoadModule rewrite_module libexec/apache2/mod_rewrite.so
    Added file .htaccess
    cat .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

    curl https://localhost/wp-json/wp/v2/pages
    <!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/wp/v2/pages was not found on this server.</p>
    </body></html>

    curl https://localhost/?rest_route=/wp/v2/pages
    <html><body><h1>It works!</h1></body></html>

    • This topic was modified 6 years, 3 months ago by manish21.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Getting 404 for Rest API’ is closed to new replies.