Apache: Rewrite url containing string to be prepended with index.php

Viewed 25

What i'd like to do is to rewrite, for example, https://qstar-local.lndo.site/wp-json/wp/v2/* to https://qstar-local.lndo.site/index.php/wp-json/wp/v2/* by matching against the wp-json part specifically. How would one do that? I'm really unexperienced with apache configuration overall.

I have the following .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?qstar-local.lndo.site$
RewriteCond %{REQUEST_URI} !^/wordpress/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /wordpress/$1
RewriteCond %{HTTP_HOST} ^(www.)?qstar-local.lndo.site$
RewriteRule ^(/)?$ wordpress/index.php [L] 
</IfModule>
0 Answers
Related