• I want to use a wordpress CMS as backend for a vuejs router based site.

    If I adapt the .htaccess file as in the documentation of vuejs, I can access my routes, i.e. open paths with defined content. simple catchall an redirect to the index.html oy my vuejs site

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.html$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.html [L]
    </IfModule>

    I can also open wp-admin without any problems, but the REST API stops working:

    https://www.site.com/wp-json/wcra/v1/pagerecursive/?parentId=0

    then the catchall runs https://www.site.com.

    How can I ensure that the REST API call is processed by wordpress. How can Idefine a rule for wp-json?

    • This topic was modified 2 years, 1 month ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    That .htaccess is the normal default rule set (except for a directive regarding SSL is missing) Nothing there would prevent the API from working.

    wp-json/wcra/v1/pagerecursive is not a default API route. If it is not working, there could be an issue with the plugin that had added it. Before we dig deeper, get into wp-admin and visit the permalinks settings page. This causes the necessary rewrite rules to be regenerated. A default route like wp-json/wp/v2/posts should at least work.

Viewing 1 replies (of 1 total)
  • The topic ‘how to config vuejs routing and wordpress as headless on a apache server’ is closed to new replies.