title: htaccess | redirect 301 all files to homepage
body: <p>Sorry to be asking yet another htaccess question but I have searched at length and can't crack it.</p>
  
  <p>I have changed my website to a single page, www.mysite.com/index.html. Previously there were subdirectories and sub-subdirectories, all with a combination of html and other files in them.</p>
  
  <p>I now want all file requests to be directed to the homepage, and for the homepage to display in the browser bar. Eventually I want to remove the old directories and images, but I'm assuming for now that Google needs me to keep them in order to transfer any ranking (is this right?).</p>
  
  <p>There is just one exception to the rule that all traffic should go to www.mysite.com. I have bought another domain www.mysite2.com for SEO reasons. Currently this site has no hosting and is set to redirect to www.mysite.com. If users find www.mysite2.com, I would like them to see content from www.mysite.com but display the domain name www.mysite2.com. </p>
  
  <p>This is the htaccess code I am currently using:</p>
  
  <pre><code>Options +FollowSymLinks
  RewriteEngine On  
  
  RewriteCond %{SCRIPT_FILENAME} !-d  
  RewriteCond %{SCRIPT_FILENAME} !-f  
  
  RewriteRule ^([^?]*)$ /index.html?path=$1 [NC]
  
  Options -Indexes
  IndexIgnore *
  
  RewriteCond %{HTTP_HOST} ^mysite.com
  RewriteRule ^(.*) http://mysite2.com/$1 [P]
  </code></pre>
  
  <p>I have several questions/problems:</p>
  
  <p>1) the www.mysite2.com redirect threw a 404 file not found error when i tried to access www.mysite.com. (I am having to test in live production... not great).</p>
  
  <p>2) typing in www.mysite.com/products/ (former directory, still existing) takes me to www.mysite.com/// - it works but is unsightly.</p>
  
  <p>3) typing in www.mysite.com/products/subdir/file.html still takes me to that original file</p>
  
  <p>4) typing in www.mysite.com/lsdhfskdhf (i.e. a non-existent location) displays the homepage but continues to show the string.</p>
  
  <p>5) typing in www.mysite.com/products/ksjdhfkdsjfh (i.e. non-existent location) displays the homepage but without any css formatting (!).</p>
  
  <p>6) Should i be using Redirect 301 instead of RewriteRule? I heard that Google only likes 301 redirect.</p>
  
  <p>I am a bit stuck and would welcome any help! Even if there is a comprehensive guide somewhere to whatever language apache is using in its directories that would be good. Lots of sites claim to this but i haven't found a good one.</p>
  
  <p>Apologies for length.</p>
  
  <p>Thanks
  Emma</p>