title: Set up of conditional redirect in htaccess
body: <p>I've been asked to make an existing web site multi-language.</p>
  
  <p>In preparation for this I have had to move all existing pages from /path/page to /en/path/page</p>
  
  <p>To maintain any existing incoming links I now need to set up an htaccess redirect to send any requests from their original urls to the new /en/path/page urls but I'm having trouble getting this to work.</p>
  
  <p>This is what I currently have;</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} !^/en$
  RewriteRule ^(.*)$ /en/$1 [R=301,L]
  </code></pre>
  
  <p>Which I <em>think</em> is meant to check the requested URI and if it doesn't begin with /en then prepend /en onto the requested URI... but I'm obviously mistaken since it doesn't work.</p>
  
  <p>Any help appreciated. Thank you.</p>
  
  <p>UPDATE.
  Since this is an ExpressionEngine site and there is an additional rule to remove the index.php portion of the URL here are both rules</p>
  
  <pre><code># Rewrite for new language based urls
  # This is to try and get all current pages going to /en/(old url) with a 301 redirect
  RewriteCond %{REQUEST_URI} !^/en(/.*)?$
  RewriteRule ^(.*)$ /en/$1 [R=301,L]
  
  
  # Removes index.php
  RewriteCond $1 !\.(gif|jpe?g|png|ico)$ [NC]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /index.php/$1 [L]
  </code></pre>
  
  <p>I have also tried this with the language rewrite after the index.php one. I'm still getting stuck in loops.</p>