Support » Localhost Installs » REST API 404 error, probably related to my localhost setup (Apache)

  • Resolved audunmb

    (@audunmb)


    I’m getting a 404 REST API -endpoint error on my localhost install (LAMP). The site is duplicated (with Duplicator) from a live site, and the live site doesn’t have the issue.

    Though, I’m using a block editor theme (Twenty Twenty Three) on the local install (I’m going to switch themes on the live site later).

    The error message in Site health:

    REST API-endepunkt: http://localhost/xxxx/wp-json/wp/v2/types/post?context=edit
    REST API-respons: (404) Not Found

    I tried to google for solutions, but couldn’t find anything to that worked. I’ve ruled out:

    • plugin conflicts (deactivated all of them, no difference)
    • .htaccess looks fine
    • tried resaving permalinks
    • checked url structure. Looks to be correct. The install is in a subfolder, but that shouldn’t cause an issue
    • swithching themes or enabling Classic editor is pointless as I need the block editor theme to work (and it is a clean twenty twenty three theme)
    • mixed content error shouldn’t apply as the localhost is http only
    • I don’t have any firewall plugins or similar to cause issues

    So I guess it has something to do with my setup (LAMP with Manjaro Linux). I found a post where someone changed the configuration for the web directory in Apache (DocumentRoot) to “AllowOverride All”, but that didn’t help. I also tried to change permissions for .htaccess, but that didn’t help either.

    Anyone who can help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter audunmb

    (@audunmb)

    I’m somehow managed to get this fixed by messing about with .htaccess. I don’t know what the solution was, but now it works.

    Ho avuto lo stesso problema con l’aggiornamento a 6.4.2 da dicembre 2023 e non ne vengo a capo, qualcun altro che ha avuto lo stesso problema può aiutarmi. veramente non so come fare, potrebbe essere colpa di W3 Total Cache?

    W3 TC non mi segnala errori però il plugin si è anch’esso aggiornato ed iniziato il guasto:

    Endpoint REST API: https://casadelsolesanvitolocapo.com/wp-json/wp/v2/types/post?context=edit
    Risposta REST API: (404) Not Found

    Inoltre nello stato di salute, mi compare sotto l’errore (404) Not Found anche che dovrei utilizzare la cache di oggetti persistenti

    La cache di oggetti persistenti rende il tuo database più efficiente, velocizzando i tempi di caricamento, perché WordPress può scaricare il contenuto e le impostazioni più velocemente.

    Il tuo fornitore di hosting può dirti se la cache di oggetti persistenti può essere abilitata per il tuo sito.

    Grazie

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.