title: htaccess Redirect Folder without destroying what's before the folder request
body: <p>Basically I need to redirect a folder with multiple media files stored like: (with a space in the name)</p>
  
  <blockquote>
    <p>foo.com/my folder/</p>
  </blockquote>
  
  <p>to a folder</p>
  
  <blockquote>
    <p>foo.com/myfolder/</p>
  </blockquote>
  
  <p>BUT, as I use multiple PHP functions, that do request those files in the folder, the redirection must also keep requests alive such as:</p>
  
  <blockquote>
    <p>other.com/anyfolder/function.php&amp;src=foo.com/my folder/mediaxyz&amp;attribut1&amp;attribut2</p>
  </blockquote>
  
  <p>A basic redirect I set up was just redirecting every request to foo.com/myfolder, which broke the dynamic function.php requests, hence like:</p>
  
  <blockquote>
    <p>other.com/anyfolder/function.php&amp;src=foo.com/<strong>my folder</strong>/mediaxyz&amp;attribut1&amp;attribut2</p>
  </blockquote>
  
  <p><strong>not</strong> to:</p>
  
  <blockquote>
    <p>other.com/anyfolder/function.php&amp;src=foo.com/<strong>myfolder</strong>/mediaxyz&amp;attribut1&amp;attribut2</p>
  </blockquote>
  
  <p>but to:</p>
  
  <blockquote>
    <p>foo.com/myfolder/mediaxyz&amp;attribut1&amp;attribut2</p>
  </blockquote>
  
  <p>Will this new redirection work?</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^my\ folder/(.*) /myfolder/$1 [R=301,NC,L]
  </code></pre>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>In the meantime I also tried:</p>
  
  <pre><code>RewriteCond %{THE_REQUEST} ^GET\ /my\ folder/
  RewriteRule ^(.*)/my\ folder/(.*) /myfolder/$1 [R=301,NC,L]
  </code></pre>
  
  <p>and the same for /my%20folder/ and the REGEX in brackets with native space like "^(.<em>)/my folder/(.</em>)"</p>
  
  <p>All redirections simply redirect an incoming link to the base URL, breaking every dynamically created media from function.php.</p>