I'm trying to develop a vuejs frontend site with wordpress as headless CMS.
so far everything is fine, but one thing worries me.
the frontend is served at domain.com/index.html so I renamed the wordpress root document index.php to _index.php. For reading the /wp-json/v2/ API I added
RewriteRule ^wp-json/(.*) /_index.php [L]
to the apache .htaccess file to redirect the call.
However, if I now also want to call the old json API with ?json=, the
RewriteRule ?json(*) /_index.php [L]
or
RewriteRule ^?json=(.*) /_index.php [L]
does not work.
how can I use both APIs, no idea why the rewriteRule doesn't work.
this is how mine looks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^wp-json/(.*) /_index.php [L]
#RewriteRule ^?json(*) /_index.php [L]
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
by the way: is there a way with the json API V2 to output the pages recursively as Parent/Child tree?