title: replace all instances of string in htaccess
body: <p>Simple question here.</p>
  
  <p>I need to replace all instances of a string in the URL with another string.</p>
  
  <p>IE. I need to replace every instance of "test" in the URL, with .htaccess code.</p>
  
  <p>For example "www.example.com/test/A/test/B/test" will become "www.example.com/REP/A/REP/B/REP".</p>
  
  <p>I can produce a script that replaces "test" with "REP", when "test" is not at the end or the beginning of the script. But I cannot come up with a final script to replace "test" everywhere.</p>
  
  <p>My code:</p>
  
  <pre><code>RewriteRule ^test\/(.*) REP/$1 [L,R=301]
  </code></pre>
  
  <p>Thanks!</p>