title: htaccess - redirecting all requests to domain root
body: <p>I have a site that is no longer needed live and has a holding page setup to state that it's no longer available. All requests to pages on the site (bookmarked or otherwise) need to be sent to this page which is the root index.php page, so I'm using some htaccess to redirect it accordingly.</p>
  
  <p>I'm currently using this:</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} !^/index.php$
  RewriteRule ^(.*)$ /index.php [R=302,NC,L]
  </code></pre>
  
  <p>which does the job, but adds index.php to the url - ie. www.domain.com goes to www.domain.com/index.php</p>
  
  <p>It'd be much nicer to have just www.domain.com, but apparently I can't do that using:</p>
  
  <pre><code>RewriteCond %{REQUEST_URI} !^/$
  RewriteRule ^(.*)$ / [R=302,NC,L]
  </code></pre>
  
  <p>It gives a page not redirecting properly error in firefox.</p>
  
  <p>I'd have expected the above to check to see if the REQUEST_URL isn't / - ie. www.domain.com and then redirect it to / eg. www.domain.com/dave.php -> www.domain.com - thus www.domain.com passes, but everything else is redirected... what's it actually doing and how to I get it to do what I want it to?</p>