title: mod_rewrite redirect for non-existent URL's
body: <p>I've got a an old website that I've taken over. New users essentially get a custom page created for them. It was done in a less than fantastic manner. Currently it actually generates a file named for the slug URL created and symbolically links it to a folder called "/main/". Obviously I want to change this. My plan was simply to have it redirect non-existant folders to "/main/" via .htaccess. Currently this is what my .htaccess looks like:</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt|index\.htm)
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /main/ [L]
  </code></pre>
  
  <p>However this generates a redirect loop. What am I missing?</p>
  
  <h1>Edit</h1>
  
  <p>On that note, I realized I should say I want it to maintain the path that's input. For example if I put <a href="http://www.mydomain.com/test_person" rel="nofollow">http://www.mydomain.com/test_person</a> it should maintain that address, but forward everything to the main folder if that makes sense.</p>