title: .htaccess redirect and rewrite url if REQUEST_URI starts with specific path
body: <p>I am working on a Wordpress site, it requires a plugin that needs to access the API endpoint of WP.</p>
  
  <p>It wants to access the site's:</p>
  
  <pre><code>http://myhost.test/wp/wp-json/erp/v1/hrm/employees/1\?include\=department,designation,reporting_to,avatar,roles
  </code></pre>
  
  <p>but changes to the folder structure, causes the real, and actual link should be:</p>
  
  <pre><code>http://myhost.test/wp-json/erp/v1/hrm/employees/1\?include\=department,designation,reporting_to,avatar,roles
  </code></pre>
  
  <p>as you can see, there should be no <code>/wp</code> at the start of the <code>%{REQUEST_URI}</code></p>
  
  <p>I am trying to make this work: but it won't redirect the request:</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_URI} ^/wp/wp\-json/
  RewriteRule ^/wp/wp\-json(.*) /wp\-json$1 [L,R]
  </code></pre>
  
  <p>I do not understand what I am doing wrong,</p>
  
  <p>I am catching everything after <code>^/wp/wp-json</code> then forward it to <code>^/wp-json</code></p>
  
  <p>What is going on?</p>
  
  <p>Regards,</p>