I try to redirect all urls to the root except for the wordpress administration and the wordpress REST API.
I have these rules in my .htaccess
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp-admin.*
RewriteCond %{REQUEST_URI} !^/wp-json.*
RewriteRule ^.*$ / [L,R=301]
</IfModule>
It's work perfectly for all redirections expect for the /wp-json
route where I get 404 errors.
Also, I have these errors types in my apache log file:
File does not exist: [...]/dmjob/wp-json, referer: http://dmjob.dev:8888/
Can you please help me ? Thanks a lot ! :)